martinvonz / jj

A Git-compatible VCS that is both simple and powerful
https://martinvonz.github.io/jj/
Apache License 2.0
8.39k stars 288 forks source link

nix: jj build failure #299

Closed develop7 closed 2 years ago

develop7 commented 2 years ago

Description

Steps to Reproduce the Problem

  1. nix profile install 'github:martinvonz/jj'

Expected Behavior

It is installed successfully

Actual Behavior

$ nix -v profile install 'github:martinvonz/jj'
building '/nix/store/vkiyx6lphkmn3bg35dhnxlz27c53aig7-jujutsu-unstable-ffc5731.drv'...
error: builder for '/nix/store/vkiyx6lphkmn3bg35dhnxlz27c53aig7-jujutsu-unstable-ffc5731.drv' failed with exit code 101;
       last 10 log lines:
       > Finished cargoSetupPostUnpackHook
       > patching sources
       > Executing cargoSetupPostPatchHook
       > Validating consistency between /build/source//Cargo.lock and /build/cargo-vendor-dir/Cargo.lock
       > Finished cargoSetupPostPatchHook
       > configuring
       > building
       > Executing cargoBuildHook
       > ++ env CC_x86_64-unknown-linux-gnu=/nix/store/pja9g36cy32z3d51942jqk91a6l2d5nv-gcc-wrapper-10.3.0/bin/cc CXX_x86_64-unknown-linux-gnu=/nix/store/pja9g36cy32z3d51942jqk91a6l2d5nv-gcc-wrapper-10.3.0/bin/c++ CC_x86_64-unknown-linux-gnu=/nix/store/pja9g36cy32z3d51942jqk91a6l2d5nv-gcc-wrapper-10.3.0/bin/cc CXX_x86_64-unknown-linux-gnu=/nix/store/pja9g36cy32z3d51942jqk91a6l2d5nv-gcc-wrapper-10.3.0/bin/c++ cargo build -j 24 --target x86_64-unknown-linux-gnu --frozen --release --no-default-features
       > error: package `jujutsu v0.4.0 (/build/source)` cannot be built because it requires rustc 1.60 or newer, while the currently active rustc version is 1.58.1
       For full logs, run 'nix log /nix/store/vkiyx6lphkmn3bg35dhnxlz27c53aig7-jujutsu-unstable-ffc5731.drv'.

Specifications

martinvonz commented 2 years ago

I think that broke because #290 changed the minimum supported Rust version from 1.58 to 1.60. I don't know how Nix works, but is it possible to upgrade your Rust toolchain to 1.60 or does the message above inherently mean that there's a bug in jj's Nix package definition?

develop7 commented 2 years ago

My guess would be to run nix flake update and commit the updated flake.lock file. The nixpkgs got rustc 1.60 already so that should do it.

martinvonz commented 2 years ago

Ah, thanks! I looked at that file but didn't see any mention of Rust, so I figured the Rust version was set somewhere else. Turns out it was the whole nixpkgs version that needed to be bumped (which makes sense now that I think about, even with the little I know about Nix). I've sent a fix in #300. I'll also update our CI to use the lock file (it currently overrides nixpkgs for some reason).

martinvonz commented 2 years ago

Oh, if you want a workaround until that gets merged, I suppose you can pass --override-input nixpkgs github:NixOS/nixpkgs like our CI did.