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 { stdenv.mkDerivation rec {
pname = "gnumake"; pname = "gnumake";
@ -19,10 +31,10 @@ stdenv.mkDerivation rec {
./0002-remove-impure-dirs.patch ./0002-remove-impure-dirs.patch
]; ];
nativeBuildInputs = lib.optionals guileSupport [ pkg-config ]; nativeBuildInputs = lib.optionals guileEnabled [ pkg-config ];
buildInputs = lib.optionals guileSupport [ guile ]; 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 # Make uses this test to decide whether it should keep track of
# subseconds. Apple made this possible with APFS and macOS 10.13. # subseconds. Apple made this possible with APFS and macOS 10.13.
@ -36,6 +48,11 @@ stdenv.mkDerivation rec {
outputs = [ "out" "man" "info" ]; outputs = [ "out" "man" "info" ];
separateDebugInfo = true; separateDebugInfo = true;
passthru.tests = {
# make sure that the override doesn't break bootstrapping
gnumakeWithGuile = gnumake.override { guileSupport = true; };
};
meta = with lib; { meta = with lib; {
description = "A tool to control the generation of non-source files from sources"; description = "A tool to control the generation of non-source files from sources";
longDescription = '' longDescription = ''

View File

@ -356,6 +356,10 @@ in
# stage5.gcc -> stage4.coreutils -> stage3.glibc -> bootstrap # stage5.gcc -> stage4.coreutils -> stage3.glibc -> bootstrap
gmp = lib.makeOverridable (super.gmp.override { stdenv = self.stdenv; }).overrideAttrs (a: { pname = "${a.pname}-stage4"; }); 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) { gcc = lib.makeOverridable (import ../../build-support/cc-wrapper) {
nativeTools = false; nativeTools = false;
nativeLibc = false; nativeLibc = false;
@ -446,7 +450,7 @@ in
overrides = self: super: { overrides = self: super: {
inherit (prevStage) inherit (prevStage)
gzip bzip2 xz bash coreutils diffutils findutils gawk gzip bzip2 xz bash coreutils diffutils findutils gawk
gnumake gnused gnutar gnugrep gnupatch patchelf gnused gnutar gnugrep gnupatch patchelf
attr acl zlib pcre libunistring; attr acl zlib pcre libunistring;
${localSystem.libc} = getLibc prevStage; ${localSystem.libc} = getLibc prevStage;
@ -457,6 +461,7 @@ in
inherit (self) stdenv runCommandLocal patchelf libunistring; inherit (self) stdenv runCommandLocal patchelf libunistring;
}; };
gnumake = super.gnumake.override { inBootstrap = false; };
} // lib.optionalAttrs (super.stdenv.targetPlatform == localSystem) { } // lib.optionalAttrs (super.stdenv.targetPlatform == localSystem) {
# Need to get rid of these when cross-compiling. # Need to get rid of these when cross-compiling.
inherit (prevStage) binutils binutils-unwrapped; inherit (prevStage) binutils binutils-unwrapped;