-
-
Notifications
You must be signed in to change notification settings - Fork 15.3k
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
Fix breaking changes to make-derivation #51183
Fix breaking changes to make-derivation #51183
Conversation
version is set in lots of places but might not need to be in a name. Alternative to NixOS#50364.
When separateDebugInfo = true & !stdenv.hostPlatform.isLinux, we always gave an error. There is no reason to do this. Instead, just don’t add separate debug info when we aren’t on Linux.
This reverts commit 1e99582.
Some trivial builders use the name attr to choose the exec name produced. For example nixos-install, nixos-install = makeProg { name = "nixos-install"; src = ./nixos-install.sh; nix = config.nix.package.out; path = makeBinPath [ nixos-enter ]; }; When cross compiling, this puts the prog in, /bin/nixos-install-powerpc64le-unknown-linux-gnu
|
||
fixedOutputDrv = attrs ? outputHash; | ||
noNonNativeDeps = builtins.length (depsBuildTarget ++ depsBuildTargetPropagated | ||
++ depsHostHost ++ depsHostHostPropagated | ||
++ buildInputs ++ propagatedBuildInputs | ||
++ depsTargetTarget ++ depsTargetTargetPropagated) == 0; | ||
runtimeSensativeIfFixedOutput = fixedOutputDrv -> !noNonNativeDeps; | ||
dontAddHostSuffix = attrs ? outputHash && !noNonNativeDeps || stdenv.cc == null; |
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.
@Ericson2314 Does this preserve the original condition? I'm confused as to whether you want the suffix when you have non-native deps or not?
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.
Yeah sorry my original booleans are a bit obtuse because I also wanted to use this to make a warning saying fixed-output derivations shouldn't have run-time deps.
In the case that they do, the suffix should appear because the run-time deps make the derivation host-sensative.
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.
sensative
-> "sensitive" !!
Typo is no big deal, but thought I'd say something since it's the spelling also used for the variable name 😿 .
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.
Notice that too! I also like dontAddHostSuffix because it's a little bit clearer on what is actually happening.
@GrahamcOfBorg build stdenv hello pkgsCross.aarch64-multiplatform.hello |
Success on aarch64-linux (full log) Attempted: stdenv, hello, pkgsCross.aarch64-multiplatform.hello Partial log (click to expand)
|
Timed out, unknown build status on x86_64-linux (full log) Attempted: stdenv, hello, pkgsCross.aarch64-multiplatform.hello Partial log (click to expand)
|
Timed out, unknown build status on x86_64-darwin (full log) Attempted: stdenv, hello, pkgsCross.aarch64-multiplatform.hello Partial log (click to expand)
|
cc @Synthetica9 @dtzWill (and @Ericson2314 has already been pinged) whose changes have been reverted here, if I read correctly the blame. Meta-point (I'm not familiar with the changes this PR makes, so this is not an opinion on these specific changes): I personally totally disagree with
My reasons are simple:
Anyway, all that to say that a decision of “make-derivation should be stable even between releases” vs. “make-derivation can be backwards-compatibility-broken between releases” should be done via a RFC, once the RFC-process-update RFC will be done, so that all arguments in favor and against are exposed and the decision can be considered as chosen by the community as a whole. |
Yes I had no problem with the specific changes here, but also disagree with that justification as @Ekleog says. |
Commit a56fe05 is causing (bisected by @cleverca22, after wanting to demonstrate cross comp in #nixos):
|
Yes tracking that in #53587. |
Motivation for this change
A few breaking changes have been introduced to make-derivation recently. IMO make-derivation shouldn't ever change in what it accepts from release to release. There's too many places where this is used both internally and externally.
So this restores a few things:
substituteAll
wherename
is often used for things like binary names. Try cross compiling nixos-install for example.substituteAll
and theversion
attr. No reason to assert here.