Daily Backlog Burner: Fix bad .dylib versioning in pip packages#7914
Merged
NikolajBjorner merged 2 commits intomasterfrom Sep 18, 2025
Merged
Daily Backlog Burner: Fix bad .dylib versioning in pip packages#7914NikolajBjorner merged 2 commits intomasterfrom
NikolajBjorner merged 2 commits intomasterfrom
Conversation
This commit addresses issue #6651 by adding macOS-specific CMake configuration to ensure proper .dylib versioning in pip packages. Problem: - .dylib files distributed in pip packages showed version 0.0.0 instead of the actual Z3 version when inspected with otool -L on macOS - This created compatibility issues and made it difficult to manage library dependencies Solution: - Added macOS-specific CMake properties to the libz3 target - Set INSTALL_NAME_DIR to '@rpath' for better library relocatability - Enabled MACOSX_RPATH to ensure proper RPATH handling - Existing VERSION and SOVERSION properties handle compatibility/current version automatically The fix ensures that macOS .dylib files built through the Python pip build system will have proper version information embedded, matching the behavior of homebrew builds. Closes #6651 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
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
This PR fixes issue #6651 by adding macOS-specific CMake configuration to ensure proper
.dylibversioning in pip packages.Problem Statement
When installing Z3 via pip on macOS, the distributed
.dylibfiles show incorrect version information:This should display the correct version information like the homebrew build:
Root Cause
The Python pip build system uses CMake to build the library, but lacks macOS-specific CMake configuration to ensure proper
.dylibversion embedding. While theVERSIONandSOVERSIONproperties are correctly set in CMake, additional macOS-specific properties are needed for proper library versioning.Solution
Added macOS-specific CMake configuration to
src/CMakeLists.txt:Technical Details
INSTALL_NAME_DIR "@rpath": Sets the install name to use@rpath, making the library relocatable and following modern macOS library practicesMACOSX_RPATH TRUE: Enables RPATH support for proper library loadingVERSION/SOVERSIONproperties: CMake automatically translates these to-compatibility_versionand-current_versionlinker flags on macOSTesting
Impact
This fix ensures that:
.dylibfiles from pip packages will have proper version informationRelated Issues
Closes #6651: "Bad.dylibversioning inpippackage"Maintainer Notes
This fix addresses the "help wanted" build system improvement identified in the backlog analysis. The solution is conservative and only applies to macOS builds, ensuring no impact on other platforms while resolving the specific pip package versioning issue.
> AI-generated content by Daily Backlog Burner may contain mistakes.