stdenv/setup.sh: Allow NIX_ATTRS_{JSON,SH}_FILE to be set correctly by Nix#214937
Merged
Artturin merged 1 commit intoNixOS:stagingfrom Feb 6, 2023
Merged
stdenv/setup.sh: Allow NIX_ATTRS_{JSON,SH}_FILE to be set correctly by Nix#214937Artturin merged 1 commit intoNixOS:stagingfrom
NIX_ATTRS_{JSON,SH}_FILE to be set correctly by Nix#214937Artturin merged 1 commit intoNixOS:stagingfrom
Conversation
arcnmx
reviewed
Apr 26, 2023
| # $NIX_ATTRS_JSON_FILE pointed to the wrong location in sandbox | ||
| # https://github.com/NixOS/nix/issues/6736; please keep around until the | ||
| # fix reaches *every patch version* that's >= lib/minver.nix | ||
| if ! [[ -e "$NIX_ATTRS_JSON_FILE" ]]; then |
Member
There was a problem hiding this comment.
I've been seeing the following error, presumably due to this change:
structuredAttrs is enabled
/nix/store/5s1yg5l36wzgy1dj0vv1ibarc4g7vrdr-stdenv-linux/setup: line 44: NIX_ATTRS_JSON_FILE: unbound variable
failed with exit code 1
Should this not be ${NIX_ATTRS_JSON_FILE-} and ditto for NIX_ATTRS_SH_FILE?
12 tasks
sternenseemann
added a commit
to sternenseemann/nixpkgs
that referenced
this pull request
May 29, 2023
Nix does not (as far it is documented) guarantee that NIX_ATTRS_*_FILE is set, the only [documented] guarantee seems to be: > […] made available to the builder via the file .attrs.json in the > builder’s temporary directory. This guarantee is of course affected by NixOS/nix#6736, so it seems to be prudent to fall back to the Nix 2.3 style ATTRS_*_FILE env vars before defaulting to the expected location in case neither is available. See also: - NixOS#214937 (comment) - NixOS@afef6588e250 [documented]: https://nixos.org/manual/nix/stable/language/advanced-attributes.html#adv-attr-structuredAttrs
github-actions bot
pushed a commit
that referenced
this pull request
May 31, 2023
Nix does not (as far it is documented) guarantee that NIX_ATTRS_*_FILE is set, the only [documented] guarantee seems to be: > […] made available to the builder via the file .attrs.json in the > builder’s temporary directory. This guarantee is of course affected by NixOS/nix#6736, so it seems to be prudent to fall back to the Nix 2.3 style ATTRS_*_FILE env vars before defaulting to the expected location in case neither is available. See also: - #214937 (comment) - afef6588e250 [documented]: https://nixos.org/manual/nix/stable/language/advanced-attributes.html#adv-attr-structuredAttrs (cherry picked from commit 1a29857)
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.
Description of changes
Support a future where this environment variable is set correctly.
Tested with
Things done
sandbox = trueset innix.conf? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)nixos/doc/manual/md-to-db.shto update generated release notes