Skip to content

Resolve the swiftly bin path #1632

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

award999
Copy link
Contributor

Was failing to compute the correct lldb-dap path because the user had pointed swift.path to ~/.swiftly/bin. When resolving the path, lldb-dap path ends up being computed as $PWD/lldb-dap. To get around this, if we know the provided path is a swiftly bin directory, then resolve the correct swift path and toolchain path using built-in swiftly commands

Issue: #1619

Was failing to compute the correct lldb-dap path because the user had
pointed `swift.path` to `~/.swiftly/bin`. When resolving the path, lldb-dap
path ends up being computed as `$PWD/lldb-dap`. To get around this, if we
know the provided path is a swiftly bin directory, then resolve the correct
swift path and toolchain path using built-in swiftly commands

Issue: swiftlang#1619
let realSwift = await fs.realpath(swift);
if (path.basename(realSwift) === "swiftly") {
try {
const { stdout } = await execFile(realSwift, ["run", "which", "swift"]);
Copy link
Member

Choose a reason for hiding this comment

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

suggestion: If you know that this is swiftly based on the symlink, then you can use swiftly use --print-location and append usr/bin/swift to the end of that path. This will work on systems that don't have the which command, such as Windows, or a minimal Linux system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants