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

Unable to launch lldb-dap #1192

Open
eluchsinger opened this issue Nov 2, 2024 · 10 comments
Open

Unable to launch lldb-dap #1192

eluchsinger opened this issue Nov 2, 2024 · 10 comments
Labels
bug Something isn't working needs investigation Issue requires some investigation before it can be worked on

Comments

@eluchsinger
Copy link

Describe the bug

When the extension launches upon opening a .swift file, it fails to find lldb-vscode.

I've tried installing llvm using brew and setting a custom path in the settings directly to the lldb-dap and also using the path automatically set by the extension: /Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework/Versions/A/LLDB

To Reproduce
Steps to reproduce the behavior:

  1. Install Extension
  2. Open a .swift file
  3. See error in "Swift" Output (console).

Expected behavior
The extension should start without an error and find lldb-vscode (or lldb-dap).

Environment

  • OS: MacOS Sequoia 15.1
  • Swift version swift-driver version: 1.115 Apple Swift version 6.0.2 (swiftlang-6.0.2.1.2 clang-1600.0.26.4)
  • Visual Studio Code version: Version: 1.95.1 (Universal)
  • vscode-swift version: v1.11.3

Additional context

image
@plemarquand
Copy link
Contributor

Hi @eluchsinger, thanks for the report. Have you installed either Xcode or the macOS Command Line Tools?

Could you share your extension configuration by running the following command from within VS Code, and zipping/attaching the resulting files?

> Capture VS Code Swift Diagnostic Bundle

@award999 award999 changed the title Unable to launch the LSP Unable to launch lldb-dap Nov 4, 2024
@award999
Copy link
Contributor

award999 commented Nov 4, 2024

@eluchsinger can also run the Swift: Select Toolchain command and make sure you have the correct Xcode/toolchain selected. Since it is looking for lldb-vscode, but you listed your swift version as 6.0.2, the wrong toolchain may be selected

@eluchsinger
Copy link
Author

vscode-diagnostics-2024-11-04T22-09-07+01-00.zip

@plemarquand sorry - I thought I had uploaded.

@janniksam
Copy link

janniksam commented Nov 5, 2024

I am having pretty much the same error.
Yesterday I downloaded and fresh installed swift 6.0.2 and in VSCode I'm running into the same issue:
13:22:48: Failed to find /usr/local/swift-6.0.2/bin/lldb-vscode

But there is no lldb-vscode here:
image

Not sure if I forgot to install something. I just was about to start with Swift :)

My setup is a WSL2 Ubuntu 20.04 machine.

@award999
Copy link
Contributor

award999 commented Nov 5, 2024

@eluchsinger since it is trying to use /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/ as the toolchain, it is going to be using whatever is selected as the default toolchain in Xcode. Can you run see if xcrun find lldb-dap:

$ xcrun -find lldb-dap
/Applications/Xcode.app/Contents/Developer/usr/bin/lldb-dap

And if it does find it, can you run the Swift: Select Toolchain VS Code command, and explicitly select the 6.0 toolchain you want to use. You'll have to then reload VS Code.

@award999
Copy link
Contributor

award999 commented Nov 5, 2024

@janniksam your issue seems different, @matthewbastien any idea?

As a temporary workaround you can set the swift.debugger.path setting to the full path to lldb-dap which looks like it would be /usr/local/swift-6.0.2/bin/lldb-dap on your system

@eluchsinger
Copy link
Author

I can try tomorrow, but shouldnt it use whatever is in that path in the config?

@award999
Copy link
Contributor

award999 commented Nov 5, 2024

there is logic to check selected Xcode, DEVELOPER_DIR environment variable, etc. Main thing is what version of swift is XcodeDefault.xctoolchain pointing to?

@janniksam
Copy link

janniksam commented Nov 5, 2024

swift.debugger.path setting to the full path to lldb-dap which looks like it would be /usr/local/swift-6.0.2/bin/lldb-dap

Not producing any errors anymore after applying the workaround.
image

@janniksam
Copy link

image

(The checkbox above also is working)

@award999 award999 added the needs investigation Issue requires some investigation before it can be worked on label Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs investigation Issue requires some investigation before it can be worked on
Development

No branches or pull requests

4 participants