Skip to content

Commit

Permalink
runInLinuxVM: load stdenv/setup with fixed environment in stage2Init
Browse files Browse the repository at this point in the history
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]: 97ed6b4
  • Loading branch information
wolfgangwalther committed Nov 30, 2024
1 parent 9f6b99e commit 437e6db
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkgs/build-support/vm/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -169,14 +169,14 @@ 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
export TMPDIR=/tmp
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
Expand Down

0 comments on commit 437e6db

Please sign in to comment.