Skip to content

feat: Move Z3 cmake build to its own crate#510

Draft
toolCHAINZ wants to merge 25 commits intomasterfrom
z3-src-crate
Draft

feat: Move Z3 cmake build to its own crate#510
toolCHAINZ wants to merge 25 commits intomasterfrom
z3-src-crate

Conversation

@toolCHAINZ
Copy link
Member

  • Create z3-src, inspired by openssl-src, which wraps the cmake build of z3.
  • Retarget bundled to use this crate instead of downloading from github.
  • Commit the generated bindgen bindings to the repo, since we can just make z3-src and z3-sys releases compatible with whichever z3. versions.

@toolCHAINZ toolCHAINZ marked this pull request as draft March 3, 2026 00:10
@toolCHAINZ toolCHAINZ mentioned this pull request Mar 3, 2026
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)
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