From 437e6dbbb0f2cd8ec03da52fc2a0da0114e7c0b3 Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Sat, 30 Nov 2024 12:57:40 +0100 Subject: [PATCH] runInLinuxVM: load stdenv/setup with fixed environment in stage2Init In [1] we started sourcing stdenv/setup in stage2Init to allow for structuredAttrs. We failed to take the changed NIX_BUILD_TOP etc. variables into account. We need to load stdenv/setup after changing them, because the structuredAttrs startup code makes use of it. [1]: 97ed6b4565e76286062e6942517a71ae4c9cac72 --- pkgs/build-support/vm/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/build-support/vm/default.nix b/pkgs/build-support/vm/default.nix index 18044102c1bb..e204a2b19543 100644 --- a/pkgs/build-support/vm/default.nix +++ b/pkgs/build-support/vm/default.nix @@ -169,7 +169,6 @@ rec { if [ -f "''${NIX_ATTRS_SH_FILE-}" ]; then source "$NIX_ATTRS_SH_FILE" fi - source $stdenv/setup export NIX_STORE=${storeDir} export NIX_BUILD_TOP=/tmp @@ -177,6 +176,7 @@ rec { export PATH=/empty cd "$NIX_BUILD_TOP" + source $stdenv/setup if ! test -e /bin/sh; then ${coreutils}/bin/mkdir -p /bin ${coreutils}/bin/ln -s ${bash}/bin/sh /bin/sh