pkgs/stdenv/make-derivation: move hostSuffix before the version#120762
Merged
Ericson2314 merged 1 commit intoNixOS:masterfrom Apr 26, 2021
Merged
pkgs/stdenv/make-derivation: move hostSuffix before the version#120762Ericson2314 merged 1 commit intoNixOS:masterfrom
Ericson2314 merged 1 commit intoNixOS:masterfrom
Conversation
b321678 to
278c298
Compare
Ericson2314
reviewed
Apr 26, 2021
Ericson2314
approved these changes
Apr 26, 2021
Member
Ericson2314
left a comment
There was a problem hiding this comment.
Overall this is a very good idea. Thanks for doing!
278c298 to
707541a
Compare
Adding the hostSuffix to the end of the derivation's name is problematic since some stuff, including user facing programs like nix-env rely on the behavior of parseDrvName instead of pname and version. builtins.parseDrvName currently thinks that the cross compilation target added via hostSuffix is part of the version. This has the practical consequence for example that nix-env would think a cross compiled derivation would be an updated version of a native derivation of the same package and version — breaking user's profiles. We can easily prevent this by moving the hostSuffix in between pname and version. In case name is passed to mkDerivation this is of course not possible and we are forced to fall back to the old behavior. This change could serve as a replacement for the migitation we introduced with the -static appendix to pname in order to avoid confusion between nix and nixStatic as outlined in the comment added with this commit.
707541a to
b0c26d2
Compare
|
Result of 2 packages marked as broken and skipped:
6 packages failed to build:
13 packages skipped due to time constraints:
59 packages built successfully:
Note that build failures may predate this PR, and could be nondeterministic or hardware dependent. Result of 3 packages marked as broken and skipped:
6 packages failed to build:
18 packages skipped due to time constraints:
61 packages built successfully:
Note that build failures may predate this PR, and could be nondeterministic or hardware dependent. |
11 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adding the hostSuffix to the end of the derivation's name is problematic
since some stuff, including user facing programs like nix-env rely on
the behavior of parseDrvName instead of pname and version.
builtins.parseDrvName currently thinks that the cross compilation target
added via hostSuffix is part of the version. This has the practical
consequence for example that nix-env would think a cross compiled
derivation would be an updated version of a native derivation of the
same package and version — breaking user's profiles.
We can easily prevent this by moving the hostSuffix in between pname and
version. In case name is passed to mkDerivation this is of course not
possible and we are forced to fall back to the old behavior.
This change could serve as a replacement for the migitation we
introduced with the -static appendix to pname in order to avoid
confusion between nix and nixStatic as outlined in the comment added
with this commit.
Motivation for this change
Things done
sandboxinnix.confon non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"./result/bin/)nix path-info -Sbefore and after)