llvmPackages.llvm-manpages: fix eval on Darwin

Darwin prevents curl from being used in the Darwin bootstrap. The man
pages are built for darwin.binutils-unwrapped, but overrides are applied
only there, leaving plain llvmPackages.llvm-manpages broken.

The fix is to move the override to the llvmPackages package set.
This commit is contained in:
Randy Eckenrode 2024-11-20 13:18:54 -05:00
parent f959feb88a
commit 484eca6cec
No known key found for this signature in database
GPG Key ID: 64C1CD4EC2A600D9

View File

@ -326,6 +326,7 @@ let
libllvm libllvm
lld lld
llvm llvm
llvm-manpages
; ;
}; };
@ -548,6 +549,7 @@ assert bootstrapTools.passthru.isFromBootstrapFiles or false; # sanity check
''; '';
passthru.isFromBootstrapFiles = true; passthru.isFromBootstrapFiles = true;
}; };
llvm-manpages = self.llvmPackages.libllvm;
lld = self.stdenv.mkDerivation { lld = self.stdenv.mkDerivation {
name = "bootstrap-stage0-lld"; name = "bootstrap-stage0-lld";
buildCommand = ""; buildCommand = "";
@ -952,15 +954,24 @@ assert bootstrapTools.passthru.isFromBootstrapFiles or false; # sanity check
selfDarwin: superDarwin: selfDarwin: superDarwin:
darwinPackages prevStage darwinPackages prevStage
// sdkDarwinPackages prevStage // sdkDarwinPackages prevStage
# Rebuild darwin.binutils with the new LLVM, so only inherit libSystem from the previous stage.
// { // {
inherit (prevStage.darwin) libSystem; inherit (prevStage.darwin) libSystem;
}
);
# binutils-unwrapped needs to build the LLVM man pages, which requires a lot of Python stuff llvmPackages =
let
tools = super.llvmPackages.tools.extend (
_: superTools: {
# darwin.binutils-unwrapped needs to build the LLVM man pages, which requires a lot of Python stuff
# that ultimately ends up depending on git. Fortunately, the git dependency is only for check # that ultimately ends up depending on git. Fortunately, the git dependency is only for check
# inputs. The following set of overrides allow the LLVM documentation to be built without # inputs. The following set of overrides allow the LLVM documentation to be built without
# pulling curl (and other packages like ffmpeg) into the stdenv bootstrap. # pulling curl (and other packages like ffmpeg) into the stdenv bootstrap.
binutils-unwrapped = superDarwin.binutils-unwrapped.override (old: { #
llvm-manpages = super.llvmPackages.llvm-manpages.override { # However, even without darwin.binutils-unwrapped, this has to be overriden in the LLVM package set
# because otherwise llvmPackages.llvm-manpages on its own is broken.
llvm-manpages = superTools.llvm-manpages.override {
python3Packages = self.python3.pkgs.overrideScope ( python3Packages = self.python3.pkgs.overrideScope (
_: superPython: { _: superPython: {
hatch-vcs = superPython.hatch-vcs.overrideAttrs { doInstallCheck = false; }; hatch-vcs = superPython.hatch-vcs.overrideAttrs { doInstallCheck = false; };
@ -970,15 +981,11 @@ assert bootstrapTools.passthru.isFromBootstrapFiles or false; # sanity check
} }
); );
}; };
});
} }
); );
llvmPackages =
let
libraries = super.llvmPackages.libraries.extend (_: _: llvmLibrariesPackages prevStage); libraries = super.llvmPackages.libraries.extend (_: _: llvmLibrariesPackages prevStage);
in in
super.llvmPackages // { inherit libraries; } // libraries; super.llvmPackages // { inherit tools libraries; } // tools // libraries;
} }
]; ];