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

top-level/splice.nix: add NIXPKGS_ALWAYS_SPLICE debugging aid #263277

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion pkgs/top-level/splice.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@
# For performance reasons, rather than uniformally splice in all cases, we only
# do so when `pkgs` and `buildPackages` are distinct. The `actuallySplice`
# parameter there the boolean value of that equality check.

let
# This is for debugging only. It significantly degrades
# performance. In theory it is impure, but in practice it should
# not affect the result of eval unless you're going out of your
# way to detect that it has been set (i.e. myDrv?__spliced).
NIXPKGS_ALWAYS_SPLICE = builtins.getEnv("NIXPKGS_ALWAYS_SPLICE") != "";
in

lib: pkgs: actuallySplice:

let
Expand Down Expand Up @@ -102,7 +111,9 @@ let
, pkgsHostTarget
, pkgsTargetTarget
} @ args:
if actuallySplice then spliceReal args else pkgsHostTarget;
if !NIXPKGS_ALWAYS_SPLICE && actuallySplice
then pkgsHostTarget
else spliceReal args;

splicedPackages = splicePackages
{
Expand Down