separate minimal-bootstrap-sources from make-minimal-bootstrap-sources

Ericson2314 observed that although FODs break the build-time cycle,
they don't break the eval-time cycle.  This cycle must be broken in
order to compute the derivation hash.

make-minimal-bootstrap-sources does and always has depended on the
full nixpkgs (including fetchFromGitHub).  This commit completely
separates minimal-bootstrap-sources from it, so that
minimal-bootstrap-sources now does not depend on
make-minimal-bootstrap-sources (or nixpkgs) in any way.

minimal-bootstrap-sources is now a "bare Nix" derivation.  It is an
FOD whose builder always fails with an error message.
This commit is contained in:
Adam Joseph
2023-06-26 01:22:59 -07:00
parent df720da7f0
commit c8080b06a9
5 changed files with 36 additions and 10 deletions
@@ -4,7 +4,6 @@
, hostPlatform
, fetchurl
, checkMeta
, make-minimal-bootstrap-sources
}:
lib.makeScope
@@ -61,8 +60,6 @@ lib.makeScope
ln-boot = callPackage ./ln-boot { };
inherit make-minimal-bootstrap-sources;
mes = lib.recurseIntoAttrs (callPackage ./mes { });
mes-libc = callPackage ./mes/libc.nix { };
@@ -1,4 +1,4 @@
{ make-minimal-bootstrap-sources
{
}:
rec {
@@ -6,6 +6,7 @@ rec {
# Pinned from https://github.com/oriansj/stage0-posix/commit/3189b5f325b7ef8b88e3edec7c1cde4fce73c76c
version = "unstable-2023-05-02";
rev = "3189b5f325b7ef8b88e3edec7c1cde4fce73c76c";
outputHashAlgo = "sha256";
# This 256 byte seed is the only pre-compiled binary in the bootstrap chain.
hex0-seed = import <nix/fetchurl.nix> {
@@ -69,9 +70,37 @@ rec {
specifically designed for bit-exact reproducibility, none of the
requirements above apply to `minimal-bootstrap-sources`.
*/
minimal-bootstrap-sources = make-minimal-bootstrap-sources.overrideAttrs(_: {
minimal-bootstrap-sources = derivation {
name = "${name}.nar.xz";
system = builtins.currentSystem;
outputHashMode = "flat";
outputHashAlgo = "sha256";
inherit outputHashAlgo;
outputHash = "sha256-ig988BiRTz92hhZZgKQW1tVPoV4aQ2D69Cq3wHvVgHg=";
});
# This builder always fails, but fortunately Nix will print the
# "builder", which is really the error message that we want the
# user to see.
builder = ''
#
#
# Neither your store nor your substituters seems to have:
#
# ${name}.nar.xz
#
# Please obtain or create this file, give it exactly the name
# shown above, and then run the following command:
#
# nix-store --add-fixed ${outputHashAlgo} ${name}.nar.xz
#
# You can create this file from an already-bootstrapped nixpkgs
# using the following command:
#
# nix-build '<nixpkgs>' -A make-minimal-bootstrap-sources
#
# Or, if you prefer, you can create this file using only `git`,
# `nix`, and `xz`. For the commands needed in order to do this,
# see `make-bootstrap-sources.nix`.
#
'';
};
}
@@ -3,7 +3,7 @@
}:
lib.makeScope newScope (self: with self; {
inherit (self.callPackage ./bootstrap-sources.nix)
inherit (self.callPackage ./bootstrap-sources.nix {})
version hex0-seed minimal-bootstrap-sources;
src = minimal-bootstrap-sources;
@@ -18,7 +18,7 @@
, xz
}:
let
inherit (import ./bootstrap-sources.nix { make-minimal-bootstrap-sources = null; }) name rev;
inherit (import ./bootstrap-sources.nix { }) name rev;
src = fetchFromGitHub {
owner = "oriansj";
+1 -1
View File
@@ -27440,8 +27440,8 @@ with pkgs;
inherit (stdenv.buildPlatform) system;
};
checkMeta = callPackage ../stdenv/generic/check-meta.nix { };
inherit make-minimal-bootstrap-sources;
});
minimal-bootstrap-sources = callPackage ../os-specific/linux/minimal-bootstrap/stage0-posix/bootstrap-sources.nix { };
make-minimal-bootstrap-sources = callPackage ../os-specific/linux/minimal-bootstrap/stage0-posix/make-bootstrap-sources.nix { };
mingetty = callPackage ../os-specific/linux/mingetty { };