rustlings
rustlings copied to clipboard
Nixos error: couldn't read `src/main.rs`: No such file or directory (os error 2)
After running nix-shell in terminal (inside rustlings folder) I get this error, although src/main.rs is already present.
error: couldn't read src/main.rs: No such file or directory (os error 2)
error: could not compile `rustlings` due to previous error
error: builder for '/nix/store/sqp4mmfz9xk7mp25h86d6h4r80dsnm4a-rustlings.drv' failed with exit code 101;
last 10 log lines:
> Compiling mio-extras v2.0.6
> Compiling notify v4.0.17
> Compiling indicatif v0.16.2
> Compiling argh_derive v0.1.10
> Compiling argh v0.1.10
> Compiling toml v0.5.11
> Compiling rustlings v5.5.1 (/build/source)
> error: couldn't read src/main.rs: No such file or directory (os error 2)
>
> error: could not compile `rustlings` due to previous error
For full logs, run 'nix log /nix/store/sqp4mmfz9xk7mp25h86d6h4r80dsnm4a-rustlings.drv'.
Here are my nixos configurations for reference: https://github.com/aritroCoder/nixos-configs
@aritroCoder - Hi, did you solve this? I am getting the same error.
Never mind. Used my own nix shell and ran cargo install --force --path . Seems to work ok now.
I haven't using Nix OS, but recommend you try online run by GitHub Code Space, my Rustlings too at Code Space.
if you're not using flakes you can
nix develop --extra-experimental-features nix-command --extra-experimental-features flakes instead of nix-shell
Worked for me like a charm. I'm on nix 2.13.6 and NixOS 23.05
Closing because others offered some answers