-
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
In some conditions, r-a calls cargo metadata in such a way that it attempts to update rust-src's lockfile for core #13393
Comments
This is two separate issues on rust's end.
|
Ugh. That's pretty ugly. I wonder if rust-analyzer could somehow special case core since presumably the cargo metadata is known? |
I believe that this is upstream issue rust-lang/rust#95736 |
This somewhat related to #7637 I guess, where we'd like to have |
rust-lang/cargo#10096 is also related. |
I'll close this, I am pretty sure the cause for OP's problem was their editor telling r-a that the sysroot was a loaded lsp workspace causing us to attempt to run cargo metadata on it |
For some reason, I started having rust-analyzer calling Cargo in such a way that Cargo is attempting to recreate the lock file of
core
, which is very much not something that should happen. I actually think rust-analyzer should probably pass--frozen
for such an invocation, since it does not currently, and such a command could actually succeed in messing up the global rust sources if they weren't on a read-only filesystem such as/nix/store
.This means that I get load errors. It seems to be that the lockfile is attempted to be updated because of some
rand
dependency of core?You can get the broken project version from here. I am using Nix for everything including r-a on this project, since it's a rust/C++ plugin. https://github.com/lf-/nix-otel/tree/41fba6dccbca74fdee3a1c6a8e88c9b49b4c50d4
r-a provided by Nix is invoked from within the
nix develop
shell using a shim that callsdirenv exec
.To reproduce the broken Cargo command, run this from any computer with Nix:
rust-analyzer version: 2022-10-03
rustc version: 1.63.0, from nix
relevant settings: (eg. client settings, or environment variables like
CARGO
,RUSTUP_HOME
orCARGO_HOME
)RA_LOG for the log below:
Extensive rust-analyzer log:
https://gist.github.com/lf-/32dd8e796e2b9d6fe91ba0c9a7879398
The text was updated successfully, but these errors were encountered: