nix-community / NixOS-WSL

NixOS on WSL(2) [maintainer=@nzbr]
Apache License 2.0
1.8k stars 114 forks source link

Nixos-rebuild switch error: rustc 1.74 or newer, while the currently active rustc version is 1.73.0 #483

Open kkingstoun opened 4 months ago

kkingstoun commented 4 months ago

Bug description

To Reproduce

  1. wsl --import NixOS $env:USERPROFILE\NixOS\ nixos-wsl.tar.gz
  2. sudo nix-channel --update
  3. sudo nixos-rebuild switch

    Logs

    this derivation will be built:
    /nix/store/h3p99bif5wdg0zcwhw62ccj9r0aip36i-nixos-rebuild.drv
    these 139 paths will be fetched (48.05 MiB download, 224.44 MiB unpacked):
    .
    .
    .
    Executing cargoBuildHook
    ++ env CC_X86_64_UNKNOWN_LINUX_GNU=/nix/store/shdkxxdlpv66wl33rh9d01zfypaka1dn-gcc-wrapper-12.3.0/bin/cc CXX_X86_64_UNKNOWN_LINUX_GNU=/nix/store/shdkxxdlpv66wl33rh9d01zfypaka1dn-gcc-wrapper-12.3.0/bin/c++ CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=/nix/store/shdkxxdlpv66wl33rh9d01zfypaka1dn-gcc-wrapper-12.3.0/bin/cc CC_X86_64_UNKNOWN_LINUX_GNU=/nix/store/shdkxxdlpv66wl33rh9d01zfypaka1dn-gcc-wrapper-12.3.0/bin/cc CXX_X86_64_UNKNOWN_LINUX_GNU=/nix/store/shdkxxdlpv66wl33rh9d01zfypaka1dn-gcc-wrapper-12.3.0/bin/c++ CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=/nix/store/shdkxxdlpv66wl33rh9d01zfypaka1dn-gcc-wrapper-12.3.0/bin/cc CARGO_BUILD_TARGET=x86_64-unknown-linux-gnu HOST_CC=/nix/store/shdkxxdlpv66wl33rh9d01zfypaka1dn-gcc-wrapper-12.3.0/bin/cc HOST_CXX=/nix/store/shdkxxdlpv66wl33rh9d01zfypaka1dn-gcc-wrapper-12.3.0/bin/c++ cargo build -j 20 --target x86_64-unknown-linux-gnu --frozen --profile release
    error: package `clap_builder v4.5.2` cannot be built because it requires rustc 1.74 or newer, while the currently active rustc version is 1.73.0
    Either upgrade to rustc 1.74 or newer, or use
    cargo update -p clap_builder@4.5.2 --precise ver
    where `ver` is the latest version of `clap_builder` supporting rustc 1.73.0
    error: builder for '/nix/store/9h20mjg3zrdk62jzr5fh75lkg3kj9vaq-nixos-wsl-utils-1.0.0.drv' failed with exit code 101
    error: 1 dependencies of derivation '/nix/store/jdw6nfkzb0jhbw32g9x13wfishi5n28h-nixos-system-nixos-23.11.7503.a2e1d0414259.drv' failed to build

WSL version

Please paste the output of wsl --version here

WSL: 2.0.14.0

mgrandau commented 4 months ago

Same issue: WSL version: 2.1.5.0 Kernel version: 5.15.146.1-2 WSLg version: 1.0.60 MSRDC version: 1.2.5105 Direct3D version: 1.611.1-81528511 DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp Windows version: 10.0.19045.4412

nzbr commented 4 months ago

Please update to NixOS 24.05, if you haven't done that yet. 23.11 has an older rustc version, which the newer versions of our dependencies are no longer compatible with

trev-dev commented 4 months ago

Please update to NixOS 24.05, if you haven't done that yet. 23.11 has an older rustc version, which the newer versions of our dependencies are no longer compatible with

Is this directed to people with problems in this thread or the project? If I can safely update my main channel, I will.

joegoldin commented 4 months ago

Please update to NixOS 24.05, if you haven't done that yet. 23.11 has an older rustc version, which the newer versions of our dependencies are no longer compatible with

Is this directed to people with problems in this thread or the project? If I can safely update my main channel, I will.

Yep! Try:

sudo nix-channel --add  https://nixos.org/channels/nixos-24.05 nixos
sudo nix-channel --update
sudo nixos-rebuild switch
john-fwss commented 4 months ago

@joegoldin this helped me alot, thanks!

jaskerv commented 3 months ago

Is this something that can be patched into this repo?

nzbr commented 3 months ago

Is this something that can be patched into this repo?

We could revert to an older version of clap, but i'm not sure how much sense that would make

ekawatani commented 3 months ago

@nzbr But, is it better than not being able to use the OS? I don't think so. It should be at least patched somehow so that when I follow the instructions, it works. Currently it does not.

nzbr commented 3 months ago

I have reverted the relevant commits now. Let me know if it works

andreujuanc commented 3 months ago
sudo nix-channel --add  https://nixos.org/channels/nixos-24.05 nixos
sudo nix-channel --update
sudo nixos-rebuild switch

Can we just add this to the docs/instructions?

nzbr commented 3 months ago

@andreujuanc It should no longer be needed, because the problematic dependencies have been reverted. Upgrading is the same procedure as on regular NixOS, so I don't think it makes sense to have that in the WSL specific docs

ryannewcomer commented 3 months ago

I just downloaded the latest release, imported it and ran NixOS. but after sudo nixos-rebuild switch. it just shows the same error message. The maintainer should release a newer version.

ryannewcomer commented 3 months ago

my system is now good to go, but I thinks it should be put somewhere where everyone can see it

ekawatani commented 3 months ago

Works for me now, too. Thanks!

@andreujuanc Saying that it's same procedure is not a good reason to avoid documenting an issue that prevents people from using it. How would I know it's an upgrade problem in the first place? It's easy when you know the problem, but I would have never solved it if I did not find this thread.

nzbr commented 3 months ago

@ekawatani Right, maybe updating to the latest NixOS stable should be part of the troubleshooting instructions