feat: Move Z3 cmake build to its own crate#510
Draft
toolCHAINZ wants to merge 25 commits intomasterfrom
Draft
Conversation
versions now (which we already soft-required anyway)
Open
Add large autogenerated FFI bindings (functions.rs), plus enums.rs and types.rs. Integrate an optional "bindgen" feature with its dependencies to allow regenerating bindings from local Z3 headers. Remove the scripts/bindgen-transform crate and move the transform binary into z3-sys/build_transform.rs. Update build scripts and source to use the new generated files and to use enum/type conversions where appropriate.
Generate separate enums.rs and functions.rs from bindgen; build.rs now runs two bindgen passes, transforms and writes both files. Blocklist functions that need nullable/Option signatures and provide hand-written declarations in src/functions_patched.rs. Use conditional include! to pick pre-generated enums or the bindgen output when the bindgen feature is enabled. Update scripts and docs accordingly.
Delete z3-sys/src/generated/mod.rs and remove mod generated from lib.rs. Update types import to use crate::Z3_error_code and reformat C function signatures in generated/functions.rs to multi-line style.
Delete z3-sys/scripts/generate_enums.sh. Rename SymbolKind variants in z3-sys/src/generated/enums.rs: Symbol -> IntSymbol StringSymbol -> Symbol
Rename SymbolKind variants: IntSymbol -> Int, Symbol -> String Make compute_strip_component require a strict majority (>50%) Use variants.len()/2 + 1 instead of ceil(n/2)
This was referenced Mar 6, 2026
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.
z3-src, inspired byopenssl-src, which wraps the cmake build ofz3.bundledto use this crate instead of downloading from github.generatedbindgen bindings to the repo, since we can just makez3-srcandz3-sysreleases compatible with whichever z3. versions.