From 9f6b99e1ef93bef085eedf961f8a5667160454e6 Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Sat, 30 Nov 2024 12:20:16 +0100 Subject: [PATCH] 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 26eba25577388072ba13b1682860fe872ba39942 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. --- 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 df014ae80c06..18044102c1bb 100644 --- a/pkgs/build-support/vm/default.nix +++ b/pkgs/build-support/vm/default.nix @@ -230,11 +230,11 @@ rec { vmRunCommand = qemuCommand: writeText "vm-run" '' + export > saved-env if [ -f "''${NIX_ATTRS_SH_FILE-}" ]; then source "$NIX_ATTRS_SH_FILE" fi source $stdenv/setup - export > saved-env PATH=${coreutils}/bin mkdir xchg