Merge pull request #181536 from trofi/fix-gnumake-guile

gnumake: unconditionally disable guileSupport on bootstrap
This commit is contained in:
Sergei Trofimovich 2022-08-19 19:22:13 +01:00 committed by GitHub
commit a0219e7fb7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 27 additions and 5 deletions

View File

@ -1,4 +1,16 @@
{ lib, stdenv, fetchurl, guileSupport ? false, pkg-config, guile }:
{ lib
, stdenv
, fetchurl
, guileSupport ? false, guile
# avoid guile depend on bootstrap to prevent dependency cycles
, inBootstrap ? false
, pkg-config
, gnumake
}:
let
guileEnabled = guileSupport && !inBootstrap;
in
stdenv.mkDerivation rec {
pname = "gnumake";
@ -19,10 +31,10 @@ stdenv.mkDerivation rec {
./0002-remove-impure-dirs.patch
];
nativeBuildInputs = lib.optionals guileSupport [ pkg-config ];
buildInputs = lib.optionals guileSupport [ guile ];
nativeBuildInputs = lib.optionals guileEnabled [ pkg-config ];
buildInputs = lib.optionals guileEnabled [ guile ];
configureFlags = lib.optional guileSupport "--with-guile"
configureFlags = lib.optional guileEnabled "--with-guile"
# Make uses this test to decide whether it should keep track of
# subseconds. Apple made this possible with APFS and macOS 10.13.
@ -36,6 +48,11 @@ stdenv.mkDerivation rec {
outputs = [ "out" "man" "info" ];
separateDebugInfo = true;
passthru.tests = {
# make sure that the override doesn't break bootstrapping
gnumakeWithGuile = gnumake.override { guileSupport = true; };
};
meta = with lib; {
description = "A tool to control the generation of non-source files from sources";
longDescription = ''

View File

@ -356,6 +356,10 @@ in
# stage5.gcc -> stage4.coreutils -> stage3.glibc -> bootstrap
gmp = lib.makeOverridable (super.gmp.override { stdenv = self.stdenv; }).overrideAttrs (a: { pname = "${a.pname}-stage4"; });
# To allow users' overrides inhibit dependencies too heavy for
# bootstrap, like guile: https://github.com/NixOS/nixpkgs/issues/181188
gnumake = super.gnumake.override { inBootstrap = true; };
gcc = lib.makeOverridable (import ../../build-support/cc-wrapper) {
nativeTools = false;
nativeLibc = false;
@ -446,7 +450,7 @@ in
overrides = self: super: {
inherit (prevStage)
gzip bzip2 xz bash coreutils diffutils findutils gawk
gnumake gnused gnutar gnugrep gnupatch patchelf
gnused gnutar gnugrep gnupatch patchelf
attr acl zlib pcre libunistring;
${localSystem.libc} = getLibc prevStage;
@ -457,6 +461,7 @@ in
inherit (self) stdenv runCommandLocal patchelf libunistring;
};
gnumake = super.gnumake.override { inBootstrap = false; };
} // lib.optionalAttrs (super.stdenv.targetPlatform == localSystem) {
# Need to get rid of these when cross-compiling.
inherit (prevStage) binutils binutils-unwrapped;