2012-12-22 01:17:22 +01:00
|
|
|
/*
|
2013-07-27 12:06:45 +02:00
|
|
|
test for example like this
|
2015-11-18 18:31:01 +01:00
|
|
|
$ hydra-eval-jobs pkgs/top-level/release-python.nix
|
2012-12-22 01:17:22 +01:00
|
|
|
*/
|
2013-07-27 12:06:45 +02:00
|
|
|
|
2018-07-21 00:44:44 +00:00
|
|
|
{
|
|
|
|
# The platforms for which we build Nixpkgs.
|
2021-09-06 04:18:50 +02:00
|
|
|
supportedSystems ? [
|
|
|
|
"aarch64-linux"
|
|
|
|
"x86_64-linux"
|
|
|
|
],
|
2020-09-11 18:20:35 +02:00
|
|
|
# Attributes passed to nixpkgs. Don't build packages marked as unfree.
|
2023-12-12 04:08:43 +01:00
|
|
|
nixpkgsArgs ? {
|
|
|
|
config = {
|
|
|
|
allowUnfree = false;
|
|
|
|
inHydra = true;
|
|
|
|
};
|
release: forbid use of `lib.fileset` in Nixpkgs
Due to Nix bug <https://github.com/NixOS/nix/issues/11503>,
`builtins.filterSource` and chroot stores interact in a confusing
and broken way that breaks `lib.fileset`. This means that uses of
the API inside Nixpkgs keep breaking the NixOS installer, blocking
the channel. The resulting error messages are inscrutable (they look
like “the installer test is trying to download `curl`…?” and
eventually bottom out in a derivation that has the wrong `outPath`
because of the chroot store causing an incorrect `lib.fileset` result).
Whenever this happens, someone (well, in practice K900 or I)
has to bisect the change that introduced it and remove the use of
`lib.fileset`. This has happened at least three times in the past
four months (I believe I might actually be missing one here, but
these are the ones I remember and could easily dig up):
* <https://github.com/NixOS/nixpkgs/pull/340046>
* <https://github.com/NixOS/nixpkgs/pull/352491>
* <https://github.com/NixOS/nixpkgs/pull/369459>
The options I see here are:
1. Forbid use of `lib.fileset` within Nixpkgs until the Nix bug is
fixed. This is the approach taken here. External users of Nixpkgs
can continue to use the API as normal, but using it from within
something that affects any release jobset `outPath`s will cause an
evaluation failure with a hopefully‐helpful error message.
2. Forbid `lib.fileset` and also all of the other library APIs that use
`builtins.filterSource`. I’m happy to do this, but so far none of
those have broken the installer, so I decided to start small and
worry about the others if they end up causing a problem in practice.
3. Forbid `builtins.filterSource` directly. This is hard and would
require more invasive `builtins.scopedImport` crimes to do at
evaluation time. I think this would realistically have to be done in
something like nixpkgs-vet instead and I didn’t have much luck
shoehorning a check like this into that codebase when I tried.
4. Fix the Nix bug. This would be great! But also it doesn’t seem to be
happening any time soon, it seems difficult to fix in a way that
doesn’t subtly break compatibility with the previous semantics, and
arguably the fix would need backporting all the way back to 2.3
given our minimum version policy.
5. Do nothing; have people continue to innocuously use `lib.fileset`
throughout Nixpkgs, breaking the installer whenever one of them
sneaks in to that closure, causing the channel to be blocked and
requiring expensive bisections to narrow down the inscrutable test
failure to the package using `lib.fileset`, which then needs moving
back off it. This sucks for the people who keep having to track it
down, holds back important channel bumps, and the criteria for when
it’s okay to use `lib.fileset` are not realistically possible to
teach to all contributors.
I'd be happy to work on (2) as an alternative; (3) would be difficult
and seems like overkill, (4) is not really something I trust myself
to do and wouldn’t address the immediate problem, and (5) isn’t
sustainable. I think that the current approach here is the best
trade‐off for now, as `lib.fileset` seems to be the only prominent
user of the `builtins.filterSource` API that works with full store
paths, exposing it to the Nix bug. It’s unfortunate to lose the
nice API, but since we can’t rely on it to produce correct results
and the channels keep getting blocked as a result, I don’t think
we really have an alternative right now.
2024-12-30 15:36:05 +00:00
|
|
|
|
|
|
|
__allowFileset = false;
|
2023-12-12 04:08:43 +01:00
|
|
|
},
|
2013-07-27 12:06:45 +02:00
|
|
|
}:
|
|
|
|
|
2015-11-19 16:39:34 +01:00
|
|
|
let
|
2024-03-05 17:58:20 -08:00
|
|
|
release-lib = import ./release-lib.nix {
|
|
|
|
inherit supportedSystems nixpkgsArgs;
|
|
|
|
};
|
|
|
|
|
|
|
|
inherit (release-lib) mapTestOn pkgs;
|
|
|
|
|
|
|
|
inherit (release-lib.lib) isDerivation mapAttrs optionals;
|
|
|
|
|
2015-11-19 16:39:34 +01:00
|
|
|
packagePython = mapAttrs (
|
|
|
|
name: value:
|
|
|
|
let
|
|
|
|
res = builtins.tryEval (
|
|
|
|
if isDerivation value then
|
|
|
|
value.meta.isBuildPythonPackage or [ ]
|
2023-11-22 16:46:36 -08:00
|
|
|
else if
|
|
|
|
value.recurseForDerivations or false
|
|
|
|
|| value.recurseForRelease or false
|
|
|
|
|| value.__recurseIntoDerivationForReleaseJobs or false
|
|
|
|
then
|
2015-11-19 16:39:34 +01:00
|
|
|
packagePython value
|
|
|
|
else
|
|
|
|
[ ]
|
|
|
|
);
|
2024-03-05 17:58:20 -08:00
|
|
|
in
|
|
|
|
optionals res.success res.value
|
2015-11-19 16:39:34 +01:00
|
|
|
);
|
2022-02-11 11:35:21 -08:00
|
|
|
|
|
|
|
jobs = {
|
|
|
|
lib-tests = import ../../lib/tests/release.nix { inherit pkgs; };
|
|
|
|
pkgs-lib-tests = import ../pkgs-lib/tests { inherit pkgs; };
|
|
|
|
|
|
|
|
tested = pkgs.releaseTools.aggregate {
|
|
|
|
name = "python-tested";
|
|
|
|
meta.description = "Release-critical packages from the python package sets";
|
|
|
|
constituents = [
|
2023-09-24 17:55:45 +02:00
|
|
|
jobs.nixos-render-docs.x86_64-linux # Used in nixos manual
|
2025-01-20 03:10:47 +01:00
|
|
|
jobs.remarshal_0_17.x86_64-linux # Used in pkgs.formats.yaml_1_1
|
2024-07-06 16:37:27 +02:00
|
|
|
jobs.python312Packages.afdko.x86_64-linux # Used in noto-fonts-color-emoji
|
|
|
|
jobs.python312Packages.buildcatrust.x86_64-linux # Used in pkgs.cacert
|
|
|
|
jobs.python312Packages.colorama.x86_64-linux # Used in nixos test-driver
|
|
|
|
jobs.python312Packages.ptpython.x86_64-linux # Used in nixos test-driver
|
|
|
|
jobs.python312Packages.requests.x86_64-linux # Almost ubiquous package
|
|
|
|
jobs.python312Packages.sphinx.x86_64-linux # Document creation for many packages
|
2022-02-11 11:35:21 -08:00
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
} // (mapTestOn (packagePython pkgs));
|
|
|
|
in
|
|
|
|
jobs
|