Skip to content
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/setup.sh: deal with Nix < 2.4 structured attrs #234883

Merged
merged 1 commit into from
May 31, 2023

Conversation

sternenseemann
Copy link
Member

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:

Tested tests.stdenv.test-structured-env-attrset with Nix 2.3 to verify.

Description of changes
Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 23.05 Release Notes (or backporting 22.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

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
tvlbot pushed a commit to tvlfyi/tvix that referenced this pull request May 30, 2023
* 3p/buzz: delete package

  This is unused, old, and uses an insecure version of OpenSSL which
  broke eval.

* 3p/overlays: remove nvd patch

  Newer versions of nvd are compatible with Nix 2.3 by default.

* users/grfn/system/home: remove explicit rust-analyser package

  This conflicts with `rustup`, causing eval failures, as the wrapper
  seems to now be included in `rustup` by default.

* users/grfn/system: temporarily disable ISO builds

  They were broken upstream in nixpkgs by a change to stdenv/setup.sh,
  being fixed in NixOS/nixpkgs#234883

Change-Id: I0eea99ec98f4e73e615c012ffae1d0e37122e73b
Reviewed-on: https://cl.tvl.fyi/c/depot/+/8585
Tested-by: BuildkiteCI
Reviewed-by: grfn <[email protected]>
Reviewed-by: sterni <[email protected]>
Autosubmit: tazjin <[email protected]>
tvlbot pushed a commit to tvlfyi/kit that referenced this pull request May 30, 2023
* 3p/buzz: delete package

  This is unused, old, and uses an insecure version of OpenSSL which
  broke eval.

* 3p/overlays: remove nvd patch

  Newer versions of nvd are compatible with Nix 2.3 by default.

* users/grfn/system/home: remove explicit rust-analyser package

  This conflicts with `rustup`, causing eval failures, as the wrapper
  seems to now be included in `rustup` by default.

* users/grfn/system: temporarily disable ISO builds

  They were broken upstream in nixpkgs by a change to stdenv/setup.sh,
  being fixed in NixOS/nixpkgs#234883

Change-Id: I0eea99ec98f4e73e615c012ffae1d0e37122e73b
Reviewed-on: https://cl.tvl.fyi/c/depot/+/8585
Tested-by: BuildkiteCI
Reviewed-by: grfn <[email protected]>
Reviewed-by: sterni <[email protected]>
Autosubmit: tazjin <[email protected]>
@github-actions
Copy link
Contributor

Successfully created backport PR for staging-23.05:

@sternenseemann sternenseemann deleted the nix-structured-attrs branch October 1, 2023 11:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants