Skip to content

windows: refresh PATH and assert required tools in scenario run scripts#68

Merged
jewilder merged 1 commit into
microsoft:mainfrom
philnach:fix/windows-stale-path
May 12, 2026
Merged

windows: refresh PATH and assert required tools in scenario run scripts#68
jewilder merged 1 commit into
microsoft:mainfrom
philnach:fix/windows-stale-path

Conversation

@philnach
Copy link
Copy Markdown
Member

The HOBL RPC service on the DUT captures PATH at boot. When a scenario prep script installs tools via winget, those tools land in the Machine PATH but the RPC service's inherited PATH is stale, so pwsh sessions spawned afterward cannot find them. Combined with prep_status persistence skipping prep on subsequent runs, this caused net_aspire to fail with cryptic 'dotnet not recognized' errors.

Fix:

  • net_aspire_run.ps1 / net_aspire_teardown.ps1: add Machine+User PATH refresh plus a fallback C:\Program Files\dotnet PATH prepend (this is the actually-broken script). Bump prep_version 8 -> 9.

  • All other Windows run scripts already had the PATH refresh but invoked tools blindly. Add a Get-Command assertion block right after the refresh that lists each required tool, logs a single clear ERROR line and PATH dump on miss, and exits 1 instead of letting the shell emit a chain of 'term not recognized' messages.

Affected scenarios (assertion + prep_version bump):

net_aspire (8->9), foundrylocal (6->7), ollama (5->6), llvm (7->8), nodejs (6->7), opencv_build (5->6), vscode (7->8), pytorch_inf (12->13), fast_api (4->5)

Skipped (no PATH-resolved external tools to assert):

mlperf (uses absolute path to mlperf-windows.exe), spring_petclinic (uses local .\mvnw.cmd and locates JDK via Get-ChildItem)

The HOBL RPC service on the DUT captures PATH at boot. When a scenario prep script installs tools via winget, those tools land in the Machine PATH but the RPC service's inherited PATH is stale, so pwsh sessions spawned afterward cannot find them. Combined with prep_status persistence skipping prep on subsequent runs, this caused net_aspire to fail with cryptic 'dotnet not recognized' errors.

Fix:

- net_aspire_run.ps1 / net_aspire_teardown.ps1: add Machine+User PATH refresh plus a fallback C:\\Program Files\\dotnet PATH prepend (this is the actually-broken script). Bump prep_version 8 -> 9.

- All other Windows run scripts already had the PATH refresh but invoked tools blindly. Add a Get-Command assertion block right after the refresh that lists each required tool, logs a single clear ERROR line and PATH dump on miss, and exits 1 instead of letting the shell emit a chain of 'term not recognized' messages.

Affected scenarios (assertion + prep_version bump):

  net_aspire (8->9), foundrylocal (6->7), ollama (5->6), llvm (7->8), nodejs (6->7), opencv_build (5->6), vscode (7->8), pytorch_inf (12->13), fast_api (4->5)

Skipped (no PATH-resolved external tools to assert):

  mlperf (uses absolute path to mlperf-windows.exe), spring_petclinic (uses local .\\mvnw.cmd and locates JDK via Get-ChildItem)
@jewilder jewilder merged commit e7a4891 into microsoft:main May 12, 2026
1 check passed
@philnach philnach deleted the fix/windows-stale-path branch May 13, 2026 21:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants