vmTools.runInLinuxVM: do not run postHook on the host

Since 26eba25577 ("runInLinuxVM: re-add sourcing of stdenv &
.attrs.sh"), the host side of runInLinuxVM sources $stdenv/setup so that
preVM can use $out. That also runs postHook on the host, but postHook is
meant for the build inside the VM. runInLinuxImage sets PATH to the
guest's /usr/bin:/bin in postHook, so releaseTools.debBuild's
propagateImageName then failed on the host with
"mkdir: command not found".

Fixes #433008

Assisted-by: Claude Code (claude-opus-5-5)
This commit is contained in:
Philip Taron
2026-10-06 11:13:43 -07:00
parent 0375a8d16d
commit c851be6802

View File

@@ -293,6 +293,10 @@ let
${coreutils}/bin/cp $NIX_ATTRS_JSON_FILE $NIX_ATTRS_SH_FILE xchg
source "$NIX_ATTRS_SH_FILE"
fi
# The setup script is sourced here only so that `preVM` sees `$out` and
# friends. `postHook` belongs to the build inside the VM, where it may
# rely on the guest's tools (see `runInLinuxImage`), so skip it here.
postHook=
source $stdenv/setup
eval "$preVM"