forked from mirrors/nixpkgs
Make the bootsrap respect the contentAddressedByDefault setting
Patch every `derivation` call in the bootsrap process to add it a conditional `__contentAddressed` parameter. That way, passing `contentAddressedByDefault` means that the entire build closure of a system can be content addressed
This commit is contained in:
parent
559c5792ef
commit
14f66d60a7
|
@ -44,7 +44,7 @@ in rec {
|
|||
stripAllFlags=" " # the Darwin "strip" command doesn't know "-s"
|
||||
'';
|
||||
|
||||
bootstrapTools = derivation {
|
||||
bootstrapTools = derivation ({
|
||||
inherit system;
|
||||
|
||||
name = "bootstrap-tools";
|
||||
|
@ -54,7 +54,11 @@ in rec {
|
|||
inherit (bootstrapFiles) mkdir bzip2 cpio tarball;
|
||||
|
||||
__impureHostDeps = commonImpureHostDeps;
|
||||
};
|
||||
} // lib.optionalAttrs (config.contentAddressedByDefault or false) {
|
||||
__contentAddressed = true;
|
||||
outputHashAlgo = "sha256";
|
||||
outputHashMode = "recursive";
|
||||
});
|
||||
|
||||
stageFun = step: last: {shell ? "${bootstrapTools}/bin/bash",
|
||||
overrides ? (self: super: {}),
|
||||
|
|
|
@ -170,7 +170,7 @@ in
|
|||
({}: {
|
||||
__raw = true;
|
||||
|
||||
bootstrapTools = derivation {
|
||||
bootstrapTools = derivation ({
|
||||
inherit system;
|
||||
inherit make bash coreutils findutils
|
||||
diffutils grep patch gawk cpio sed
|
||||
|
@ -182,7 +182,11 @@ in
|
|||
buildInputs = [ make ];
|
||||
mkdir = "/bin/mkdir";
|
||||
ln = "/bin/ln";
|
||||
};
|
||||
} // lib.optionalAttrs (config.contentAddressedByDefault or false) {
|
||||
__contentAddressed = true;
|
||||
outputHashAlgo = "sha256";
|
||||
outputHashMode = "recursive";
|
||||
});
|
||||
})
|
||||
|
||||
({ bootstrapTools, ... }: rec {
|
||||
|
|
|
@ -84,6 +84,11 @@ let
|
|||
allowedRequisites = allowedRequisites
|
||||
++ defaultNativeBuildInputs ++ defaultBuildInputs;
|
||||
}
|
||||
// lib.optionalAttrs (config.contentAddressedByDefault or false) {
|
||||
__contentAddressed = true;
|
||||
outputHashAlgo = "sha256";
|
||||
outputHashMode = "recursive";
|
||||
}
|
||||
// {
|
||||
inherit name;
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{ system, bootstrapFiles }:
|
||||
{ system, bootstrapFiles, extraAttrs }:
|
||||
|
||||
derivation {
|
||||
derivation ({
|
||||
name = "bootstrap-tools";
|
||||
|
||||
builder = bootstrapFiles.busybox;
|
||||
|
@ -15,4 +15,4 @@ derivation {
|
|||
langC = true;
|
||||
langCC = true;
|
||||
isGNU = true;
|
||||
}
|
||||
} // extraAttrs)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{ system, bootstrapFiles }:
|
||||
{ system, bootstrapFiles, extraAttrs }:
|
||||
|
||||
derivation {
|
||||
derivation ({
|
||||
name = "bootstrap-tools";
|
||||
|
||||
builder = bootstrapFiles.busybox;
|
||||
|
@ -15,4 +15,4 @@ derivation {
|
|||
langC = true;
|
||||
langCC = true;
|
||||
isGNU = true;
|
||||
}
|
||||
} // extraAttrs)
|
||||
|
|
|
@ -61,7 +61,16 @@ let
|
|||
|
||||
|
||||
# Download and unpack the bootstrap tools (coreutils, GCC, Glibc, ...).
|
||||
bootstrapTools = import (if localSystem.libc == "musl" then ./bootstrap-tools-musl else ./bootstrap-tools) { inherit system bootstrapFiles; };
|
||||
bootstrapTools = import (if localSystem.libc == "musl" then ./bootstrap-tools-musl else ./bootstrap-tools) {
|
||||
inherit system bootstrapFiles;
|
||||
extraAttrs = lib.optionalAttrs
|
||||
(config.contentAddressedByDefault or false)
|
||||
{
|
||||
__contentAddressed = true;
|
||||
outputHashAlgo = "sha256";
|
||||
outputHashMode = "recursive";
|
||||
};
|
||||
};
|
||||
|
||||
getLibc = stage: stage.${localSystem.libc};
|
||||
|
||||
|
|
Loading…
Reference in a new issue