Skip to content

Commit

Permalink
fix(dap): dynamic library path setup fix (#425)
Browse files Browse the repository at this point in the history
  • Loading branch information
morfnasilu authored Jun 16, 2024
1 parent d83c843 commit 368b614
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Fixed

- DAP: Dynamic library path setup using nigthly rust builds
(stable rustc was always used due to missed cwd parameter).
- DAP: Dynamic linking on macOS didn't work due to a typo in
`DYLD_LIBRARY_PATH` constant.

## [4.24.1] - 2024-06-15

### Fixed
Expand Down
4 changes: 2 additions & 2 deletions lua/rustaceanvim/dap.lua
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ local function add_dynamic_library_paths(adapter, workspace_root)
if not workspace_root or environments[workspace_root] then
return
end
compat.system({ 'rustc', '--print', 'target-libdir' }, nil, function(sc)
compat.system({ 'rustc', '--print', 'target-libdir' }, { cwd = workspace_root }, function(sc)
---@cast sc vim.SystemCompleted
local result = sc.stdout
if sc.code ~= 0 or result == nil then
Expand All @@ -202,7 +202,7 @@ local function add_dynamic_library_paths(adapter, workspace_root)
elseif shell.is_macos() then
---@diagnostic disable-next-line: missing-parameter
environments[workspace_root] = environments[workspace_root]
or format_environment_variable(adapter, 'DKLD_LIBRARY_PATH', { rustc_target_path, target_path }, ':')
or format_environment_variable(adapter, 'DYLD_LIBRARY_PATH', { rustc_target_path, target_path }, ':')
else
---@diagnostic disable-next-line: missing-parameter
environments[workspace_root] = environments[workspace_root]
Expand Down

0 comments on commit 368b614

Please sign in to comment.