Skip to content

fix: precompiled shared library symbol export, also reduce CI build times - #1387

Merged
henryiii merged 8 commits into
mainfrom
ci-build-speed
Jul 29, 2026
Merged

henryiii merged 8 commits into
mainfrom
ci-build-speed

Conversation

@henryiii

@henryiii henryiii commented Jul 29, 2026 •

Copy link
Copy Markdown
Collaborator

🤖 AI text below 🤖

Reduces CI compile time on Azure and GHA, and fixes two latent bugs the work uncovered.

CI changes

  • Azure set cli11.single: ON globally, so every Native job compiled the full test suite twice (normal + _Single). The default is now OFF, kept ON for one job per OS (Linux14, macOS-latest_23, Windows11).
  • The cli11.precompile variable was never passed to CMake, so the *PC* jobs tested the header-only build instead of the precompiled library. The build template now passes -DCLI11_PRECOMPILED.
  • The modern Docker batch (gcc 12/15, clang 17/20) moved from Azure to a GHA matrix job; Azure was the wall-clock bottleneck and these images work as GHA containers. The old-compiler batch stays on Azure since its images cannot run node-based actions. Dropped redundant gcc8, clang8 (C++14), and gcc13 jobs.
  • The clang-tidy job re-analyzed the full header-only implementation in every test and example TU. The tidy preset now uses CLI11_PRECOMPILED, so each _inl.hpp is analyzed once via src/Precompile.cpp: 27 → 11.5 CPU-minutes measured in the CI container, same zero-warning result (~22 → ~9 min wall). A scoped src/.clang-tidy disables misc-definitions-in-headers for that TU only, where CLI11_INLINE expands to nothing.
  • GHA install jobs built all examples but only run the Packaging tests; examples are off there now. Raised -j2 to -j4 to match the 4-vCPU runners.

Fixes

  • ConfigBase::from_config used a literal inline instead of CLI11_INLINE, so the precompiled shared library did not export it on macOS (clang emits a hidden weak symbol; ELF keeps it visible, so Linux passed). The macOS precompiled install job now builds shared to cover this.
  • AppTest.cpp used Win32 API that only arrived transitively through the _inl headers, which precompiled mode does not include; it now includes windows.h directly. Found by the newly wired Windows17PC job.

Local development

  • New dev preset/workflow: CLI11_PRECOMPILED=ON, examples off, ccache. An edit to an _inl.hpp header rebuilds only the static library (~20× less rebuild work). AGENTS.md updated to use presets.

henryiii added 4 commits July 29, 2026 11:55
ConfigBase::from_config used a literal inline, so the precompiled
shared library did not export it on macOS (clang emits it as a hidden
weak symbol), and test executables failed to link. Convert it and two
internal helpers to CLI11_INLINE for consistency.

Assisted-by: ClaudeCode:claude-fable-5
Azure built single-file test duplicates in every Native job; only one
job per OS keeps them on now. The cli11.precompile variable was never
passed to CMake, so the PC jobs did not test the precompiled library;
pass it in the build template. GHA install jobs built all examples but
only run the Packaging tests, so turn examples off there, and raise
build parallelism to match the 4-vCPU runners. The macOS precompiled
install job now builds shared to cover dylib symbol export.

Assisted-by: ClaudeCode:claude-fable-5
The dev preset uses CLI11_PRECOMPILED, disables examples, and uses
ccache. An edit to an _inl.hpp header rebuilds only the static library.
Document the preset workflow in AGENTS.md.

Assisted-by: ClaudeCode:claude-fable-5
Remove gcc8, clang8 (C++14), and gcc13 jobs; nearby versions and
standards keep the coverage. Bump the Unix build to -j4.

Assisted-by: ClaudeCode:claude-fable-5
@henryiii henryiii changed the title ci: reduce build times, fix precompiled shared library symbol export fix: precompiled shared library symbol export, also reduce CI build times Jul 29, 2026
@codecov

codecov Bot commented Jul 29, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (b19d0fa) to head (f0b7fa4).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #1387   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           19        19           
  Lines         5216      5217    +1     
  Branches      1128      1128           
=========================================
+ Hits          5216      5217    +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

henryiii added 4 commits July 29, 2026 12:31
The subprocess helper used Win32 API that only arrived transitively
through the CLI11 _inl headers, which the precompiled mode does not
include.

Assisted-by: ClaudeCode:claude-fable-5
Azure is the wall-clock bottleneck. The Docker_new batch (gcc 12/15,
clang 17/20) uses recent Debian images that work as GHA containers, so
it becomes a matrix job in the Tests workflow. The old-compiler Docker
batch stays on Azure; its images are too old to run node-based actions.

Assisted-by: ClaudeCode:claude-fable-5
Each test and example TU re-analyzed the full header-only
implementation, which made the clang-tidy job the slowest in CI. With
CLI11_PRECOMPILED the _inl headers are analyzed once through
src/Precompile.cpp, and measured analysis work drops from 27 to 11.5
CPU-minutes with the same zero-warning result. A scoped src/.clang-tidy
disables misc-definitions-in-headers for that TU only, since
CLI11_INLINE expands to nothing there. Extra validators are enabled so
the precompiled library contains the symbols that fuzzApp and two
examples turn on in-source, and their implementation gets analyzed too.

Assisted-by: ClaudeCode:claude-fable-5
CLI11_INLINE expands to nothing when CLI11_COMPILE is set, which left
non-inline definitions in a header shared by every test. These are test
helpers, not library code, so use the inline keyword directly. Fixes
misc-definitions-in-headers in the precompiled clang-tidy job.

Assisted-by: ClaudeCode:claude-fable-5
@henryiii
henryiii marked this pull request as ready for review July 29, 2026 19:18
@henryiii
henryiii merged commit fb030b8 into main Jul 29, 2026
72 checks passed
@henryiii
henryiii deleted the ci-build-speed branch July 29, 2026 19:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant