From c70c1d2d898c665e326a176580da1cda0d329039 Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Wed, 29 Jul 2026 00:52:41 -0700 Subject: [PATCH] Extract Get-HostMachineArch for the VC++ round-trip test (#7597) #7549 taught Test-VCRedistInstalled to consult the host architecture before trusting the System32 DLL, but the round-trip job dot-sources a fixed list of functions out of setup.ps1 and that list did not gain the helper. Part A returns early on the registry hit, so only the clean-box half reaches the call and the job fails there with "Get-HostMachineArch is not recognized". Reproduced by dot-sourcing the old list and calling Test-VCRedistInstalled, which throws; with the helper added the same call returns. --- .github/workflows/studio-windows-inference-smoke.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/studio-windows-inference-smoke.yml b/.github/workflows/studio-windows-inference-smoke.yml index 3ebe442f52..b3badef02b 100644 --- a/.github/workflows/studio-windows-inference-smoke.yml +++ b/.github/workflows/studio-windows-inference-smoke.yml @@ -1888,8 +1888,11 @@ jobs: # (step/substep -> Write-StudioStdoutMirror / Get-StudioAnsi). $script:StudioVtOk = $false $script:UnslothVerbose = $false + # Get-HostMachineArch is reached only on the absent path, where + # Test-VCRedistInstalled consults it before trusting the System32 DLL, so + # part A passes without it and only the clean-box part fails. foreach ($fn in @('Get-StudioAnsi', 'Write-StudioStdoutMirror', 'step', 'substep', - 'Invoke-SetupCommand', 'Refresh-Environment', + 'Invoke-SetupCommand', 'Refresh-Environment', 'Get-HostMachineArch', 'Test-VCRedistInstalled', 'Ensure-VCRedist')) { $src = Get-FunctionSource -Path $setup -Name $fn if (-not $src) { throw "Function '$fn' not found in setup.ps1" }