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

mkDerivation: Don't pass buildInputs to stdenv builder in nativeBuildInputs #23374

Merged
merged 1 commit into from Apr 14, 2017

Conversation

dezgeg
Copy link
Contributor

@dezgeg dezgeg commented Mar 2, 2017

One way of solving the biggest problem described in #4855.

This does not rename anything and (at least doesn't intend to) change anything wrt. how the semantics of buildInputs and nativeBuildInputs work inside the builder script. But it does solve the problem of foo.buildInputs (or echo $buildInputs in a nix-shell) giving an unexpected result.

Needs a bit more testing, but in case this doesn't cause major breakage I'd propose this for 17.03. The reason for that being the new overrideAttrs function we merged earlier, which gets rid of another well-known buildInputs vs nativeBuildInputs wart when using overrideDerivation.

cc @edolstra

…Inputs

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 NixOS#4855.
@vcunat vcunat merged commit ce56c99 into NixOS:staging Apr 14, 2017
vcunat added a commit that referenced this pull request Apr 14, 2017
Don't pass buildInputs to stdenv builder in nativeBuildInputs.
Ericson2314 added a commit to obsidiansystems/nixpkgs that referenced this pull request Nov 21, 2017
This continues NixOS#23374, which always kept around both attributes, by
always including both propagated files: `propgated-native-build-inputs`
and `propagated-build-inputs`. `nativePkgs` and `crossPkgs` are still
defined as before, however, so this change should only barely
observable.

This is an incremental step to fully keeping the dependencies separate
in all cases.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants