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

Tracking issue: remove and mitigate __attrsFailEvaluation #324619

Open
5 of 36 tasks
philiptaron opened this issue Jul 4, 2024 · 0 comments
Open
5 of 36 tasks

Tracking issue: remove and mitigate __attrsFailEvaluation #324619

philiptaron opened this issue Jul 4, 2024 · 0 comments
Labels
5. scope: tracking Long-lived issue tracking long-term fixes or multiple sub-problems 6.topic: architecture Relating to code and API architecture of Nixpkgs

Comments

@philiptaron
Copy link
Contributor

philiptaron commented Jul 4, 2024

This is all related to the following PR:

__attrsFailEvaluation

From pkgs/top-level/release-attrpaths-superset.nix, written by @amjoseph-nixpkgs (now deleted).

__attrsFailEvaluation is a temporary workaround to get top-level eval to succeed (under builtins.tryEval) for the entire packageset, without deep invasive changes into individual packages.

Now that CI has been added, ensuring that top-level eval will not be broken by any new commits, you should not add any new occurrences of __attrsFailEvaluation, and should remove them wherever you are able to (doing so will likely require deep adjustments within packages). Once all of the uses of __attrsFailEvaluation are removed, it will be deleted from the routine below.

In the meantime, the intended semantics are that an attrpath rooted at pkgs is part of the (unfiltered) release jobset if and only if all of the following are true:

  1. The first component of the attrpath is not in excluded-toplevel-attrs.
  2. No attrname in the attrpath belongs to the list of forbidden attrnames excluded-attrnames-at-any-depth.
  3. The attrpath leads to a value for which lib.isDerivation is true.
  4. No proper prefix of the attrpath has __attrsFailEvaluation = true;.
  5. Any proper prefix of the attrpath at which lib.isDerivation is true also has __recurseIntoDerivationForReleaseJobs = true;.

The last condition is unfortunately necessary because there are Hydra release job names which have proper prefixes which are attrnames of derivations (!). We should probably restructure the job tree so that this is not the case.

More to come, maybe.

excluded-toplevel-attrs

From pkgs/top-level/release-attrpaths-superset.nix, written by @amjoseph-nixpkgs (now deleted).

No release package attrpath may have any of these attrnames as its initial component.

If you can find a way to remove any of these entries without causing CI to fail, please do so.

  • __splicedPackages
  • pkgsBuildBuild
  • pkgsBuildHost
  • pkgsBuildTarget
  • pkgsHostHost
  • pkgsHostTarget
  • pkgsTargetTarget
  • buildPackages
  • targetPackages
  • pkgsLLVM
  • pkgsMusl
  • pkgsStatic
  • pkgsCross
  • pkgsx86_64Darwin
  • pkgsi686Linux
  • pkgsLinux
  • pkgsExtraHardening

excluded-attrnames-at-any-depth

From pkgs/top-level/release-attrpaths-superset.nix, written by @amjoseph-nixpkgs (now deleted).

No release package attrname may have any of these at a component anywhere in its attrpath. These are the names of gigantic top-level attrsets that have leaked into so many sub-packagesets that it's easier to simply exclude them entirely.

If you can find a way to remove any of these entries without causing CI to fail, please do so.

Special case: lib/types.nix leaks into a lot of NixOS-related derivations, and does not eval deeply.

  • type

__recurseIntoDerivationForReleaseJobs

php = recurseIntoAttrs (callPackages ./php {});
pkg-config = recurseIntoAttrs (callPackage ../top-level/pkg-config/tests.nix { }) // { __recurseIntoDerivationForReleaseJobs = true; };
buildRustCrate = callPackage ../build-support/rust/build-rust-crate/test { };

https://github.com/NixOS/nixpkgs/blob/a1ecdd6b1ad1dcf345ca0a83e9a96b391e951544/pkgs/top-level/all-packages.nix#L15766

https://github.com/NixOS/nixpkgs/blob/a1ecdd6b1ad1dcf345ca0a83e9a96b391e951544/pkgs/top-level/all-packages.nix#L23787

https://github.com/NixOS/nixpkgs/blob/a1ecdd6b1ad1dcf345ca0a83e9a96b391e951544/pkgs/top-level/all-packages.nix#L30260

in cp // { coqPackages = cp.coqPackages // { __attrsFailEvaluation = true; }; } // { __recurseIntoDerivationForReleaseJobs = true; };

__recurseIntoDerivationForReleaseJobs = true;

defaultPkgConfigPackages = allPkgs.callPackage ./test-defaultPkgConfigPackages.nix { } // { __recurseIntoDerivationForReleaseJobs = true; };

else if value.recurseForDerivations or false || value.recurseForRelease or false || value.__recurseIntoDerivationForReleaseJobs or false then

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5. scope: tracking Long-lived issue tracking long-term fixes or multiple sub-problems 6.topic: architecture Relating to code and API architecture of Nixpkgs
Projects
None yet
Development

No branches or pull requests

1 participant