Skip to content

Update DYLD_LIBRARY_PATH to fix debugging tests in nightly toolchains #1521

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

Merged
merged 2 commits into from
Apr 24, 2025
Merged
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
7 changes: 4 additions & 3 deletions src/toolchain/toolchain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -488,11 +488,12 @@ export class SwiftToolchain {
* Library path for swift-testing executables
*/
public swiftTestingLibraryPath(): string | undefined {
let result = "";
const base = this.basePlatformDeveloperPath();
if (!base) {
return undefined;
if (base) {
result = `${path.join(base, "usr/lib")}:`;
}
return path.join(base, "usr/lib");
return `${result}${path.join(this.toolchainPath, "lib/swift/macosx/testing")}`;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's just missing usr/ prefix, now

Suggested change
return `${result}${path.join(this.toolchainPath, "lib/swift/macosx/testing")}`;
return `${result}${path.join(this.toolchainPath, "usr/lib/swift/macosx/testing")}`;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this.toolchainPath already has /usr prefixed in the path, the comment on it says "one folder up from the swift bin path": https://github.com/swiftlang/vscode-swift/pull/1521/files#diff-219ebe526be52811261023900cb320d9e51723308f63891304bfe53dcab033f1R107

The commit message has a bit of history there that predates my time, it may not be true anymore, however it would be a bigger change to update the toolchainPath everywhere.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, ok if it already has that prefix then great! 👍

}

/**
Expand Down