From e466814ef8036d31b55685ac3679a24f18c8641d Mon Sep 17 00:00:00 2001 From: enricobuehler Date: Mon, 22 Jun 2026 10:48:29 +0000 Subject: [PATCH] fix(windows): deploy-host reads build env from Machine scope Reads PUNKTFUNK_NVENC_LIB_DIR/LIBCLANG_PATH/CMAKE_POLICY_VERSION_MINIMUM directly from Machine scope into the process, so the build is correct even when the SSH/parent shell predates setup-build-env.ps1 (env is inherited at spawn). Co-Authored-By: Claude Opus 4.8 --- scripts/windows/deploy-host.ps1 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/windows/deploy-host.ps1 b/scripts/windows/deploy-host.ps1 index 7d0d148..cf8c0e9 100644 --- a/scripts/windows/deploy-host.ps1 +++ b/scripts/windows/deploy-host.ps1 @@ -33,6 +33,14 @@ $vcvars = Find-VcVars Write-Host "vcvars : $vcvars" Set-Location $repo +# Load the persisted build env (Machine scope) into THIS process, so the build sees it even +# if this shell was started before setup-build-env.ps1 ran (env is inherited at spawn time). +foreach ($k in 'PUNKTFUNK_NVENC_LIB_DIR','LIBCLANG_PATH','CMAKE_POLICY_VERSION_MINIMUM') { + $v = [Environment]::GetEnvironmentVariable($k, 'Machine') + if ($v) { [Environment]::SetEnvironmentVariable($k, $v, 'Process'); Write-Host "env : $k=$v" } + else { Write-Warning "env $k not set (run setup-build-env.ps1)" } +} + # 1. stop the service so the .exe is writable Write-Host "stopping $svc ..." & sc.exe stop $svc | Out-Null