fix(lazy-deps): set CMAKE_POLICY_VERSION_MINIMUM=3.5 for native builds - #39816
Open
MwC-Trexx wants to merge 1 commit into
Open
fix(lazy-deps): set CMAKE_POLICY_VERSION_MINIMUM=3.5 for native builds#39816MwC-Trexx wants to merge 1 commit into
MwC-Trexx wants to merge 1 commit into
Conversation
cmake 4.x dropped support for cmake_minimum_required(VERSION < 3.5).
python-olm 3.2.16 bundles libolm with a CMakeLists.txt that declares
VERSION 3.4, so any feature install that pulls in python-olm (currently
mautrix[encryption] for platform.matrix) fails to configure on macOS 26
with cmake 4.3.x:
CMake Error at CMakeLists.txt:1 (cmake_minimum_required):
Compatibility with CMake < 3.5 has been removed from CMake.
CMAKE_POLICY_VERSION_MINIMUM=3.5 tells cmake 4.x to treat the project
as though it declared 3.5, which unblocks the configure step.
Complements NousResearch#31354 (C++ const-pointer patch): that PR fixes the compile
error; this one fixes the configure error that would prevent cmake from
even getting there on cmake 4.x.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 task
teknium1
reviewed
Jul 14, 2026
teknium1
left a comment
Contributor
There was a problem hiding this comment.
Thanks for isolating the CMake policy issue. The current lazy-install path has moved since this branch.
Problems
- The change only adds the variable to
uv_env(tools/lazy_deps.py:359in this PR). On current main, if uv is absent or returns nonzero, the fallback attools/lazy_deps.py:702runspython -m pip installwithoutenv=, so it can still reach the same native build withoutCMAKE_POLICY_VERSION_MINIMUM. - Current main replaced the base branch's
os.environcopy withhermes_subprocess_env(inherit_credentials=False)attools/lazy_deps.py:659-661in9c6229ce; salvage should preserve that credential-safe environment.
Suggested changes
- Add the policy variable to the current sanitized environment and pass it to both uv and pip install subprocesses.
- Add tests that assert both installer tiers receive the variable.
Automated hermes-sweeper review.
|
|
||
| venv_root = Path(sys.executable).parent.parent | ||
| uv_env = {**os.environ, "VIRTUAL_ENV": str(venv_root)} | ||
| # cmake 4.x removed compatibility with cmake_minimum_required < 3.5. |
Contributor
There was a problem hiding this comment.
Please carry this explicit environment into the python -m pip install fallback as well. Current main's fallback runs without env= at tools/lazy_deps.py:702, so an unavailable or failed uv binary would still invoke CMake without this policy setting.
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.
Problem
On macOS 26 with cmake 4.x,
ensure("platform.matrix")fails at the cmake configure step before it even gets to compile:cmake 4.x dropped support for
cmake_minimum_required(VERSION < 3.5).python-olm 3.2.16bundles libolm source withCMakeLists.txtdeclaringVERSION 3.4.Fix
Set
CMAKE_POLICY_VERSION_MINIMUM=3.5in the build environment passed to uv/pip. cmake 4.x reads this env var and treats the project as though it declared the minimum as 3.5. One env key, no source patching, no platform gating.Relationship to #31354
#31354 fixes the C++ const-pointer compile error in
list.hh. This fixes the cmake configure error that fires before compilation starts. On macOS 26 / cmake 4.3.x, both are needed. Without this change, #31354's patched source build still aborts at the configure step.Note: the subprocess in
_python_olm_macos_install(added by #31354) doesn't pass an explicitenv=, so it'll also need this fix when that PR merges — either inherit it from the calling process or passenv={**os.environ, "CMAKE_POLICY_VERSION_MINIMUM": "3.5"}directly.Testing