rust-analyzer: Debug functionalilty broken in VS code on MacOS

rust-analyzer version: 0.3.1885-standalone (b6d1887bc 2024-03-17) Issue also occurs on 0.3.1877-standalone (574e23ec5 2024-03-09) Does not occur on previous versions.

rustc version: rustc 1.73.0 (cc66ad468 2023-10-03)

relevant settings: (eg. client settings, or environment variables like CARGO, RUSTC, RUSTUP_HOME or CARGO_HOME)

  • MacOS 14.3.1 with Apple M1 Pro
  • VS Code Version: 1.87.1 (Universal)
  • CodeLLDB v1.10.0
  • No configurations in launch.json:
{
    "version": "0.2.0",
    "configurations": []
}

Running any #[test] > Debug results in popup: "Unable to start debugging. Launch options string provided by the project system is invalid. Unable to determine path to debugger. Please specify the "MIDebuggerPath" option."

  • No change in any setting other than updating the rust-analyzer extension to one of the two versions above triggers this issue.
  • No problems on rust-analyzer version: 0.3.1868-standalone (037924c4d 2024-03-03) or lower.

repository link (if public, optional): -

code snippet to reproduce:

#[test]
// any test

Thank you for investigating!

About this issue

  • Original URL
  • State: closed
  • Created 3 months ago
  • Reactions: 13
  • Comments: 16 (10 by maintainers)

Commits related to this issue

Most upvoted comments

A nightly release with the fix is now available, in case anyone wants to test it.

Thanks a lot @lnicola and @roife. I just tested with rust-analyzer version: 0.4.1901-standalone (29a8e65bb 2024-03-28) and can confirm debugging is working again 😃

A nightly release with the fix is now available, in case anyone wants to test it.

This was confusing since there was no setting change and the error message is misleading. Downgrading the VS Code extension allowed debugging again.

  • MacOS 14.4
  • VS Code 1.87.1 (Universal)
  • CodeLLDB v1.10.0.

I can confirm as well that 0.3.1868 and earlier are working. All debugging is broken on and after v0.3.1877

Somewhat related we should probably configure the extensions to use rust-gdb and rust-lldb, but I’m not sure those are in PATH for everyone.

The C++ extension seems unable to debug Rust projects on Mac.

OK, I’ve found the issue with the inability to use C++ extension on Mac: currently, Apple Silicon cannot utilize GDB (due to Apple’s restrictions on Kernel 😢), hence on macOS, we can only use lldb.

Oh 🤦. I didn’t expect anyone to have multiple debugging extensions, but it makes sense with the C++ one.

In #16719, the order of the debugger changed, prioritizing ā€œms-vscode.cpptoolsā€, which resulted in the error. However, debugging with codelldb still works fine even without generating a launch.json file.

Seeing same issue and I can confirm that downgrading to v0.3.1868 solves it.

This issue cannot be reproduced on my machine (M3 Max, macOS 14.3.1). If the problem was introduced by v0.3.1877, could it be related to commit a01e4f8b72ccea318e5fb98c8f0cc2cab2c212b3 (#16719)?