-
Notifications
You must be signed in to change notification settings - Fork 300
build.ps1 should detect Windows without requiring OS=Windows_NT #821
Copy link
Copy link
Closed
Labels
P2Normal priority bug or improvement with limited blast radius.Normal priority bug or improvement with limited blast radius.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.This issue has meaningful maintainer-visible impact outside the owned taxonomy.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Description
Activity
Metadata
Metadata
Assignees
Labels
P2Normal priority bug or improvement with limited blast radius.Normal priority bug or improvement with limited blast radius.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.This issue has meaningful maintainer-visible impact outside the owned taxonomy.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Type
Fields
Priority
None yet
Summary
build.ps1currently treats a Windows host as unsupported when theOSenvironment variable is missing, even though PowerShell/.NET can identify the platform directly.I hit this on a Windows Insider/preview host (
25H2, build26200.8737) from a PowerShell 7 process where$env:OSwas not populated. The script failed at the prerequisite stage withThis project requires Windowsdespite running on Windows.Reproduction
From a Windows PowerShell 7 session:
Before the fix, the OS prerequisite check fails because it only checks:
Expected behavior
build.ps1should detect Windows from the host/runtime, not from a mutable optional environment variable.Proposed fix
Use PowerShell's
$IsWindowsautomatic variable when available, with a Windows PowerShell-compatible fallback through[System.Environment]::OSVersion.Platform.Local validation
On Windows
25H2build26200.8737:./build.ps1 -CheckOnlywith$env:OS = $nullpassed and reportedWindows detected../build.ps1with$env:OS = $nullpassed.dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj --no-restorepassed: 2417 passed, 29 skipped.dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj --no-restorepassed: 1154 passed.openclaw-autoreviewon the one-file diff reported no accepted/actionable findings.