Skip to content

Add z3-static publishing and enable static Z3 wheel builds#103

Merged
tqchen merged 4 commits into
mainfrom
z3-static-link
Jun 11, 2026
Merged

Add z3-static publishing and enable static Z3 wheel builds#103
tqchen merged 4 commits into
mainfrom
z3-static-link

Conversation

@Ubospica

@Ubospica Ubospica commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add packages/z3-static, a scikit-build-core Python package that builds upstream Z3 into py3-none-<platform> wheels containing headers, CMake package files, and a PIC static library. Z3 source is downloaded by the builder script from the requested upstream tag and is not checked into this repository.
  • Add a manual Publish Z3 static wheels workflow for Linux x86_64/aarch64, macOS arm64/x86_64, Windows AMD64, and sdist artifacts, with optional PyPI trusted publishing under the MLC AI account.
  • Align manylinux TVM/MLC-LLM package builds on gcc-toolset-13, matching the planned z3-static Linux toolchain, and raise macOS deployment targets to 14.0 before consuming static Z3 artifacts.
  • Enable USE_Z3 in the TVM manylinux wheel build so TVM can statically link Z3 once the z3-static wheels are published.

Verification

  • Built the z3-static sdist locally with scikit-build-core without triggering a Z3 source build.
  • Verified a wheel build without STATICLIB_Z3_ALLOW_SOURCE_BUILD=1 fails fast instead of compiling Z3 implicitly.
  • Ran Python syntax checks for z3_static/__init__.py, z3_static/_version.py, and the helper scripts.
  • Parsed the new workflow/action YAML locally.

TVM resolves Z3 from the PyPI z3-staticlib package (PIC static libz3 +
headers) declared as a build-system requirement in its pyproject.toml,
so USE_Z3=ON links Z3 statically and the wheel gains no shared libz3
dependency. No auditwheel changes are needed.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the scripts/build_mlc_ai_wheel_manylinux.sh script to enable Z3 in the CMake configuration (USE_Z3 ON), noting that Z3 is linked statically from the z3-staticlib build requirement. There are no review comments to address, and I have no additional feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Add a packages/z3-staticlib subproject that builds upstream Z3 into py3-none
platform wheels containing headers, CMake package files, and a PIC static
library. Also align manylinux TVM/MLC-LLM builds on gcc-toolset-13 and raise
macOS deployment targets to 14.0 so the static Z3 artifacts are consumed with a
compatible toolchain.
@Ubospica Ubospica changed the title Enable statically linked Z3 in manylinux wheel builds Add z3-staticlib publishing and enable static Z3 wheel builds Jun 11, 2026
Ubospica added 2 commits June 11, 2026 12:31
Use the workflow-provided STATICLIB_Z3_TAG as the Python distribution version
so future Z3 static wheel releases keep package metadata aligned with the
upstream Z3 artifact version.
Replace the setuptools setup.py subclass with a scikit-build-core/CMake build
that stages the static Z3 artifacts through the existing builder script. Remove
the copy_wheel helper in favor of cibuildwheel's direct no-op copy command, and
stamp the dynamic package version from the selected upstream Z3 tag.
@tqchen tqchen merged commit 35fe896 into main Jun 11, 2026
3 of 10 checks passed
@Ubospica Ubospica changed the title Add z3-staticlib publishing and enable static Z3 wheel builds Add z3-static publishing and enable static Z3 wheel builds Jun 11, 2026
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.

2 participants