Skip to content

Commit 9f6b99e

Browse files
runInLinuxVM: minimize saved-env
The export to saved-env was very intentionally done at the very beginning of vmRunCommand, even jumping through extra hoops just to avoid the PATH variable from polluting the saved variable. In 26eba25 we loaded stdenv in the wrong place, we should do it after saving the previous environment. This is also more consistent with the order of how we load those values back in stage2Init.
1 parent 3952f87 commit 9f6b99e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkgs/build-support/vm/default.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,11 +230,11 @@ rec {
230230

231231

232232
vmRunCommand = qemuCommand: writeText "vm-run" ''
233+
export > saved-env
233234
if [ -f "''${NIX_ATTRS_SH_FILE-}" ]; then
234235
source "$NIX_ATTRS_SH_FILE"
235236
fi
236237
source $stdenv/setup
237-
export > saved-env
238238
239239
PATH=${coreutils}/bin
240240
mkdir xchg

0 commit comments

Comments
 (0)