-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
rust-analyzer fails to load miri workspace when toolchain is on read-only file system #10792
Comments
Indeed commenting out that |
I think |
Indeed. And it is part of the rustc distribution, so RA should not modify it.
That sounds like a I should also note that this is a new problem, everything used to work fine a few months ago -- though I cannot exclude the possibility that some system update changed the behavior of the sandbox. |
Actually, no, it is not. That one lives at
|
I see.
All cargo commands that resolve packages update |
I see -- but that doesn't mean that is a good idea. I understand RA cannot do much about that -- so moving to cargo: rust-lang/cargo#10096. |
As per this comment, cargo now has a feature that can be used to solve this problem: |
I fail to see how that flag is useful to us, if I see that right if we were to use that we would not necessarily be getting the exact versions of dependencies that the project is using which seems suboptimal. Or am I misunderstanding things here? |
You can copy the Cargo.lock from the sysroot into a location that's writeable, and then set |
I see, that sounds like an odd way to solve this. Remind me (if you can), how can passing |
AFAIK However, @bjorn3 recently changed that, so it's also possible that |
Ah I see, too many entries in the lock file can make it fail with |
Ah if you're setting |
Hm, I am still getting errors in Miri though when the sysroot is read-only.
I think this is about the rustc sources, not the sysroot sources? |
Ah indeed, the rustc sources just don't have a lockfile at all. So when RA invokes Or more precisely, there is a lockfile in |
Oh no, have we been creating a lockfile in the rustc crate in the rustc sources this entire time? 😨 |
Yes, yes you have. ;) |
Simply adding |
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:
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. Maybecargo metadata
should be called with--offline
or--frozen
?This is probably related to my workspace settings:
Specifically I suspect the
rustcSource
part is relevant here.The text was updated successfully, but these errors were encountered: