Skip to content

Commit 368b614

Browse files
authored
fix(dap): dynamic library path setup fix (#425)
1 parent d83c843 commit 368b614

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,15 @@ All notable changes to this project will be documented in this file.
66
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
77
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
88

9+
## [Unreleased]
10+
11+
### Fixed
12+
13+
- DAP: Dynamic library path setup using nigthly rust builds
14+
(stable rustc was always used due to missed cwd parameter).
15+
- DAP: Dynamic linking on macOS didn't work due to a typo in
16+
`DYLD_LIBRARY_PATH` constant.
17+
918
## [4.24.1] - 2024-06-15
1019

1120
### Fixed

lua/rustaceanvim/dap.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ local function add_dynamic_library_paths(adapter, workspace_root)
188188
if not workspace_root or environments[workspace_root] then
189189
return
190190
end
191-
compat.system({ 'rustc', '--print', 'target-libdir' }, nil, function(sc)
191+
compat.system({ 'rustc', '--print', 'target-libdir' }, { cwd = workspace_root }, function(sc)
192192
---@cast sc vim.SystemCompleted
193193
local result = sc.stdout
194194
if sc.code ~= 0 or result == nil then
@@ -202,7 +202,7 @@ local function add_dynamic_library_paths(adapter, workspace_root)
202202
elseif shell.is_macos() then
203203
---@diagnostic disable-next-line: missing-parameter
204204
environments[workspace_root] = environments[workspace_root]
205-
or format_environment_variable(adapter, 'DKLD_LIBRARY_PATH', { rustc_target_path, target_path }, ':')
205+
or format_environment_variable(adapter, 'DYLD_LIBRARY_PATH', { rustc_target_path, target_path }, ':')
206206
else
207207
---@diagnostic disable-next-line: missing-parameter
208208
environments[workspace_root] = environments[workspace_root]

0 commit comments

Comments
 (0)