#51328: fix: route ThinLTO cache through junction outside bindflt mount
Description of Change
Follow-up to #51292. Pre-creating out\Default\thinlto-cache dodged the CreateDirectoryW race on bindflt-mounted ARC Windows runners but left CreateFileW for cache files inside still racy. The latest publish-x86-win flake on the v43.0.0-nightly.20260425 re-run was:
lld-link: error: Failed to open cache file
thinlto-cache\llvmcache-04BC8E90B7F1B9C2894445D4FEA9924B2FA44187: invalid argument
That is the same ERROR_INVALID_PARAMETER bindflt returns under the concurrent ThinLTO write load — just on a different file op.
This change replaces the pre-created cache directory with a junction at out\Default\thinlto-cache pointing to $env:TEMP\electron-thinlto-cache on the underlying volume. The reparse point is resolved in the I/O manager before bindflt sees per-file operations, so lld's cache reads and writes bypass the filter driver entirely. $env:TEMP on ARC runners lives under C:\Users\ContainerAdministrator\AppData\Local\Temp and is not bindflt-mounted.
The pre-create logic is idempotent for re-runs: detects an existing junction (without following it via Remove-Item) and a leftover real directory from older builds.
Checklist
- PR description included
- PR release notes describe the change in a way relevant to app developers, and are capitalized, punctuated, and past tense.
Release Notes
Notes: none
Backports
No Backports Requested
This pull request doesn't have any backports requested or created for older release branches.
What are backports?
Backports are copies of changes made to the main branch that are applied to older release branches. They ensure that bug fixes and important changes are available in maintained older versions of Electron.
Semver Impact
Semantic Versioning helps users understand the impact of updates:
- Major (X.y.z): Breaking changes that may require code modifications
- Minor (x.Y.z): New features that maintain backward compatibility
- Patch (x.y.Z): Bug fixes that don't change the API
- None: Changes that don't affect using facing parts of Electron