Repository navigation
Don't ask gcc for multiarch on Windows - #9718
Merged
Merged
Conversation
Diagnostic only, to be removed.
Every CompilationEnvironment ran `gcc -print-multiarch` synchronously in its constructor. On Windows that answers nothing, but the first spawn in a process costs a cold PATH search and process start: several hundred ms on the Windows CI runner, and 5.4s on a loaded one, which timed out the first test in build-systems-tests that made an environment. Skip it on win32, and cover the multiarch lookup with tests. Fixes #9709 Co-Authored-By: Claude Opus 5.5 <[email protected]>
… the platform descriptor Co-Authored-By: Claude Opus 5.5 <[email protected]>
mattgodbolt
commented
Nov 29, 2026
| type FindCompiler = (langId: LanguageKey, compilerId: string) => BaseCompiler | undefined; | ||
|
|
||
| function findMultiarch(): string | null { | ||
| // Multiarch is a Debian notion and Windows gcc prints nothing for it, so don't pay for a process start to ask. |
Member
Author
There was a problem hiding this comment.
Can you note a TODO issue (after checking for any existing) to look into doing this asynchronously and/or removing multiarch support if it's no longer needed (it's one of the earliest hacky things I put in to support the particular machine I started on; maybe still needed but we should check).
Member
Author
There was a problem hiding this comment.
Filed as #9722. No existing issue covered it. It notes that prod nodes do have a host gcc, so multiarch is live there, and it cites earlier bugs it caused (#994, #7419).
Generated by Claude Code
|
This is now live |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Matt
Fixes #9709.
CompilationEnvironment's constructor runsgcc -print-multiarchsynchronously, every time. On Windows the answer is always empty (multiarch is a Debian thing), but the first non-builtin spawn in a process is expensive there. A diagnostic run onwindows-2022(commit 6d890d9 on this branch, since removed) measured, in a fresh test worker:So the first test in a file that builds an environment pays a few hundred ms. In recent green Windows runs that's 300-450ms on the cache-key test in
build-systems-tests, against 15ms on Linux. In the failed run on #9669 that test took 5463ms, and the first env-building tests incompilation-cache-key-tests(2677ms) andbase-compiler-testswere slow too. All three finished within a second of each other early in the run, while the runner was busiest. Nothing else inBaseCompileror the environment touches the OS.The fix skips the lookup on win32.
multiarchwas alreadynullthere, sogetEnvbehaves as before. New tests cover the Linux path (tuple found, gcc missing) and check that Windows never spawns.I left one pre-existing issue alone: on Linux the call has no timeout, so a hung
gccwould block startup. Happy to follow up with a timeout.Separately,
test/utils.ts'smakeCompilationEnvironmentpassesoptions.doCacheas the 4th argument, which isformattingService, sodoCacheis silently ignored. It's harmless today because test props have nocacheConfig. I can fix it in its own PR.Generated by Claude Code