Merge pull request #233391 from emilytrau/minimal-imports

minimal-bootstrap: remove imports from outside bootstrap
This commit is contained in:
John Ericson 2023-05-26 13:17:18 +02:00 committed by GitHub
commit 55358b47b4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 11 deletions

View file

@ -2,13 +2,15 @@
, config
, buildPlatform
, hostPlatform
, fetchurl
, checkMeta
}:
lib.makeScope
# Prevent using top-level attrs to protect against introducing dependency on
# non-bootstrap packages by mistake. Any top-level inputs must be explicitly
# declared here.
(extra: lib.callPackageWith ({ inherit lib config buildPlatform hostPlatform; } // extra))
(extra: lib.callPackageWith ({ inherit lib config buildPlatform hostPlatform fetchurl checkMeta; } // extra))
(self: with self; {
bash_2_05 = callPackage ./bash/2.nix { tinycc = tinycc-mes; };
@ -61,7 +63,7 @@ lib.makeScope
tinycc-bootstrappable = lib.recurseIntoAttrs (callPackage ./tinycc/bootstrappable.nix { });
tinycc-mes = lib.recurseIntoAttrs (callPackage ./tinycc/mes.nix { });
inherit (callPackage ./utils.nix { }) fetchurl derivationWithMeta writeTextFile writeText;
inherit (callPackage ./utils.nix { }) derivationWithMeta writeTextFile writeText;
test = kaem.runCommand "minimal-bootstrap-test" {} ''
echo ${bash_2_05.tests.get-version}

View file

@ -1,6 +1,5 @@
{ lib
, fetchurl
, writeText
, callPackage
, kaem
, m2libc

View file

@ -3,16 +3,9 @@
, callPackage
, kaem
, mescc-tools-extra
, checkMeta
}:
let
checkMeta = callPackage ../../../stdenv/generic/check-meta.nix { };
in
rec {
fetchurl = import ../../../build-support/fetchurl/boot.nix {
inherit (buildPlatform) system;
};
derivationWithMeta = attrs:
let
passthru = attrs.passthru or {};

View file

@ -27214,6 +27214,10 @@ with pkgs;
minimal-bootstrap = recurseIntoAttrs (import ../os-specific/linux/minimal-bootstrap {
inherit (stdenv) buildPlatform hostPlatform;
inherit lib config;
fetchurl = import ../build-support/fetchurl/boot.nix {
inherit (stdenv.buildPlatform) system;
};
checkMeta = callPackage ../stdenv/generic/check-meta.nix { };
});
mingetty = callPackage ../os-specific/linux/mingetty { };