From c851be6802b221ca174802adbd43d764d540a5d0 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Tue, 6 Oct 2026 11:13:43 -0700 Subject: [PATCH] vmTools.runInLinuxVM: do not run postHook on the host Since 26eba25577388 ("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) --- pkgs/build-support/vm/default.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/build-support/vm/default.nix b/pkgs/build-support/vm/default.nix index 82c61ba8462d..0a29ec630beb 100644 --- a/pkgs/build-support/vm/default.nix +++ b/pkgs/build-support/vm/default.nix @@ -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"