-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
A-cargocargo related issuescargo related issues
Description
I am running vscode in a sandbox which leads to `~/.rustup/toolchains' being read-only from the POV of vscode and RA. This usually works fine, except when I open the Miri workspace; then I get the following error:
rust-analyzer failed to load workspace: Failed to read Cargo metadata for Rust sources: Failed to run `cargo metadata --manifest-path /home/r/.rustup/toolchains/miri/lib/rustlib/rustc-src/rust/compiler/rustc/Cargo.toml`: `cargo metadata` exited with an error: Updating crates.io index
error: failed to write /home/r/.rustup/toolchains/miri/lib/rustlib/rustc-src/rust/compiler/rustc/Cargo.lock
Caused by:
failed to open: /home/r/.rustup/toolchains/miri/lib/rustlib/rustc-src/rust/compiler/rustc/Cargo.lock
Caused by:
Read-only file system (os error 30)
rust-analyzer failed to load workspace: Failed to read Cargo metadata for Rust sources: Failed to run `cargo metadata --manifest-path /home/r/.rustup/toolchains/miri/lib/rustlib/rustc-src/rust/compiler/rustc/Cargo.toml`: `cargo metadata` exited with an error: Updating crates.io index
error: failed to write /home/r/.rustup/toolchains/miri/lib/rustlib/rustc-src/rust/compiler/rustc/Cargo.lock
Caused by:
failed to open: /home/r/.rustup/toolchains/miri/lib/rustlib/rustc-src/rust/compiler/rustc/Cargo.lock
Caused by:
Read-only file system (os error 30)
Indeed /home/r/.rustup/toolchains/miri/lib/rustlib/rustc-src/rust/compiler/rustc/Cargo.lock
is read-only, but I also don't think RA has any business mutating that file (it is managed by rustup after all), so it doesn't seem like making that directory read-write would be the proper fix. Maybe cargo metadata
should be called with --offline
or --frozen
?
This is probably related to my workspace settings:
// Place your settings in this file to overwrite default and user settings.
{
"rust-analyzer.rustfmt.extraArgs": [
"+nightly"
],
"rust-analyzer.checkOnSave.overrideCommand": [
"./miri",
"check",
"--message-format=json",
],
"rust-analyzer.linkedProjects": [
"./Cargo.toml",
"./cargo-miri/Cargo.toml"
],
"rust-analyzer.rustcSource": "discover"
}
Specifically I suspect the rustcSource
part is relevant here.
Metadata
Metadata
Assignees
Labels
A-cargocargo related issuescargo related issues