stdenv.mkDerivation: add support for env attrset#76732
Closed
stdenv.mkDerivation: add support for env attrset#76732
Conversation
Please note that this won't fix too much leaf-pkgs, those appear to be pretty broken as those don't have an `out`-output.
Member
|
anything that helps with __structuredAttrs is ok in my book. |
teto
approved these changes
Jan 29, 2021
|
I marked this as stale due to inactivity. → More info |
Member
|
env attrset added in #175649 |
12 tasks
Member
|
Was having lists in env automatically have toString run on them ever considered? |
4 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.
Motivation for this change
For
__structuredAttrs, we want to distinguish regular structured variables from string-coercible variables that will be exported to the environment. The environment variables will be passed tomkDerivationas attributes of theenvattribute set.To lower the review workload of the
__structuredAttrsPR, we have decided to make theenvmechanism available as a vanguard. Until the support for__structuredAttrsis implemented, the content of theenvattrset will be merged into the attrset passed tomkDerivation.The content of the attributes in
envis checked for validity and conflicts with the rest ofmkDerivationattributes. The current mechanism should produce the same derivations as the original, thus require no rebuilds.This change is backwards compatible for now, as Nix does not allow attrsets to be passed to derivation without
__structuredAttrsenabled, and the current mechanism handles the non-attrsets as before. We reserve the right to requireenvto be attrset in the future.Only the first commit is important, the rest is cherry-picked from #72074.
cc @globin @Ericson2314 @Ma27