Fix CI build: accommodate CMake 4.x and skip upstream chai REPL#35
Open
leftibot wants to merge 1 commit intoChaiScript:masterfrom
Open
Fix CI build: accommodate CMake 4.x and skip upstream chai REPL#35leftibot wants to merge 1 commit intoChaiScript:masterfrom
leftibot wants to merge 1 commit intoChaiScript:masterfrom
Conversation
The CI introduced in ChaiScript#34 surfaced two failures rooted in the outdated CMakeLists.txt fetched as part of ChaiScript 6.1.0: 1. macOS runners ship CMake 4.x, which removes compatibility with cmake_minimum_required(VERSION < 3.5). The fetched subproject still declares VERSION 2.8 and configure aborts. Setting CMAKE_POLICY_VERSION_MINIMUM to 3.5 before add_subdirectory forces an acceptable floor for the transitive project. 2. Windows MSVC builds fail compiling ChaiScript's own src/main.cpp (the `chai` REPL) - a missing <chrono> include in upstream 6.1.0. The REPL target is unconditionally declared by the subproject, so adding EXCLUDE_FROM_ALL on add_subdirectory keeps it out of the default build. chaiscript_extras only needs ChaiScript's headers, so nothing else changes. Also modernized: bump cmake_minimum_required to 3.16, drop the now-unused BUILD_MODULES toggle, and explicitly opt into CMP0169 OLD so the deprecated FetchContent_Populate call is kept quiet on CMake 3.30+. Note: this PR does not address the unrelated ASAN/UBSAN heap-use-after-free surfaced by string_methods_test - that is a runtime bug in the extras+ChaiScript 6.1.0 interaction and will be tracked separately. Co-Authored-By: Claude Opus 4.7 (1M context) <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
Fixes the CI failures from #34 (tracked in #33). The build breakage is rooted in the outdated
CMakeLists.txtthat ships with ChaiScript 6.1.0 and gets pulled in viaFetchContent.Two independent CMake issues:
macOS Configure error — runners now ship CMake 4.x, which removes support for
cmake_minimum_required(VERSION < 3.5). ChaiScript 6.1.0's rootCMakeLists.txtstill declaresVERSION 2.8and configure aborts. Fixed by settingCMAKE_POLICY_VERSION_MINIMUM 3.5just beforeadd_subdirectory, forcing an acceptable floor for the transitive project.Windows MSVC Build error — ChaiScript 6.1.0's
src/main.cpp(thechaiREPL) has a missing<chrono>include and fails to compile under current MSVC ('high_resolution_clock': is not a class or namespace name). The REPL target is declared unconditionally in the subproject, soEXCLUDE_FROM_ALLonadd_subdirectorykeeps it out of the default build.chaiscript_extrasonly consumes ChaiScript's headers, so no functionality is lost.Drive-by modernization: bump
cmake_minimum_requiredto 3.16, explicitly opt intoCMP0169 OLDso the intentionalFetchContent_Populatecall stays quiet on CMake 3.30+, and drop the now-unusedBUILD_MODULES ONoverride (modules aren't needed by the tests, andEXCLUDE_FROM_ALLwould skip them regardless).Out of scope
The Linux ASAN/UBSAN job still fails on
string_methods_testwith a heap-use-after-free originating inchaiscript::extras::string_methods::splitwhen accessed via a chained index expression (e.g.split(",")[1]). That is a runtime bug in the extras+ChaiScript 6.1.0 interaction — not a CMake issue — and should be tracked separately.Test plan
cmake --build(Debug) — succeeds,chaiREPL not builtcmake --build(Release) — succeeds,chaiREPL not builtctest(Debug) — both tests passctest(Release) — both tests pass🤖 Generated with Claude Code