fix: mount VS2022's actual install path into Windows Docker builds - #120
Conversation
Root-caused a real, previously-misdiagnosed Windows CI failure in game-ci/unity-builder#844: every StandaloneWindows64/WSAPlayer build failed deep inside IL2CPP with "Could not set up a toolchain for Architecture x64" - looking for VS via a legacy VS2015-era registry key - despite the Docker container starting successfully and getting all the way through asset import and script compilation first. Root cause: getWindowsCommand only ever mounted "C:/Program Files (x86)/Microsoft Visual Studio" into the container. Visual Studio 2022 - the first native 64-bit VS release - installs to "C:/Program Files/Microsoft Visual Studio" instead (confirmed against actions/runner-images' own windows-2022 documentation: VS2022 Enterprise lives at "C:/Program Files/Microsoft Visual Studio/2022/ Enterprise" with the MSVC v143 toolset). GitHub-hosted windows-2022/ windows-latest runners only have VS2022, so the (x86) mount carries no real compiler toolchain into the container - it likely still exists (legacy/shared components), which is why Docker itself started fine and the failure only surfaced deep inside the IL2CPP build step. Fix: mount the VS2022-generation path too, alongside the existing (x86) one (kept for older on-prem/self-hosted VS installs). Guarded by fs.existsSync, same pattern as the registry-keys mount fix, so a host without a VS2022-generation install at this path isn't handed a Docker bind mount for a source that doesn't exist. Verified: tsc --noEmit shows only the same pre-existing TS5097 import-extension class of errors (one more instance of it, from the new test file import - not a new error type). bunx oxfmt --check clean. bun test ./src: 200 pass, 0 fail (docker.test.ts: 16 pass, 2 new regression tests for this fix). bun run build succeeds.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe Windows Docker command now conditionally mounts the Visual Studio 2022 directory for Unity default flows. Tests cover both path-presence cases and preserve the legacy x86 mount. The diff also normalizes string quotes. ChangesWindows Visual Studio mount
Estimated code review effort: 2 (Simple) | ~15 minutes Merge Risk: ⚪ Minimal · up to This localized change adds the Visual Studio 2022 installation path for Windows container builds while preserving the legacy path behavior. No actionable merge-blocking risk remains after normal checks and review. Sequence Diagram(s)sequenceDiagram
participant getWindowsCommand
participant fs.existsSync
participant DockerRunCommand
getWindowsCommand->>fs.existsSync: Check the VS2022 install path
fs.existsSync-->>getWindowsCommand: Return path presence
getWindowsCommand->>DockerRunCommand: Add the VS2022 bind mount when present
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Root-caused a real, previously-misdiagnosed Windows CI failure in game-ci/unity-builder#844. Every
StandaloneWindows64/WSAPlayerbuild fails deep inside IL2CPP:This looked environmental at first (missing VS workloads on the runner) — but the Docker container starts fine and gets all the way through asset import and script compilation first, which only makes sense if a real VS install exists on the host but isn't actually reaching the container.
Root cause
getWindowsCommandonly ever mountsC:/Program Files (x86)/Microsoft Visual Studiointo the container. Visual Studio 2022 — the first native 64-bit VS release — installs toC:/Program Files/Microsoft Visual Studioinstead. Confirmed against actions/runner-images' own windows-2022 documentation: VS2022 Enterprise lives atC:/Program Files/Microsoft Visual Studio/2022/Enterprisewith the MSVC v143 toolset (x64 included). GitHub-hostedwindows-2022/windows-latestrunners only have VS2022, so the(x86)mount carries no real compiler toolchain into the container — it likely still exists (legacy/shared components get installed there too), which is exactly why Docker itself starts fine and the failure only surfaces deep inside the IL2CPP build step, not at container-start time.Fix
Mount the VS2022-generation path too, alongside the existing
(x86)one (kept for older on-prem/self-hosted VS installs). Guarded byfs.existsSync, same pattern as the registry-keys mount fix, so a host without a VS2022-generation install at this path isn't handed a Docker bind mount for a source that doesn't exist.Verification
tsc --noEmit: shows only the same pre-existingTS5097import-extension class of errors (one more instance of it, from the new test file's import — not a new error type, confirmed viagit stashcomparison: 737 baseline vs 738 with this change).bunx oxfmt --check: clean.bun test ./src: 200 pass, 0 fail (docker.test.ts: 16 pass, including 2 new regression tests for this fix).bun run build: succeeds.Test plan
(x86)mounttsc --noEmit/oxfmt --checkcleanbun test ./srcpassesbun run buildsucceedsSummary by CodeRabbit
New Features
Bug Fixes