Skip to content

[BUILD] Migrate the Z3 dependency to mlc-z3-static - #20084

Open
Ubospica wants to merge 2 commits into
apache:mainfrom
Ubospica:2026-08-02-mlc-z3-static
Open

[BUILD] Migrate the Z3 dependency to mlc-z3-static#20084
Ubospica wants to merge 2 commits into
apache:mainfrom
Ubospica:2026-08-02-mlc-z3-static

Conversation

@Ubospica

@Ubospica Ubospica commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Summary

mlc-ai/package#110 folded the z3-static wheel into mlc-z3-static (import module mlc_z3_static; versions restart at 4.16.0 without the .post1 suffix). This PR points TVM's Z3 toolchain references at the new package:

  • cmake/modules/contrib/Z3.cmake probes mlc_z3_static.config first and keeps the legacy z3_static.config probe as a fallback, so existing environments and the current CI images keep working during the transition.
  • The pyproject.toml build requirement becomes mlc-z3-static>=4.16.0.
  • The CI docker image installs mlc-z3-static==4.16.0.

Note: mlc-z3-static is not on PyPI yet. This PR should land only after the wheel is published; the CMake fallback keeps current CI images working, but docker image rebuilds and pyproject.toml-based wheel builds need the package on PyPI.

Verification

Since the wheel is not yet on PyPI, it was built locally from mlc-ai/package main (254413e, the #110 merge commit) and its bundled smoke test passed (static and shared consumers compile, link, and solve).

  • With both mlc_z3_static and legacy z3_static installed, USE_Z3=ON auto-detection links mlc_z3_static/static/lib/libz3.a (new package preferred).
  • With only the legacy z3-static package installed, the fallback probe still finds it.
  • Full build against the new package: Z3 statically linked into libtvm_compiler.so, no runtime libz3 dependency (ldd).
  • tests/python/arith/test_arith_z3.py: 52 passed.
  • Full tests/python/arith/ suite on the same toolchain: 1034 passed, 2 skipped, 26 xfailed.
  • bash -n on the docker install script passes.

mlc-ai/package#110 folded the z3-static wheel into mlc-z3-static
(import module mlc_z3_static, versions restart at 4.16.0 without the
.post1 suffix). Point the Z3 toolchain references at the new package:

- cmake/modules/contrib/Z3.cmake probes mlc_z3_static.config first and
  keeps the legacy z3_static.config probe as a fallback so existing
  environments and CI images keep working during the transition.
- The pyproject.toml build requirement becomes mlc-z3-static>=4.16.0.
- The CI docker image installs mlc-z3-static==4.16.0.

mlc-z3-static must be published to PyPI before the CI docker images are
rebuilt or wheels are built from this revision.
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

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.

1 participant