Fix kit cmakeSettings boolean + semicolon regressions (#4927, #4934)#4936
Merged
Conversation
PR #4823 ("Support string arrays in kit cmakeSettings ...") tightened the cmake-kits.json schema for cmakeSettings to oneOf [string, string[]], which silently rejected boolean values that previously worked (#4927). It also kept the long-standing string semicolon-escape behavior in cmakeify(), which mangles values such as "CMAKE_PREFIX_PATH": "C:/a;C:/b" into "C:/a\;C:/b" on the command line (#4934). PR #4823 only patched the array path for Changes - schemas/kits-schema.json: Add boolean and number to the cmakeSettings patternProperty oneOf so the editor and JSON validator accept the full set of types the runtime already supports. - src/kits/kit.ts: Widen Kit.cmakeSettings value type to: string | string[] | boolean | number - src/cmakeValue.ts: Stop transforming string values; pass them through unchanged.
…ns correctly in JSON
b1a4b6b to
49ac2f3
Compare
The new schema test used a fixed-depth path (../../../) that worked under `yarn backendTests` (ts-node from `test/unit-tests/backend/`) but failed under `yarn unitTests` because the compiled file at `out/test/unit-tests/backend/kits-schema.test.js` is one directory deeper relative to the repo root. CI failed on Linux/Windows/macOS with ENOENT on `out/schemas/kits-schema.json`. Replace with a walk-up resolver that locates `schemas/kits-schema.json` from either `__dirname`, making the test invariant under both invocation modes. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
5368925 to
74515ee
Compare
The variant `settings` block is documented as "Similar to cmake.configureSettings in settings.json" but didn't spell out the semicolon rule. Now that this PR unifies `cmakeify()` to pass `;` through verbatim across all three settings sources (workspace, variants, kits), make the rule explicit here: strings pass through verbatim, use array notation for a declarative list, or pre-escape `\;` for a literal semicolon.
snehara99
approved these changes
May 15, 2026
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.
Fixes #4927 and #4934
Changes
Schema / type widening (#4927):
schemas/kits-schema.json-cmakeSettingsvalueoneOfnow acceptsbooleanandnumberin addition tostring/string[].src/kits/kit.ts-Kit.cmakeSettingswidened to{ [key: string]: string | string[] | boolean | number }."BUILD_TESTING": truenow produces-DBUILD_TESTING:BOOL=TRUEand shows as a checkbox in the Cache Editor.Semicolon passthrough (#4934):
src/cmakeValue.ts-cmakeify()no longer rewrites;→\;in string values.;keeps its natural CMakelist-separator meaning, matching how CMake Presets
cacheVariableshave always behaved. Users who need a literal;inside a single list element can pre-escape as\;in JSON.CMakeDriver.generateCMakeSettingsFlags()(kitcmakeSettings,workspace
cmake.configureSettings, variantsettings) so behavior is consistent across the three legacy sourcesand aligned with presets.
Cleanup:
src/drivers/cmakeDriver.ts- removed an obsoleteas stringcast on the variant branch.Tests
test/unit-tests/backend/cmakeify.test.ts- updated;-handling assertions; added BOOL / array regressiontests.
test/unit-tests/backend/kits-schema.test.ts(new) - loads a kit JSON withBUILD_TESTING: truethrough thesame Ajv validator the kit loader uses, locking [Bug] cmake-kits.json boolean cmakeSettings are broken #4927 at the schema layer.
Docs
docs/kits.md- rewrote the "Semicolon Handling" section to describe the new behavior, the Windows\;trap,and the pre-escape escape hatch.
docs/cmake-settings.md- updated thecmake.configureSettingsrow to match.docs/variants.md- clarified that variantsettingsfollow the same rule ascmake.configureSettings.CHANGELOG.md- entries under 1.24 Bug Fixes.Verified
yarn pretest,yarn lint,yarn backendTests(336 passing) all green locally."CMAKE_PREFIX_PATH": "a;b"emits-DCMAKE_PREFIX_PATH:STRING=a;b(no\;).