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
release-lib: Don't use tryEval for packagePlatforms #105042
Conversation
This use of tryEval causes hydra to fully ignore evaluation failures of packages that occur while trying to evaluate the hydra platforms it should be built on. This includes failures that occur during evaluation of: - The `.type` attribute value - The `.meta.hydraPlatforms` or `.meta.platforms` attribute value - The `.version` attribute, since this can determine whether `.meta.position` is set - For non-derivations, `.recurseForDerivations` or `.recurseForRelease` Here's a minimal `release.nix` file, showcasing how a `.version` failure is ignored: let packages = pkgs: { success = pkgs.stdenv.mkDerivation { name = "success"; }; ignoredFailure = pkgs.stdenv.mkDerivation { pname = "ignored-failure"; version = throw "version error"; }; caughtFailure = pkgs.stdenv.mkDerivation { name = "caught-failure"; src = throw "src error"; }; }; releaseLib = import <nixpkgs/pkgs/top-level/release-lib.nix> { packageSet = args: packages (import <nixpkgs> args); supportedSystems = [ "x86_64-linux" ]; }; in releaseLib.mapTestOn (releaseLib.packagePlatforms releaseLib.pkgs) Evaluating this with `hydra-eval-jobs` before this change yields: $ hydra-eval-jobs release.nix -I nixpkgs=/path/to/nixpkgs warning: `--gc-roots-dir' not specified error: "error: --- ThrownError --- hydra-eval-jobs\nsrc error" { "caughtFailure.x86_64-linux": { "error": "error: --- ThrownError --- hydra-eval-jobs\nsrc error" }, "success.x86_64-linux": { "description": "", "drvPath": "/nix/store/q1sw933xd9bxfx6rcp0kqksbprj1wmwj-success.drv", "homepage": "", "isChannel": false, "license": "", "maintainers": "", "maxSilent": 7200, "nixName": "success", "outputs": { "out": "/nix/store/7awrz6hss4jjxvgbwi4wlyikncmslb7a-success" }, "schedulingPriority": 100, "system": "x86_64-linux", "timeout": 36000 } } Where you can see that there is no job for the `ignoredFailure` derivation. Compare this to after this change: $ hydra-eval-jobs release.nix -I nixpkgs=/path/to/nixpkgs warning: `--gc-roots-dir' not specified error: "error: --- ThrownError --- hydra-eval-jobs\nsrc error" error: "error: --- ThrownError --- hydra-eval-jobs\nversion error" { "caughtFailure.x86_64-linux": { "error": "error: --- ThrownError --- hydra-eval-jobs\nsrc error" }, "ignoredFailure": { "error": "error: --- ThrownError --- hydra-eval-jobs\nversion error" }, "success.x86_64-linux": { "description": "", "drvPath": "/nix/store/q1sw933xd9bxfx6rcp0kqksbprj1wmwj-success.drv", "homepage": "", "isChannel": false, "license": "", "maintainers": "", "maxSilent": 7200, "nixName": "success", "outputs": { "out": "/nix/store/7awrz6hss4jjxvgbwi4wlyikncmslb7a-success" }, "schedulingPriority": 100, "system": "x86_64-linux", "timeout": 36000 } } Notice how `ignoredFailure` is now part of the result.
Finished the
These are mostly errors about removed packages or python package errors about unsupported interpreters. I think this is fine |
As far as I remember, back in 2009 Hydra evaluated a single Nix list of jobs on each platform, and an evaluation error while computing the list meant no jobs scheduled. The situation is of course better now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but I think the hydra stake holders should still have a look
Motivation for this change
This use of
builtins.tryEval
causes hydra to fully ignore evaluation failures ofpackages that occur while trying to evaluate the hydra platforms it should be
built on. This includes failures that occur during evaluation of:
.type
attribute value.meta.hydraPlatforms
or.meta.platforms
attribute value.version
attribute, since this can determine whether.meta.position
is set.recurseForDerivations
or.recurseForRelease
Here's a minimal
release.nix
file, showcasing how a.version
failureis ignored:
Evaluating this with
hydra-eval-jobs
before this change yields:Where you can see that there is no job for the
ignoredFailure
derivation. Compare this to after this change:
Notice how
ignoredFailure
is now part of the result.Originally, this
builtins.tryEval
was introduced by @7c6f434c in 2009: d109e4c, though no reason was given.Ping @edolstra @domenkozar @shlevy
Things done
hydra-eval-jobs
now catches these failures with the above examplehydra-eval-jobs
onpkgs/top-level/release.nix
to see the impact of this change on the full nixpkgs set