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
treewide: Remove crossConfig and add strictDeps #40529
Conversation
The hack of using `crossConfig` to enforce stricter handling of dependencies is replaced with a dedicated `strictDeps` for that purpose. (Experience has shown that my punning was a terrible idea that made more difficult and embarrising to teach teach.) Now that is is clear, a few packages now use `strictDeps`, to fix various bugs: - bintools-wrapper and cc-wrapper
All its uses have been removed.
A bit late to the show. I'm obviously happy with this, though I don't find the name |
cmakeFlags="-DCMAKE_CXX_COMPILER=$CXX $cmakeFlags" | ||
cmakeFlags="-DCMAKE_C_COMPILER=$CC $cmakeFlags" | ||
cmakeFlags="-DCMAKE_AR=$(command -v $AR) $cmakeFlags" | ||
cmakeFlags="-DCMAKE_RANLIB=$(command -v $RANLAB) $cmakeFlags" |
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.
Typo.
Also these are now being set in native builds which doesn't seem very desirable.
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.
Thanks you for the catch.
@@ -57,7 +57,8 @@ rec { | |||
# InstallCheck phase | |||
, doInstallCheck ? config.doCheckByDefault or false | |||
|
|||
, crossConfig ? null | |||
, # TODO(@Ericson2314): Make always true and remove |
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.
There is no business having these sorts of TODO comments until it's accepted (via an RFC) that it will be done.
@@ -177,6 +178,8 @@ rec { | |||
userHook = config.stdenv.userHook or null; | |||
__ignoreNulls = true; | |||
|
|||
inherit strictDeps; |
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 bloats every derivation with a yet another extra field and makes mkDerivation
slower. This is explicitly discouraged.
@LnL7 hmm I thought cmake stuff ignored extra |
Preliminarily fixed both CMake problems and building Darwin stdenv right now. |
@srhb well, saner name doesn't get me out of the obligation of actually documenting this in the manual! |
Haha oops sorry re:revert on my random branch O:). Already dropped it on that branch, but the mention lives on! Silly github. |
@dtzWill Ah no worries. I see that it was your own branch from the get go. And, FWIW since I did break staging, anyone would have full right to revert this PR on it too per the official policy, IIRC. So I couldn't complain in that case either :). |
Motivation for this change
Fix #40531
One exception to the
crossConfig
usage being old I did in 469fd89, using it control how flexible/rigid our handling of dependencies is. Instead of punning oncrossConfig
, we add astrictDeps
which is by default just true forhostPlatform != buildPlatform
. This means in packages that always need strict deps, we can dostrictDeps = true
instead of the far more confusingcrossConfig = true
.Things done
build-use-sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)CC @srhb @TravisWhitaker