Speed up Windows CI: Ninja generator + cmocka caching#405
Merged
Conversation
- Add _CRT_SECURE_NO_WARNINGS to cbor_project_options INTERFACE library so examples/tests don't fail with C4996 errors from /sdl (sscanf, freopen, fopen) - Restrict LTO to Release builds only (CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE) to avoid unnecessary LTCG overhead in Debug - Add --parallel to cmake --build on Windows CI Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add-MpExclusion for the project directory to prevent real-time scanning overhead during cmake configure and build steps. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The cmocka configure step takes ~206s on MSVC due to each check_function_exists call spawning cl.exe with high startup overhead. Cache the build so it's only paid once. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #405 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 20 20
Lines 1663 1663
=========================================
Hits 1663 1663 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Use Ninja instead of VS generator to speed up configure (no .vcxproj generation, faster trial compilations) and build steps. Uses vswhere to locate vcvarsall.bat, writes batch scripts from bash to avoid quoting issues across shells. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
.vcxprojgeneration, faster trial compilations) and build. Usesvswhereto locatevcvarsall.bat, writes batch scripts from bash to keep the MSVC environment within a singlecmdsession.save_cache/restore_cacheto skip rebuilding cmocka (~215s) on every run.--paralleltocmake --buildcommands.Baseline timings (VS generator, no cache)
Observed timings (VS generator, cached cmocka, --parallel)
Ninja should further reduce the configure step.
Test plan
build-and-test-winpasses with Ninja generator🤖 Generated with Claude Code