-
-
Notifications
You must be signed in to change notification settings - Fork 15k
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
rustPlatform: cargo test is now called with the same environment variables as cargo build #298108
Conversation
@ofborg build lsd ripgrep |
This PR rebuilds a lot of packages which means we must target staging. Please follow the contributing guide to not potentially ping a lot of people. |
@SuperSandro2000 done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with my limited knowledge about the rust ecosystem
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is awesome! It may significantly shorten build time of many rust packages... Can this be revived? It seems there are some merge conflicts now, but that probably won't be too difficult to resolve. Friendly ping @alyssais in case you are interested 😆
…ables as cargo build this means that cargo dependancies will no longer be built twice.
c60cbdd
to
226f05e
Compare
I've just rebased the PR on staging. |
@ofborg build lsd ripgrep |
Bisect says 683f97e
|
Ah that's not good... I think it's due to the additional nix-repl> :p pkgs.rust.envVars.setEnv
env \
"CC_X86_64_UNKNOWN_LINUX_GNU=/nix/store/zznja5f8v3jafffyah1rk46vpfcn38dv-gcc-wrapper-13.3.0/bin/cc" \
"CXX_X86_64_UNKNOWN_LINUX_GNU=/nix/store/zznja5f8v3jafffyah1rk46vpfcn38dv-gcc-wrapper-13.3.0/bin/c++" \
"CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=/nix/store/zznja5f8v3jafffyah1rk46vpfcn38dv-gcc-wrapper-13.3.0/bin/cc" \
"CC_X86_64_UNKNOWN_LINUX_GNU=/nix/store/zznja5f8v3jafffyah1rk46vpfcn38dv-gcc-wrapper-13.3.0/bin/cc" \
"CXX_X86_64_UNKNOWN_LINUX_GNU=/nix/store/zznja5f8v3jafffyah1rk46vpfcn38dv-gcc-wrapper-13.3.0/bin/c++" \
"CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=/nix/store/zznja5f8v3jafffyah1rk46vpfcn38dv-gcc-wrapper-13.3.0/bin/cc" \
"CARGO_BUILD_TARGET=x86_64-unknown-linux-gnu" \
"HOST_CC=/nix/store/zznja5f8v3jafffyah1rk46vpfcn38dv-gcc-wrapper-13.3.0/bin/cc" \
"HOST_CXX=/nix/store/zznja5f8v3jafffyah1rk46vpfcn38dv-gcc-wrapper-13.3.0/bin/c++" \
The failing
Also, just out of curiosity: how do you know about |
No hydra I'm aware of. I occasionally try to build my local |
Ok, so indeed the culprit is |
Can we just filter that one variable out? |
This would probably diminish the benefits of this PR, namely |
We could send upstream a patch to unset that variable in the test. Alternatively we could just skip the test if it's not suitable for our setup. |
alternatively, if it's just rustgm-cbindgen, we could unset that variable in that specific package (in a pre-test hook) this would mean specifically that package would be built twice, but that's a lot better than double building every single package. still probably better to just skip the check phase for it and notify upstream. |
I have sent a patch upstream: and they have already responded kindly. A downstream nixpkgs PR #348031 is also created, as shown below. |
this means that cargo dependancies will no longer be built twice.
fixes #291222
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.