Skip to content

Fix Windows Docker build: add Windows system dirs to the image PATH#15

Open
robobun wants to merge 1 commit into
oven-sh:masterfrom
robobun:farm/e57254f7/fix-windows-docker-path
Open

Fix Windows Docker build: add Windows system dirs to the image PATH#15
robobun wants to merge 1 commit into
oven-sh:masterfrom
robobun:farm/e57254f7/fix-windows-docker-path

Conversation

@robobun
Copy link
Copy Markdown
Contributor

@robobun robobun commented May 24, 2026

What's broken

The Daily Windows Docker Build workflow has failed on every scheduled run since 2026-02-17 (the last published -windows:bootstrap-* image on ghcr is from 2026-02-11). Latest failure: https://github.com/oven-sh/bun-development-docker-image/actions/runs/26337614553

Every run dies the same way in the bootstrap stage:

Step 13/17 : RUN git pull; ... pwsh -ExecutionPolicy Bypass -File .\scripts\bootstrap.ps1 -Optimize:$false; ...
Installing Scoop...
Initializing...
Scoop requires 'C:\Windows\System32\Robocopy.exe' to work. Please make sure 'C:\Windows\System32' is in your PATH.
Abort.
...
Step 14/17 : RUN & 'C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installer.exe' modify ...
The term 'C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installer.exe' is not recognized ...
returned a non-zero code: 1

Root cause

Dockerfile.windows sets

ENV PATH="C:\Program Files\PowerShell\7;C:\Program Files\Git\cmd;C:\ProgramData\chocolatey\bin;${PATH}"

but the servercore base image does not define PATH in its image config (it only exists in the container's registry hive), so ${PATH} expands to an empty string, and once ENV sets PATH it replaces the registry value for every process in the container. The published bootstrap image config confirms it — its entire PATH is:

PATH=;C:\Program Files\PowerShell\7;C:\Program Files\Git\cmd;C:\ProgramData\chocolatey\bin;

No C:\Windows\System32, so nothing in the system directories (robocopy, tar, wmic, reg, ...) is resolvable by name.

That was harmless while scripts/bootstrap.ps1 was chocolatey-based (choco.exe is on the PATH above). oven-sh/bun#26746 (merged 2026-02-19) rewrote the script to use Scoop, and the Scoop installer aborts immediately when robocopy can't be resolved. The bootstrap script therefore installs nothing (the RUN doesn't propagate pwsh's exit code, so the step "succeeds"), and the build then fails at the vs_installer.exe modify step because Visual Studio was never installed. The timeline matches: last green run 2026-02-16, 100% failure rate since.

Fix

List the Windows system directories explicitly in the ENV PATH instead of relying on ${PATH} expansion. One line (plus a comment explaining why).

Verification

I can't run a Windows container build from here, so the practical check is to trigger Daily Windows Docker Build via workflow_dispatch once this is merged (or just wait for the next 16:00 UTC run). With System32 on PATH the Scoop install prerequisite check passes, which is the hard blocker every run has hit for the past three months.

Note: the Linux Daily Docker Build / Daily WebKit Docker Build workflows are not affected by this — their occasional red runs (e.g. May 18/22) were runner disk-space flakes ("No space left on device") and recovered on the next run.

The servercore base image does not define PATH in its image config, so
${PATH} in the ENV instruction expands to an empty string and the
resulting image PATH contains only the PowerShell/Git/chocolatey
directories. Processes in the container then cannot resolve anything in
C:\Windows\System32 (robocopy, tar, wmic, reg).

Since oven-sh/bun#26746 switched scripts/bootstrap.ps1 to Scoop, the
Scoop installer aborts immediately because robocopy is not on PATH, so
no build tools or Visual Studio get installed and the bootstrap stage
fails at the vs_installer.exe step. The daily Windows build has failed
every run since 2026-02-17.

List the Windows system directories explicitly in the ENV PATH so the
bootstrap script can run.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 24, 2026

Warning

Review limit reached

@robobun, we couldn't start this review because you've used your available PR reviews for now.

Your plan currently allows 1 review/hour. Refill in 36 minutes and 3 seconds.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more review capacity refills, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than trial, open-source, and free plans. In all cases, review capacity refills continuously over time.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: dfe6451e-ee33-4b2e-a0d8-657f5cc13a56

📥 Commits

Reviewing files that changed from the base of the PR and between e861130 and 9b81eee.

📒 Files selected for processing (1)
  • Dockerfile.windows

Comment @coderabbitai help to get the list of available commands and usage tips.

@robobun
Copy link
Copy Markdown
Contributor Author

robobun commented May 24, 2026

Companion fix on the bun side: oven-sh/bun#31298 makes scripts/bootstrap.ps1 rebuild $env:Path from the registry before installing anything, so the Scoop robocopy prerequisite check passes even when the container's image-config PATH is stripped. Since the Dockerfile runs git pull and executes the script from main, either change alone unbreaks the daily Windows build — this PR additionally gives the image itself a sane PATH (System32 available in every later RUN step and for anyone using the image interactively).

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.

1 participant