Skip to content

Commit

Permalink
wip: filesets
Browse files Browse the repository at this point in the history
* <hxxps://github.com/NixOS/pull/340046>
* <hxxps://github.com/NixOS/pull/352491>
* <hxxps://github.com/NixOS/pull/369459>
  • Loading branch information
emilazy committed Dec 31, 2024
1 parent abab2a4 commit dbecdd4
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
23 changes: 22 additions & 1 deletion pkgs/top-level/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
, # Allow a configuration attribute set to be passed in as an argument.
config ? {}

, # Temporary hack to let Nixpkgs CI forbid use of `lib.fileset` until
# <https://github.com/NixOS/nix/issues/11503> is fixed.
__allowFileset ? true

, # List of overlays layers used to extend Nixpkgs.
overlays ? []

Expand All @@ -47,7 +51,24 @@ let # Rename the function arguments
crossSystem0 = crossSystem;

in let
lib = import ../../lib;
pristineLib = import ../../lib;

lib =
if __allowFileset then
pristineLib
else
pristineLib.extend (_: _: {
fileset = abort ''
The use of `lib.fileset` is currently forbidden in Nixpkgs due to the
upstream Nix bug <https://github.com/NixOS/nix/issues/11503>. This
causes difficult‐to‐debug errors when combined with chroot stores,
such as in the NixOS installer.
For packages that require source to be vendored inside Nixpkgs,
please use a subdirectory of the package instead.
'';
});

inherit (lib) throwIfNot;

Expand Down
4 changes: 4 additions & 0 deletions pkgs/top-level/release-outpaths.nix
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ let

inHydra = true;
};

# Catch use of `lib.fileset` in CI until
# <https://github.com/NixOS/nix/issues/11503> is fixed.
__allowFileset = false;
};
};
recurseIntoAttrs = attrs: attrs // { recurseForDerivations = true; };
Expand Down

0 comments on commit dbecdd4

Please sign in to comment.