Uh oh!
There was an error while loading. Please reload this page.
Use pinned Ninja and MSVC recipe for CMake compile_commands.json - #15
Open
Hannia Valera (hanniavalera) wants to merge 1 commit into
Open
Conversation
Replaces the CMake section's simple configure with the precision recipe: pin the Ninja generator, the MSVC compiler, and the in-tree build directory; do not force a build type; and skip the full build. In offline evaluation this raised CMake compile-database reliability from 0.588 to 0.950 across 1,000 attempts, bringing the CMake path to parity with the MSBuild rules, at about half the tokens and a third the wall time. Each pin maps to a failure the simple recipe leaves open: - -G Ninja: on Windows CMake defaults to a Visual Studio generator, which lays out per-configuration MSBuild files and may not emit a single compile_commands.json. - -DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl: prevents CMake from selecting a g++ or clang on PATH, so every entry uses MSVC. - -B build: the file must land where the tooling looks. - No -DCMAKE_BUILD_TYPE: forcing a type rewrites the optimization and runtime flags on every entry. - Configure once and stop: the database is written at configure time, so a full cmake --build adds time and timeout risk without changing it.
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 freeto 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
Replaces the CMake section of the
generate-compile-commandsskill with the precision recipe: pin the Ninja generator, the MSVC compiler, and the in-tree build directory; do not force a build type; and skip the full build.Why
The MSBuild half of this skill was tuned for reliability, but the CMake half remained a simple
cmake -B build -DCMAKE_EXPORT_COMPILE_COMMANDS=ONplus a full build, which leaves four environment-dependent defaults to chance. In an offline evaluation (1,000 attempts: 5 models x 20 iterations x 5 CMake projects x 2 skill variants), the simple recipe matched a fixed referencecompile_commands.jsonon 0.588 of attempts, while the precision recipe matched on 0.950 (three of five models perfect), at about half the tokens and a third the wall time.What each pin fixes
-G Ninja: on Windows CMake defaults to a Visual Studio generator, which lays out per-configuration MSBuild files and may not emit a singlecompile_commands.json. In the evaluation the simple recipe used Ninja only 481 of 500 times; the 19 that did not could not match.-DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl: prevents CMake from selecting ag++/clangonPATH, so every entry uses MSVC.-B build: the file must land where the tooling looks (build\compile_commands.json).-DCMAKE_BUILD_TYPE: forcing a type rewrites/Od /RTC1 -MDdon every entry; the reference pins none.cmake --buildadds time and timeout risk without changing it.Scope
Skill-only change to the
## CMake projectssection (56 insertions, 6 deletions). The MSBuild rules and the build-system selection logic are unchanged. Complements the recently merged MSBuild reliability work, bringing the CMake path to parity.