-
-
Notifications
You must be signed in to change notification settings - Fork 15.1k
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
stdenv: handle env
gracefully
#205944
Merged
Merged
stdenv: handle env
gracefully
#205944
Conversation
This file contains 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
13 tasks
Could you test this in |
Artturin
reviewed
Dec 13, 2022
diff --git a/pkgs/test/stdenv/default.nix b/pkgs/test/stdenv/default.nix
index b27fc25356a..2274a20ff17 100644
--- a/pkgs/test/stdenv/default.nix
+++ b/pkgs/test/stdenv/default.nix
@@ -100,6 +100,25 @@ in
test-env-attrset = testEnvAttrset { name = "test-env-attrset"; stdenv' = bootStdenv; };
+ test-env-equals-derivation = bootStdenv.mkDerivation rec {
+ name = "test-env-equals-derivation";
+ env = bootStdenv.mkDerivation {
+ name = "foo";
+ buildCommand = ''
+ mkdir $out
+ touch $out/bar
+ '';
+ };
+
+ passAsFile = [ "buildCommand" ];
+ buildCommand = ''
+ declare -p env
+ echo ''${env[0]}
+ [[ "''${env[0]}" == "${env.out}" ]]
+ touch $out
+ '';
+ };
+
test-prepend-append-to-var = testPrependAndAppendToVar {
name = "test-prepend-append-to-var";
stdenv' = bootStdenv; |
a12b1c2
to
f65096c
Compare
Confirmed that the test fails on the previous commit. |
Artturin
reviewed
Dec 14, 2022
f65096c
to
f3de115
Compare
Derivations not using `__structuredAttrs` should not attempt to set environment variables from `env`. Derivations using `__structuredAttrs` should fail if `env` is not exportable.
6e1bab3
to
9b1e8d7
Compare
2 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
6.topic: stdenv
Standard environment
10.rebuild-darwin: 501+
10.rebuild-darwin: 5001+
10.rebuild-darwin-stdenv
This PR causes stdenv to rebuild
10.rebuild-linux: 501+
10.rebuild-linux: 5001+
10.rebuild-linux-stdenv
This PR causes stdenv to rebuild
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.
Derivations not using
__structuredAttrs
should not attempt to set environment variables fromenv
.Derivations using
__structuredAttrs
should fail ifenv
is not exportable.See #175649 (comment)