#51292: fix: pre-create thinlto-cache dir on Windows to avoid bindflt race
Description of Change
Pre-creates the out/Default/thinlto-cache directory before invoking e build
on Windows, preventing lld-link from hitting a transient ERROR_INVALID_PARAMETER
when creating the directory through bindflt on the 32-core ARC runners (#51256).
The 32-core Windows ARC runners use container bind mounts backed by a filesystem
filter driver (bindflt/wcifs). Under the concurrent I/O burst of a Chromium build,
CreateDirectoryW can transiently fail with ERROR_INVALID_PARAMETER — the same
class of bug that #51256 patched for siso's ninja manifest opens. lld-link has no
retry logic, so it aborts with:
LLVM ERROR: can't create cache directory thinlto-cache: invalid argument
Pre-creating the directory means lld-link's CreateDirectoryW becomes a no-op
(ERROR_ALREADY_EXISTS), sidestepping the driver race entirely.
Checklist
- I have built and tested this change
- I have filled out the PR description
- I have reviewed and verified the changes
-
npm testpasses - tests are changed or added
- relevant API documentation, tutorials, and examples are updated and follow the documentation style guide
- 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