Skip to content
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

Merged
merged 3 commits into from May 15, 2018

Conversation

Ericson2314
Copy link
Member

@Ericson2314 Ericson2314 commented May 15, 2018

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 on crossConfig, we add a strictDeps which is by default just true for hostPlatform != buildPlatform. This means in packages that always need strict deps, we can do strictDeps = true instead of the far more confusing crossConfig = true.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

CC @srhb @TravisWhitaker

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.
@srhb
Copy link
Contributor

srhb commented May 15, 2018

A bit late to the show. I'm obviously happy with this, though I don't find the name strictDeps particularly more enlightening than crossConfig was. What's strict about them? :D

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"
Copy link
Contributor

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.

Copy link
Member Author

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
Copy link
Contributor

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;
Copy link
Contributor

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.

@Ericson2314
Copy link
Member Author

@LnL7 hmm I thought cmake stuff ignored extra -D sorry.

@Ericson2314
Copy link
Member Author

Ericson2314 commented May 15, 2018

Preliminarily fixed both CMake problems and building Darwin stdenv right now.

This was referenced May 15, 2018
@Ericson2314
Copy link
Member Author

@srhb well, saner name doesn't get me out of the obligation of actually documenting this in the manual!

@dtzWill
Copy link
Member

dtzWill commented May 16, 2018

Haha oops sorry re:revert on my random branch O:). Already dropped it on that branch, but the mention lives on! Silly github.

@Ericson2314
Copy link
Member Author

Ericson2314 commented May 16, 2018

@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 :).

@Ericson2314 Ericson2314 added this to After @bgamari's numerous fixes in Cross compilation Jul 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Cross compilation
After @bgamari's numerous fixes
Development

Successfully merging this pull request may close these issues.

None yet

6 participants