From 4df33765698ad9b6ff28e2eb958f3971e23d1065 Mon Sep 17 00:00:00 2001 From: Aliaksandr Date: Thu, 14 May 2026 06:59:50 +0300 Subject: [PATCH] stdenv: linux: inherit nukeReferences through xgcc/stage2/stage3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit nukeReferences was rebuilt at every stage where it appeared (xgcc, stage2, stage3 — 3 redundant builds beyond stage1's initial build). It is used only at build time (to scrub references from libidn2/libunistring at stage2), never appears in the final stdenv's runtime closure, and its outputs are not propagated into other final-closure derivations. Adding it to the inherit list at xgcc, stage2, and stage3 collapses the chain to a single stage1 build. Stage4 still produces its own nukeReferences through the regular package set; that one is unused by the final stdenv. Build-only dependency, so this is safe with respect to the `disallowedRequisites` check on the final stdenv-linux. --- pkgs/stdenv/linux/default.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/stdenv/linux/default.nix b/pkgs/stdenv/linux/default.nix index d0b55753569d..61b4a996b03e 100644 --- a/pkgs/stdenv/linux/default.nix +++ b/pkgs/stdenv/linux/default.nix @@ -343,6 +343,7 @@ in gnum4 perl patchelf + nukeReferences ; ${localSystem.libc} = prevStage.${localSystem.libc}; gmp = super.gmp.override { cxx = false; }; @@ -457,6 +458,7 @@ in bison texinfo which + nukeReferences ; # Avoids infinite recursion, as this is in the build-time dependencies of libc. @@ -565,6 +567,7 @@ in libidn2 libunistring libxcrypt + nukeReferences ; # We build a special copy of libgmp which doesn't use libstdc++, because # xgcc++'s libstdc++ references the bootstrap-files (which is what