Skip to content

COMP: Build Pixi-Cxx CI as Release to enable Windows ccache#6327

Merged
hjmjohnson merged 4 commits into
InsightSoftwareConsortium:mainfrom
hjmjohnson:comp/pixi-ci-release-not-relwithdebinfo
May 23, 2026
Merged

COMP: Build Pixi-Cxx CI as Release to enable Windows ccache#6327
hjmjohnson merged 4 commits into
InsightSoftwareConsortium:mainfrom
hjmjohnson:comp/pixi-ci-release-not-relwithdebinfo

Conversation

@hjmjohnson
Copy link
Copy Markdown
Member

@hjmjohnson hjmjohnson commented May 22, 2026

Build the Pixi-Cxx CI legs as Release instead of RelWithDebInfo, and add dedicated build-ci/test-ci pixi tasks so CI's build/test chain depends on configure-ci (Release + ccache) rather than the local-dev configure (RelWithDebInfo). Motivated by ccache being effectively useless on the Windows MSVC leg today.

ccache rationale — Windows is ~1% cacheable today

The compiler-launcher plumbing (install, restore/save, CMAKE_CXX_COMPILER_LAUNCHER=ccache) is identical across all three OS legs, but RelWithDebInfo adds MSVC /Zi (separate-PDB debug info), which ccache cannot cache. Measured on a recent main Pixi-Cxx run:

OS Cacheable calls Notes
windows-2022 48 / 4492 (1.07%) 98.93% uncacheable — ccache provides ~no benefit
ubuntu-22.04 ~100% 99.85% hit rate
macos 4510 / 4510 (100%) 99.87% hit rate

Release omits /Zi, so Windows compilations become cacheable like Linux/macOS. /O2 is unchanged, so generated code is equivalent; only debug info is dropped. CDash/Azure debug coverage is unaffected — the Azure ITK.Linux leg already builds Debug for assert()/debug-codepath coverage.

Disk rationale — expected Windows .obj/.pdb size reduction

Because /O2 is identical in both configs, the entire object-size delta is the CodeView debug info /Zi writes into each .obj (.debug$S symbols, .debug$T type records). For ITK's extremely template-dense code, .debug$T dominates (one set of type records per distinct instantiation).

Expected on the Windows leg:

  • .obj ~60–75% smaller (Release object ≈ ¼–⅖ of the RelWithDebInfo object; ITK's template density puts it toward the upper end).
  • .pdb files eliminated entirely — compiler vc*.pdb + linker .pdb, often as large as the objects themselves. The existing post-build cleanup (COMP: Extend Pixi-Cxx post-build cleanup to MSVC artifacts (followup #6322) #6324) only deletes .obj/.lib; it never touched PDBs, so this is additional headroom.
  • Static .lib shrink proportionally (cxx CI config is static).

These are estimates from MSVC behavior, not yet a measurement; the cleanup step can be instrumented to report exact bytes if a hard number is wanted.

Why the build-ci / test-ci tasks

build/test depend on the local-dev configure (RelWithDebInfo), so CI relied on --skip-deps to keep the explicitly-run configure-ci (Release) build type from being clobbered. Adding build-ci (depends-on configure-ci) and test-ci (depends-on build-ci) makes the CI dependency chain resolve to Release + ccache by construction. The bare configure/build/test tasks keep RelWithDebInfo for local development (symbols preserved). --skip-deps is retained in the workflow for step isolation: the post-build disk-cleanup step deletes intermediates between Build and Test, so Test must not attempt a relink.

Local validation

Rebased on latest main; pixi run configure-ci then pixi run --skip-deps build-ci on macOS:

CMAKE_BUILD_TYPE=Release, CMAKE_CXX_COMPILER_LAUNCHER=ccache, ITK_USE_CCACHE=ON
4506 translation units compiled (core ITK + enabled remote modules)
ccache: 4504/4506 cacheable (99.96%)   # the Release-is-cacheable thesis, on macOS
pre-commit run --all-files: all hooks pass

The configure-ci task built RelWithDebInfo on every OS leg.  On Windows
the MSVC /Zi separate-PDB debug info makes nearly all compiler
invocations uncacheable by ccache (~1% cacheable vs ~100% on
Linux/macOS), so the Windows leg gets no ccache benefit.  Release omits
/Zi, letting Windows compilations be cached like the other platforms.

Only configure-ci (the CI configure task, run for all OS legs) changes;
the local-dev configure task keeps RelWithDebInfo.
@github-actions github-actions Bot added type:Compiler Compiler support or related warnings type:Infrastructure Infrastructure/ecosystem related changes, such as CMake or buildbots labels May 22, 2026
The build/test tasks depend on the local-dev configure (RelWithDebInfo),
so CI used --skip-deps to keep the configure-ci Release build type.  Add
build-ci (depends-on configure-ci) and test-ci (depends-on build-ci) and
point the Pixi-Cxx workflow at the *-ci tasks, so the CI dependency chain
resolves to the Release + ccache configure rather than the local default.
@hjmjohnson hjmjohnson force-pushed the comp/pixi-ci-release-not-relwithdebinfo branch from f358a5d to dcb9ffd Compare May 22, 2026 17:26
Copy link
Copy Markdown
Member

@dzenanz dzenanz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good on a glance.

@hjmjohnson hjmjohnson marked this pull request as ready for review May 22, 2026 17:39
@greptile-apps

This comment was marked as low quality.

@hjmjohnson
Copy link
Copy Markdown
Member Author

Both greptile concerns reviewed. They are known behavior changes that are desired.

Set fail-fast: false so a failure on one OS leg no longer cancels the
in-progress legs for the other platforms, ensuring every platform runs
to completion for diagnosis.
Add a build-external-data-ci task that builds the ITKData target to
download all ExternalData blobs, and run it before the build step in
the Pixi-Cxx workflow. A missing or failed download now aborts the job
immediately at a dedicated step rather than surfacing as an opaque
mid-test failure.
@hjmjohnson hjmjohnson merged commit e4088a5 into InsightSoftwareConsortium:main May 23, 2026
22 of 23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:Compiler Compiler support or related warnings type:Infrastructure Infrastructure/ecosystem related changes, such as CMake or buildbots

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants