Repository navigation
Conversation
Gin890
force-pushed
the
ci-windows-ccache
branch
from
October 17, 2026 23:54
82957cc to
f331bf6
Compare
The two Windows jobs spend 19-27 minutes each compiling, and #1610 left them out of ccache because three things blocked it: - ccache can't wrap the compiler under the Visual Studio generator, so Windows CI now configures with "Ninja Multi-Config". It keeps Visual Studio's output layout (bin/RelWithDebInfo/), so the upload and test steps are unchanged. A new step runs vcvars64.bat from the same Visual Studio and passes its environment to the later steps. For the clang job it puts that Visual Studio's own clang-cl first on PATH, the one the ClangCL toolset used. - ccache can't cache /Zi, which writes debug info to a shared PDB. CI now builds with /Z7 (CMP0141 and CMAKE_MSVC_DEBUG_INFORMATION_FORMAT =Embedded); the linker still writes the PDB that gets uploaded. - ccache can't cache a compile that writes a /FAs assembly listing. The listings are now behind a PA_ASSEMBLY_LISTINGS option, ON by default so local builds keep them, and CI turns it off. CMakeLists.txt and CoreLib.cmake picked the clang-cl flags (-march, -Wno-unused-function) by checking for the ClangCL toolset, which is empty under Ninja. They now check CMAKE_CXX_COMPILER_ID, which is "Clang" for clang-cl under either generator. Ninja runs nproc + 2 compiles at once on Windows instead of 10, close to the one compile per core that Visual Studio's /MP ran, so memory use stays near what the runner handled before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The first Windows runs with ccache turned up three problems: - Windows Clang failed on its first compiles: under Ninja, /MP and /external:anglebrackets reach clang-cl, which ignores them, and /WX turns its unused-argument warning into an error. Visual Studio's ClangCL toolset never passed them on, so they now go to cl only. - ccache-action's default install: detect picked up the ccache 4.9.1 that Strawberry Perl puts on the Windows runner's PATH. Windows now installs the action's own build (4.13.6). - With every file a cache miss, the MSVC build took 34 minutes to compile SerialProgramsLib, against 18 with the Visual Studio generator. On a miss, ccache runs the preprocessor before compiling by default. Depend mode instead hashes the includes the compiler reports (/showIncludes, or -MD on Linux and macOS, which CMake already passes), so it's now on for every build. With the newer ccache and depend mode, the same cold build took 22 minutes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The "Serial Programs" artifact uploads the whole bin/RelWithDebInfo folder, which includes the static libraries. SerialProgramsLib.lib was 1.2 GB uncompressed with /Zi and is 2.3 GB with /Z7, since it now holds every object's debug info. Ninja also writes the incremental-link file SerialPrograms.ilk (308 MB) next to the exe, where Visual Studio kept it in its intermediate folder. With both, the MSVC artifact grew from 592 to 972 MB. Neither is needed to run the program, so leave *.lib and *.ilk out of the upload. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Gin890
force-pushed
the
ci-windows-ccache
branch
from
October 18, 2026 04:46
f331bf6 to
22feb3a
Compare
Gin890
marked this pull request as ready for review
October 18, 2026 04:48
Nothing in CI uses debug info. The uploaded Windows builds are for testing; error reports from them stay on the tester's machine, and release builds, which need the PDB to read crash dumps, are made outside CI. Leaving it out makes compiles and links cheaper, the ccache entries smaller, and the artifacts smaller. - Windows: an empty CMAKE_MSVC_DEBUG_INFORMATION_FORMAT (with CMP0141) drops the /Z7 flag, and linking RelWithDebInfo with /INCREMENTAL:NO instead of /debug /INCREMENTAL writes no PDB or .ilk. So the artifact no longer needs the .ilk exclusion. - Ubuntu clang: keep RelWithDebInfo's -O2 -DNDEBUG but drop its -g. Only CI passes these flags, so CMakeLists.txt and its defaults are unchanged: other RelWithDebInfo builds still get full debug info. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Dalton-V
reviewed
Oct 18, 2026
| run: | | ||
| $vs = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath | ||
| $vcvars = cmd /c "`"$vs\VC\Auxiliary\Build\vcvars64.bat`" >nul && set" | ||
| if ($LASTEXITCODE -ne 0) { throw "vcvars64.bat failed with exit code $LASTEXITCODE" } |
Member
There was a problem hiding this comment.
nit: inline if statements can be annoying to read.
Dalton-V
reviewed
Oct 18, 2026
| fi | ||
| # Visual Studio ran about one compile per core (/MP). Keep Ninja near that instead of | ||
| # 10 at once, so memory use stays close to what the runner handled before. | ||
| BUILD_PARALLEL=$(( $(nproc) + 2 )) |
Member
There was a problem hiding this comment.
I think this is okay to be merged as is. We may want to come back to profile this to see if there is a reason to have this additional parallel limit.
Dalton-V
approved these changes
Oct 18, 2026
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.
Description
#1610 added ccache to the Linux and macOS builds but left out Windows, where each job spends 19–27 minutes compiling. Three things blocked it there:
/Zi, which writes debug info to a shared PDB./FAs).Changes
bin/RelWithDebInfo/), so the upload and test steps are unchanged. A new step runsvcvars64.batfrom the newest Visual Studio, the same one the Visual Studio generator used, and passes its environment to the later steps. For the clang job, it puts that Visual Studio's own clang-cl (22.1.3) first on PATH, so the compiler and linker (lld-link) stay the same as before.CMAKE_MSVC_DEBUG_INFORMATION_FORMAT(withCMAKE_POLICY_DEFAULT_CMP0141=NEW), so there's no/Zior/Z7. It links RelWithDebInfo with/INCREMENTAL:NOinstead of/debug /INCREMENTAL, so there's no PDB or.ilk.-O2 -DNDEBUGbut drops-g.CMakeLists.txtare unchanged, so release builds made outside CI keep full debug info.PA_ASSEMBLY_LISTINGSCMake option (ON by default, OFF in CI) for the/FAslistings, so local builds keep them.CMAKE_CXX_COMPILER_IDinstead ofCMAKE_GENERATOR_TOOLSET, which is empty under Ninja. This applies to the-marchand-Wno-unused-functionflags inCMakeLists.txtandCoreLib.cmake./MPand/external:anglebracketsgo toclonly. clang-cl ignores them, and/WXturns its unused-argument warning into an error. Visual Studio's ClangCL toolset never passed them on./showIncludes,-MD) instead of running the preprocessor first.nproc + 2jobs instead of 10, close to the one compile per core that Visual Studio's/MPran.*.libis left out of the "Serial Programs" artifact. The static libraries were already in it, andSerialProgramsLib.libalone was 1.2 GB uncompressed with/Zi. Only the build itself uses them.Results
All from
workflow_dispatchruns on this branch. Runs from branches other than main don't save the cache, so every compile was a miss. These runs were made before the "build without debug info" commit, so they still built with/Z7and uploaded a PDB.Without debug info
Runs on the "build without debug info" commit: a
workflow_dispatchrun and this PR's own CI, run at the same time. Every compile was a cache miss./Zi, same hour/Z7Not verified yet
🤖 Generated with Claude Code