Repository navigation
fix: precompiled shared library symbol export, also reduce CI build times - #1387
Merged
Merged
Conversation
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
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
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
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.
🤖 AI text below 🤖
Reduces CI compile time on Azure and GHA, and fixes two latent bugs the work uncovered.
CI changes
cli11.single: ONglobally, 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).cli11.precompilevariable 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.gcc8,clang8(C++14), andgcc13jobs.tidypreset now usesCLI11_PRECOMPILED, so each_inl.hppis analyzed once viasrc/Precompile.cpp: 27 → 11.5 CPU-minutes measured in the CI container, same zero-warning result (~22 → ~9 min wall). A scopedsrc/.clang-tidydisablesmisc-definitions-in-headersfor that TU only, whereCLI11_INLINEexpands to nothing.-j2to-j4to match the 4-vCPU runners.Fixes
ConfigBase::from_configused a literalinlineinstead ofCLI11_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.cppused Win32 API that only arrived transitively through the_inlheaders, which precompiled mode does not include; it now includeswindows.hdirectly. Found by the newly wiredWindows17PCjob.Local development
devpreset/workflow:CLI11_PRECOMPILED=ON, examples off, ccache. An edit to an_inl.hppheader rebuilds only the static library (~20× less rebuild work). AGENTS.md updated to use presets.