From 2cf5e918df76ec7adfd371bb7334605068648f0a Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 14:11:32 -0700 Subject: [PATCH] stdenv: remove with statements --- pkgs/stdenv/linux/default.nix | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/pkgs/stdenv/linux/default.nix b/pkgs/stdenv/linux/default.nix index a81ccfeb1188..c5e0498de66a 100644 --- a/pkgs/stdenv/linux/default.nix +++ b/pkgs/stdenv/linux/default.nix @@ -500,7 +500,7 @@ in assert isFromBootstrapFiles prevStage.coreutils; assert isFromBootstrapFiles prevStage.gnugrep; assert isBuiltByNixpkgsCompiler prevStage.patchelf; - assert lib.all isBuiltByNixpkgsCompiler (with prevStage; [ gmp isl_0_20 libmpc mpfr ]); + assert lib.all isBuiltByNixpkgsCompiler [ prevStage.gmp prevStage.isl_0_20 prevStage.libmpc prevStage.mpfr ]; stageFun prevStage { name = "bootstrap-stage3"; @@ -634,19 +634,24 @@ in disallowedRequisites = [ bootstrapTools.out ]; # Mainly avoid reference to bootstrap tools - allowedRequisites = with prevStage; with lib; + allowedRequisites = let + inherit (prevStage) gzip bzip2 xz zlib bash binutils coreutils diffutils findutils + gawk gmp gnumake gnused gnutar gnugrep gnupatch patchelf ed file glibc + attr acl libidn2 libunistring linuxHeaders gcc fortify-headers gcc-unwrapped + ; + in # Simple executable tools - concatMap (p: [ (getBin p) (getLib p) ]) [ + lib.concatMap (p: [ (lib.getBin p) (lib.getLib p) ]) [ gzip bzip2 xz bash binutils.bintools coreutils diffutils findutils gawk gmp gnumake gnused gnutar gnugrep gnupatch patchelf ed file ] # Library dependencies - ++ map getLib ( + ++ map lib.getLib ( [ attr acl zlib gnugrep.pcre2 libidn2 libunistring ] ++ lib.optional (gawk.libsigsegv != null) gawk.libsigsegv ) # More complicated cases - ++ (map (x: getOutput x (getLibc prevStage)) [ "out" "dev" "bin" ] ) + ++ (map (x: lib.getOutput x (getLibc prevStage)) [ "out" "dev" "bin" ] ) ++ [ linuxHeaders # propagated from .dev binutils gcc gcc.cc gcc.cc.lib gcc.expand-response-params # != (prevStage.)expand-response-params @@ -654,9 +659,9 @@ in ] ++ lib.optionals (localSystem.libc == "musl") [ fortify-headers ] ++ [ prevStage.updateAutotoolsGnuConfigScriptsHook prevStage.gnu-config ] - ++ (with gcc-unwrapped.passthru; [ - gmp libmpc mpfr isl - ]) + ++ [ + gcc-unwrapped.gmp gcc-unwrapped.libmpc gcc-unwrapped.mpfr gcc-unwrapped.isl + ] ; overrides = self: super: {