-
-
Notifications
You must be signed in to change notification settings - Fork 18.2k
stdenv: support opt-in __structuredAttrs #175649
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
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
238a605
stdenv: support opt-in __structuredAttrs
Artturin 1c4820e
work around a nix bug
Artturin 8ad0103
config.structuredAttrsByDefault: add option
Artturin 734d7df
allow derivation attributes in env
Artturin adc8900
treewide: fix some core package structuredAttrs
Artturin 18d00c5
tests.stdenv: add some env attrset tests
Artturin bb914d8
stdenv: export system pname name version for substituteAll
Artturin c01f509
treewide: source .attrs in builders
Artturin 02e3f51
darwin: use // for binutils-unwrapped and cctools to preserve the other
Artturin c41cc9e
treewide: move some perl vars to env attrset
Artturin c577eb6
wrapNonDeterministicGcc: fix
Artturin 89dc806
what to do about attrs.env or {} maybe have a empty env attrset always
Artturin fda61e9
add docs for prependToVar and appendToVar
Artturin 68fb254
tests.stdenv: deduplicate
Artturin bf972f1
tests.stdenv: add tests for prependToVar and appendToVar
Artturin 11c3127
stdenv: detect the type of variable in {prepend,append}ToVar
Artturin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| if [ -e .attrs.sh ]; then source .attrs.sh; fi | ||
| source $stdenv/setup | ||
|
|
||
| doSub() { | ||
|
|
||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,6 @@ | ||
| set -e | ||
|
|
||
| if [ -e .attrs.sh ]; then source .attrs.sh; fi | ||
| source $stdenv/setup | ||
|
|
||
| mkdir -p $out/bin | ||
|
|
||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| if [ -e .attrs.sh ]; then source .attrs.sh; fi | ||
| source $stdenv/setup | ||
|
|
||
| echo "unpacking $src..." | ||
|
|
||
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| if [ -e .attrs.sh ]; then source .attrs.sh; fi | ||
| source $stdenv/setup | ||
|
|
||
| tar --extract --file=$src libreoffice-$version/download.lst -O > $out |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -55,9 +55,9 @@ let | |
| bintoolsVersion = lib.getVersion bintools; | ||
| bintoolsName = lib.removePrefix targetPrefix (lib.getName bintools); | ||
|
|
||
| libc_bin = if libc == null then null else getBin libc; | ||
| libc_dev = if libc == null then null else getDev libc; | ||
| libc_lib = if libc == null then null else getLib libc; | ||
| libc_bin = if libc == null then "" else getBin libc; | ||
| libc_dev = if libc == null then "" else getDev libc; | ||
| libc_lib = if libc == null then "" else getLib libc; | ||
| bintools_bin = if nativeTools then "" else getBin bintools; | ||
| # The wrapper scripts use 'cat' and 'grep', so we may need coreutils. | ||
| coreutils_bin = if nativeTools then "" else getBin coreutils; | ||
|
|
@@ -68,7 +68,7 @@ let | |
| # The dynamic linker has different names on different platforms. This is a | ||
| # shell glob that ought to match it. | ||
| dynamicLinker = | ||
| /**/ if sharedLibraryLoader == null then null | ||
| /**/ if sharedLibraryLoader == null then "" | ||
| else if targetPlatform.libc == "musl" then "${sharedLibraryLoader}/lib/ld-musl-*" | ||
| else if targetPlatform.libc == "uclibc" then "${sharedLibraryLoader}/lib/ld*-uClibc.so.1" | ||
| else if (targetPlatform.libc == "bionic" && targetPlatform.is32bit) then "/system/bin/linker" | ||
|
|
@@ -87,7 +87,7 @@ let | |
| else if targetPlatform.isDarwin then "/usr/lib/dyld" | ||
| else if targetPlatform.isFreeBSD then "/libexec/ld-elf.so.1" | ||
| else if lib.hasSuffix "pc-gnu" targetPlatform.config then "ld.so.1" | ||
| else null; | ||
| else ""; | ||
|
||
|
|
||
| expand-response-params = | ||
| if buildPackages ? stdenv && buildPackages.stdenv.hasCC && buildPackages.stdenv.cc != "/dev/null" | ||
|
|
@@ -103,15 +103,10 @@ stdenv.mkDerivation { | |
|
|
||
| preferLocalBuild = true; | ||
|
|
||
| inherit bintools_bin libc_bin libc_dev libc_lib coreutils_bin; | ||
| shell = getBin shell + shell.shellPath or ""; | ||
| gnugrep_bin = if nativeTools then "" else gnugrep; | ||
|
|
||
| inherit targetPrefix suffixSalt; | ||
|
|
||
| outputs = [ "out" ] ++ optionals propagateDoc ([ "man" ] ++ optional (bintools ? info) "info"); | ||
|
|
||
| passthru = { | ||
| inherit targetPrefix suffixSalt; | ||
| inherit bintools libc nativeTools nativeLibc nativePrefix; | ||
|
|
||
| emacsBufferSetup = pkgs: '' | ||
|
|
@@ -193,8 +188,6 @@ stdenv.mkDerivation { | |
| strictDeps = true; | ||
| depsTargetTargetPropagated = extraPackages; | ||
|
|
||
| wrapperName = "BINTOOLS_WRAPPER"; | ||
|
|
||
| setupHooks = [ | ||
| ../setup-hooks/role.bash | ||
| ./setup-hook.sh | ||
|
|
@@ -366,10 +359,15 @@ stdenv.mkDerivation { | |
| ## | ||
| + extraBuildCommands; | ||
|
|
||
| inherit dynamicLinker; | ||
|
|
||
| # for substitution in utils.bash | ||
| expandResponseParams = "${expand-response-params}/bin/expand-response-params"; | ||
| env = { | ||
| # for substitution in utils.bash | ||
| expandResponseParams = "${expand-response-params}/bin/expand-response-params"; | ||
| shell = getBin shell + shell.shellPath or ""; | ||
| gnugrep_bin = if nativeTools then "" else gnugrep; | ||
| wrapperName = "BINTOOLS_WRAPPER"; | ||
| inherit dynamicLinker targetPrefix suffixSalt coreutils_bin; | ||
| inherit bintools_bin libc_bin libc_dev libc_lib; | ||
| }; | ||
|
|
||
| meta = | ||
| let bintools_ = if bintools != null then bintools else {}; in | ||
|
|
||
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| if [ -e .attrs.sh ]; then source .attrs.sh; fi | ||
| source $stdenv/setup | ||
|
|
||
| (echo "#!$SHELL"; \ | ||
|
|
||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| if [ -e .attrs.sh ]; then source .attrs.sh; fi | ||
| source $stdenv/setup | ||
|
|
||
| tagtext="" | ||
|
|
||
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| if [ -e .attrs.sh ]; then source .attrs.sh; fi | ||
| source $stdenv/setup | ||
|
|
||
| set -x | ||
|
|
||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| if [ -e .attrs.sh ]; then source .attrs.sh; fi | ||
| source $stdenv/setup | ||
|
|
||
| header "exporting $url (r$rev) into $out" | ||
|
|
||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| if [ -e .attrs.sh ]; then source .attrs.sh; fi | ||
| source $stdenv/setup | ||
|
|
||
| header "exporting $url (r$rev) into $out" | ||
|
|
||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| if [ -e .attrs.sh ]; then source .attrs.sh; fi | ||
| source $stdenv/setup | ||
|
|
||
| source $mirrorsFile | ||
|
|
||
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
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
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
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
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
Oops, something went wrong.
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.
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.
Why don't we source this at the beginning of stdenv setup?
Uh oh!
There was an error while loading. Please reload this page.
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.
$stdenv variable will not be set for the source below
The better way to fix these would be to do 983382d / use buildCommand but I wanted to keep the diffs small
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.
$stdenv isn't exported?
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.
with structuredAttrs all things are passed with .attrs.sh/.attrs.json and nothing is in env ( i have not confirmed this yet)