Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(dap): dynamic library path setup fix #425

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading