NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.09k stars 14.14k forks source link

evcxr fails to start without $HOME/.cargo being present #179867

Closed thomasjm closed 1 year ago

thomasjm commented 2 years ago

Describe the bug

If I run evcxr on my normal system, which happens to have Rust installed with files under $HOME/.cargo, it works:

> /nix/store/7l9105...-evcxr-0.12.0/bin/evcxr
Welcome to evcxr. For help, type :help
>> 

But if I switch an empty $HOME environment, it fails to start up:

> export HOME=$(mktemp -d)
> /nix/store/7l9105...-evcxr-0.12.0/bin/evcxr
Welcome to evcxr. For help, type :help
>>
Initialization failed: Failed to read Cargo metadata from Cargo.toml file /tmp/.tmpIWo0yW/Cargo.toml, cargo 1.60.0

This error comes from rust-analyzer, which evcxr uses. I think perhaps some more things need to be added to the PATH for evcxr here? This error seems to be associated in google searches with RUST_SRC_PATH issues, but the derivation sets it already so I'm not sure about that.

Notify maintainers

@protoben @Ma27

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

 - system: `"x86_64-linux"`
 - host os: `Linux 5.13.0-52-generic, Ubuntu, 21.10 (Impish Indri), nobuild`
 - multi-user?: `no`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.8.0pre20220610_45ebaab`
 - channels(tom): `"nixpkgs-22.05pre335126.391f93a83c3"`
 - nixpkgs: `/home/tom/tools/nixpkgs`
thomasjm commented 1 year ago

This works on the latest version, closing...