lol

gnumake: unconditionally disable guileSupport on bootstrap

Before the change an attempt to use `gnumake.override { guileSupport = true; }`
caused recursion in bootstrap stages as guileSupport pulls in guile and it's
dependencies.

To restore the bootstrap the change unconditionally sets
`guileSupport = false;` for `gnumake`.

Co-authored-by: Sandro <sandro.jaeckel@gmail.com>

+27 -5
+21 -4
pkgs/development/tools/build-managers/gnumake/default.nix
··· 1 - { lib, stdenv, fetchurl, guileSupport ? false, pkg-config, guile }: 1 + { lib 2 + , stdenv 3 + , fetchurl 4 + , guileSupport ? false, guile 5 + # avoid guile depend on bootstrap to prevent dependency cycles 6 + , inBootstrap ? false 7 + , pkg-config 8 + , gnumake 9 + }: 10 + 11 + let 12 + guileEnabled = guileSupport && !inBootstrap; 13 + in 2 14 3 15 stdenv.mkDerivation rec { 4 16 pname = "gnumake"; ··· 19 31 ./0002-remove-impure-dirs.patch 20 32 ]; 21 33 22 - nativeBuildInputs = lib.optionals guileSupport [ pkg-config ]; 23 - buildInputs = lib.optionals guileSupport [ guile ]; 34 + nativeBuildInputs = lib.optionals guileEnabled [ pkg-config ]; 35 + buildInputs = lib.optionals guileEnabled [ guile ]; 24 36 25 - configureFlags = lib.optional guileSupport "--with-guile" 37 + configureFlags = lib.optional guileEnabled "--with-guile" 26 38 27 39 # Make uses this test to decide whether it should keep track of 28 40 # subseconds. Apple made this possible with APFS and macOS 10.13. ··· 35 47 36 48 outputs = [ "out" "man" "info" ]; 37 49 separateDebugInfo = true; 50 + 51 + passthru.tests = { 52 + # make sure that the override doesn't break bootstrapping 53 + gnumakeWithGuile = gnumake.override { guileSupport = true; }; 54 + }; 38 55 39 56 meta = with lib; { 40 57 description = "A tool to control the generation of non-source files from sources";
+6 -1
pkgs/stdenv/linux/default.nix
··· 356 356 # stage5.gcc -> stage4.coreutils -> stage3.glibc -> bootstrap 357 357 gmp = lib.makeOverridable (super.gmp.override { stdenv = self.stdenv; }).overrideAttrs (a: { pname = "${a.pname}-stage4"; }); 358 358 359 + # To allow users' overrides inhibit dependencies too heavy for 360 + # bootstrap, like guile: https://github.com/NixOS/nixpkgs/issues/181188 361 + gnumake = super.gnumake.override { inBootstrap = true; }; 362 + 359 363 gcc = lib.makeOverridable (import ../../build-support/cc-wrapper) { 360 364 nativeTools = false; 361 365 nativeLibc = false; ··· 446 450 overrides = self: super: { 447 451 inherit (prevStage) 448 452 gzip bzip2 xz bash coreutils diffutils findutils gawk 449 - gnumake gnused gnutar gnugrep gnupatch patchelf 453 + gnused gnutar gnugrep gnupatch patchelf 450 454 attr acl zlib pcre libunistring; 451 455 ${localSystem.libc} = getLibc prevStage; 452 456 ··· 457 461 inherit (self) stdenv runCommandLocal patchelf libunistring; 458 462 }; 459 463 464 + gnumake = super.gnumake.override { inBootstrap = false; }; 460 465 } // lib.optionalAttrs (super.stdenv.targetPlatform == localSystem) { 461 466 # Need to get rid of these when cross-compiling. 462 467 inherit (prevStage) binutils binutils-unwrapped;