diff options
author | Tuomas Tynkkynen <tuomas@tuxera.com> | 2017-03-01 16:09:18 +0200 |
---|---|---|
committer | Tuomas Tynkkynen <tuomas@tuxera.com> | 2017-03-02 03:26:48 +0200 |
commit | ce56c99edcbc1b61ec2fc2ccfc7bfc035cbcb99f (patch) | |
tree | 644507c1b8726951f1d8beff119012c9d347045f /pkgs/stdenv/generic/default.nix | |
parent | 64d4bfd1397b48236199a660c49ad60f13188365 (diff) |
mkDerivation: Don't pass buildInputs to stdenv builder in nativeBuildInputs
When not cross compiling, nativeBuildInputs and buildInputs have identical behaviour. Currently that is implemented by having mkDerivation do a concatenation of those variables in Nix code and pass that to the builder via the nativeBuildInputs attribute. However, that has some annoying side effects, like `foo.buildInputs` evaluating to `[ ]` even if buildInputs were specified in the nix expression for foo. Instead, pass buildInputs and nativeBuildInputs in separate variables as usual, and move the logic of cross compilation vs. native compilation to the stdenv builder script. This is probably a tiny bit uglier but fixes the previous problem. Issue #4855.
Diffstat (limited to 'pkgs/stdenv/generic/default.nix')
-rw-r--r-- | pkgs/stdenv/generic/default.nix | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/pkgs/stdenv/generic/default.nix b/pkgs/stdenv/generic/default.nix index cb94db48f4bdc..69bcd6490594a 100644 --- a/pkgs/stdenv/generic/default.nix +++ b/pkgs/stdenv/generic/default.nix @@ -264,18 +264,16 @@ let __ignoreNulls = true; # Inputs built by the cross compiler. - buildInputs = if crossConfig != null then buildInputs' else []; - propagatedBuildInputs = if crossConfig != null then propagatedBuildInputs' else []; + buildInputs = buildInputs'; + propagatedBuildInputs = propagatedBuildInputs'; # Inputs built by the usual native compiler. nativeBuildInputs = nativeBuildInputs' - ++ lib.optionals (crossConfig == null) buildInputs' ++ lib.optional (result.isCygwin || (crossConfig != null && lib.hasSuffix "mingw32" crossConfig)) ../../build-support/setup-hooks/win-dll-link.sh ; - propagatedNativeBuildInputs = propagatedNativeBuildInputs' ++ - (if crossConfig == null then propagatedBuildInputs' else []); + propagatedNativeBuildInputs = propagatedNativeBuildInputs'; } // ifDarwin { # TODO: remove lib.unique once nix has a list canonicalization primitive __sandboxProfile = |