From a35c072e3b67acf2f1217b72c01678981b42d8e5 Mon Sep 17 00:00:00 2001 From: ColinLee Date: Thu, 17 Sep 2026 16:41:31 +0800 Subject: [PATCH] fix(cpp): align the ANTLR4 compatibility bound with the enforced range ANTLR4Dependency.cmake accepts system ANTLR4 versions from 4.9.3 up to but excluding 4.13.0, because the C++ runtime shipped by 4.13 and newer requires C++17 while TsFile still builds as C++11/14. The documentation and the dependency test did not reflect that boundary: both READMEs advertised an upper bound of 5.0.0 and the test fixture marked 5.0.0 as the incompatible version. A regression that widened the accepted range would therefore pass the test suite. Update the two READMEs and pin the incompatible fixture to 4.13.0 so the boundary itself is covered. --- cpp/README.md | 2 +- cpp/cmake/tests/ANTLR4DependencyTest.cmake | 2 +- cpp/third_party/README.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cpp/README.md b/cpp/README.md index de7ba9cd6..b1a69b0a7 100644 --- a/cpp/README.md +++ b/cpp/README.md @@ -170,7 +170,7 @@ dependencies are resolved: ANTLR4, Snappy, LZ4, lzokay, SIMDe, zlib, Zstandard, and liblzma are currently resolved through this policy. A compatible system ANTLR4 must be version 4.9.3 -or newer and earlier than 5.0.0, and provide an `antlr4_static` or +or newer and earlier than 4.13.0, and provide an `antlr4_static` or `antlr4_shared` target. A compatible system Snappy must be version 1.2.1 or newer in the 1.x release series and provide the `Snappy::snappy` CMake target. A compatible system LZ4 must be version 1.9.4 or newer in the 1.x release diff --git a/cpp/cmake/tests/ANTLR4DependencyTest.cmake b/cpp/cmake/tests/ANTLR4DependencyTest.cmake index 5ceaecdda..f3594929b 100644 --- a/cpp/cmake/tests/ANTLR4DependencyTest.cmake +++ b/cpp/cmake/tests/ANTLR4DependencyTest.cmake @@ -86,7 +86,7 @@ endfunction() _tsfile_write_fake_antlr4("${_TSFILE_COMPATIBLE_ROOT}" 4.9.3 antlr4_static) _tsfile_write_fake_antlr4("${_TSFILE_TOO_OLD_ROOT}" 4.9.2 antlr4_static) -_tsfile_write_fake_antlr4("${_TSFILE_INCOMPATIBLE_ROOT}" 5.0.0 antlr4_shared) +_tsfile_write_fake_antlr4("${_TSFILE_INCOMPATIBLE_ROOT}" 4.13.0 antlr4_shared) file(MAKE_DIRECTORY "${_TSFILE_MISSING_ROOT}") _tsfile_run_antlr4_case(system-compatible SYSTEM SYSTEM TRUE diff --git a/cpp/third_party/README.md b/cpp/third_party/README.md index 6b782d8b5..74ae8c65e 100644 --- a/cpp/third_party/README.md +++ b/cpp/third_party/README.md @@ -86,7 +86,7 @@ dependency before compiling and linking TsFile. `Vocabulary.cpp`, `ATN.cpp`, `LL1Analyzer.cpp`, `LL1Analyzer.h`, `LexerATNSimulator.cpp`, `LexerATNSimulator.h`, `IntervalSet.cpp`, `Any.h`, and `CPPUtils.cpp`. utf8cpp is not modified. -- Resolution: `SYSTEM` accepts ANTLR4 4.9.3 or newer and earlier than 5.0.0 +- Resolution: `SYSTEM` accepts ANTLR4 4.9.3 or newer and earlier than 4.13.0 through an `antlr4_static` or `antlr4_shared` target; `BUNDLED` downloads or reuses both verified archives; and `AUTO` prefers a compatible system package before falling back to the verified archives.