Skip to content

buildEnv: enable structuredAttrs#470402

Open
SFrijters wants to merge 1 commit intoNixOS:stagingfrom
SFrijters:buildenv-structuredattrs
Open

buildEnv: enable structuredAttrs#470402
SFrijters wants to merge 1 commit intoNixOS:stagingfrom
SFrijters:buildenv-structuredattrs

Conversation

@SFrijters
Copy link
Member

@SFrijters SFrijters commented Dec 13, 2025

Basically moved everything that is referenced in builder.pl via $ENV inside env.

Special case: my $extraPathsFilePath = $ENV{"extraPathsFrom"}; is used as open FILE, $extraPathsFilePath or die "cannot open extra paths file $extraPathsFilePath: $!";, so I assume we can just flatten that with toString?

Things done

  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other READMEs.

Add a 👍 reaction to pull requests you find important.

@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin-stdenv This PR causes stdenv to rebuild on Darwin and must target a staging branch. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. labels Dec 13, 2025
@SFrijters SFrijters marked this pull request as ready for review December 13, 2025 12:39
@SFrijters SFrijters requested review from K900, auscyber and philiptaron and removed request for auscyber and philiptaron December 13, 2025 12:39
@nixpkgs-ci nixpkgs-ci bot requested a review from Ch1keen December 13, 2025 12:57
@wolfgangwalther
Copy link
Contributor

Also see #434815.

cc @ShamrockLee

Comment on lines +97 to +108
env = {
inherit
pkgs
extraPrefix
ignoreCollisions
checkCollisionContents
ignoreSingleFileOutputs
manifest
;
pathsToLinkJSON = builtins.toJSON pathsToLink;
extraPathsFrom = toString (lib.optional includeClosures (writeClosure pathsForClosure));
};
Copy link
Contributor

@ShamrockLee ShamrockLee Dec 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From PR #432957's perspective, referencing from finalAttrs.env.ignoreCollisions is much less intuitive compared to finalAttrs.ignoreCollisions.

In addition, the custom override overrider is prone to be overridden by callPackage-provided <pkg>.override when defining a package, and should be replaced by <pkg>.overrideAttrs. Again, overriding env.ignoreCollisions is less intuitive than overriding ignoreCollisions.

Perl has powerful built-in JSON-parsing support, which we are using to parse chosenOutputs (currently stringified as the pkgs attribute). Why not parsing $NIX_ATTRS_JSON_FILE?

COI disclosure: I'm the author of competing PR:

@nixpkgs-ci nixpkgs-ci bot requested a review from musjj February 15, 2026 06:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-darwin-stdenv This PR causes stdenv to rebuild on Darwin and must target a staging branch. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants