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

VS Code: Generate launch configuration does not respect RUSTUP_HOME correctly #18468

Open
TheNathannator opened this issue Nov 3, 2024 · 0 comments
Labels
C-bug Category: bug

Comments

@TheNathannator
Copy link

rust-analyzer version: 0.3.2162-standalone (3b3a87f 2024-10-27) (VS Code extension bundled)

rustc version: 1.82.0 (f6e511eec 2024-10-15)

editor or extension: VS Code, extension v0.3.2162

platform: Windows 10

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

  • CARGO_HOME: E:\.dots\.cargo
  • RUSTUP_HOME: E:\.dots\.rustup

Using the Generate launch configuration command in VS Code fails with the following output:

Image

error: rustup could not choose a version of cargo to run, because one wasn't specified explicitly, and no default is configured.
help: run 'rustup default stable' to download the latest stable release of Rust and set it as your default toolchain.

As best as I can tell, RUSTUP_HOME is being ignored, and it instead uses the default per-user location of C:\Users\<user>\.rustup. Deleting the per-user folder and running the command again will re-generate the folder, with a default settings.toml which contains only the following:

profile = "default"
version = "12"

[overrides]

Copy-pasting the contents of the settings.toml in my RUSTUP_HOME into this one makes it work, but it then installs an independent Cargo into my user folder and re-fetches dependencies to there, which is not ideal, as I moved the directory to a secondary drive due to the limited space on my primary drive.

@TheNathannator TheNathannator added the C-bug Category: bug label Nov 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug
Projects
None yet
Development

No branches or pull requests

1 participant