Skip to content

fix: update antlr4 CMAKE_POLICY from OLD to NEW for CMake 3.31+#145

Open
aashish-thapa wants to merge 1 commit intoalibaba:mainfrom
aashish-thapa:fix/antlr4-cmake-policy-old-removed
Open

fix: update antlr4 CMAKE_POLICY from OLD to NEW for CMake 3.31+#145
aashish-thapa wants to merge 1 commit intoalibaba:mainfrom
aashish-thapa:fix/antlr4-cmake-policy-old-removed

Conversation

@aashish-thapa
Copy link

@aashish-thapa aashish-thapa commented Feb 17, 2026

Summary

  • Update antlr4.patch to change CMAKE_POLICY(SET ... OLD) to NEW for policies CMP0042, CMP0045, CMP0054, and CMP0059
  • CMake 3.31+ has removed support for the OLD behavior of these policies, causing a hard configuration error when building from source

Details

The OLD behavior for these policies has been deprecated since CMake 3.0/3.3 and was fully removed in CMake 3.31. Changing to NEW resolves the build failure without affecting functionality since NEW has been the default behavior for years.

Edit

Note: This fix resolves the CMake 3.31+ configuration error but does not address the separate RocksDB 8.1.1
compilation failure with GCC 15 (see #144 for details). Users on GCC 15 will still need to build with GCC 14 or
earlier (e.g., via the python:3.12 Docker image) until RocksDB is upgraded.

Test plan

  • Verified the build completes successfully using python:3.12 Docker image (GCC 14, CMake 3.31.10)
  • Full compilation of all 1098 targets passes
  • import zvec works correctly after installation

Fixes #144

…tibility

CMake 3.31+ has removed support for the OLD behavior of policies
CMP0042, CMP0045, CMP0054, and CMP0059. This causes a hard
configuration error when building from source with newer CMake versions.

Changing these to NEW resolves the build failure. The NEW behavior has
been the default since CMake 3.0/3.3 and does not affect functionality.

Fixes alibaba#144
@CLAassistant
Copy link

CLAassistant commented Feb 17, 2026

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Build from source fails with GCC 15 and newer CMake

3 participants