Skip to content

Commit e21b7fd

Browse files
authored
chore(build): remove bundled Z3 support (#3275)
* chore(build): remove bundled Z3 support Signed-off-by: Simon Scatton <sscatton@nvidia.com> Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com> * fix(build): preserve vendored Z3 for local gateway artifacts Signed-off-by: Simon Scatton <sscatton@nvidia.com> --------- Signed-off-by: Simon Scatton <sscatton@nvidia.com> Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com>
1 parent 021400b commit e21b7fd

17 files changed

Lines changed: 27 additions & 412 deletions

File tree

‎.agents/skills/build-openshell-mxc-windows/SKILL.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ MXC on Windows. Each other `compute-driver-*` feature installs its own Windows
265265
rejection stub without linking that driver crate. The default
266266
`in-tree-compute-drivers` alias enables all five features. An MXC-only build
267267
uses `--no-default-features --features compute-driver-mxc` (add `telemetry`
268-
and `bundled-z3` as needed).
268+
and `openshell-server/prebuilt-z3` as needed).
269269

270270
| Driver | Windows build behavior | Runtime behavior |
271271
|---|---|---|

‎CONTRIBUTING.md‎

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -309,17 +309,17 @@ Project requirements:
309309
- Rust 1.94+
310310
- Python 3.11+
311311
- Docker (running)
312-
- CMake 3.16+ (only required when building with the `bundled-z3` feature)
313312

314313
### Z3 installation
315314

316315
The `openshell-prover` crate and standalone `openshell-prover-cli` binary link
317316
directly against Z3. The `openshell-server` crate depends on the prover, and
318317
the `openshell-gateway` binary crate depends on `openshell-server` in turn.
319-
These packages forward a `bundled-z3` feature to
320-
`openshell-prover/bundled-z3`. The `openshell-cli` crate does not depend on Z3.
321-
On macOS and Linux, install the system Z3 development package; `z3-sys`
322-
discovers it through `pkg-config`.
318+
The `openshell-cli` crate does not depend on Z3. The Nix development shell
319+
supplies Z3. For builds outside that shell on macOS and Linux, install the
320+
system Z3 development package; `z3-sys` discovers it through `pkg-config`.
321+
The linker uses the installed static or shared library. The Nix development
322+
shell provides a static Z3 library.
323323

324324
```bash
325325
# macOS
@@ -332,14 +332,17 @@ sudo apt install libz3-dev
332332
sudo dnf install z3-devel
333333
```
334334

335-
If you prefer not to install Z3 system-wide, use the bundled Z3 feature. This
336-
compiles Z3 from source during the Rust build and requires CMake 3.16+:
335+
To build Z3 from source instead, enable `vendored-z3` (requires CMake and a C++
336+
compiler):
337337

338338
```bash
339-
cargo build -p openshell-prover --features bundled-z3
340-
cargo build -p openshell-prover-cli --features bundled-z3
339+
cargo build -p openshell-prover --features vendored-z3
340+
cargo build -p openshell-prover-cli --features vendored-z3
341341
```
342342

343+
Local gateway image and E2E builds enable `vendored-z3` so their
344+
copied gateway binaries do not need a shared Z3 library in the runtime image.
345+
343346
For x86-64 and ARM64 Windows MSVC builds, use one of these Z3 paths:
344347

345348
- Prebuilt Z3 (the default for `windows:*` tasks): `z3-sys` downloads the
@@ -353,14 +356,12 @@ For x86-64 and ARM64 Windows MSVC builds, use one of these Z3 paths:
353356
target-compatible MSVC Z3 library and `Z3_SYS_Z3_HEADER` at the full path to `z3.h`.
354357
The `windows:*` tasks use this path automatically when `Z3_LIBRARY_PATH_OVERRIDE`
355358
is set.
356-
- Bundled Z3: for direct Cargo builds, pass `--features bundled-z3` so `z3-sys`
357-
builds Z3 from source.
358359

359360
`openshell-prover` itself has no `bindgen`/`libclang` dependency, so building
360361
just this crate does not require `LIBCLANG_PATH`:
361362

362363
```powershell
363-
cargo build -p openshell-prover --target x86_64-pc-windows-msvc --features bundled-z3
364+
cargo build -p openshell-prover --target x86_64-pc-windows-msvc --features prebuilt-z3
364365
```
365366

366367
### Windows full build

‎Cargo.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ k8s-openapi = { version = "0.24", features = ["v1_29"] }
143143
uuid = { version = "1.10", features = ["v4"] }
144144
signal-hook = "0.3"
145145

146-
# SMT solver (uses system libz3; enable z3/bundled via the prover's bundled-z3 feature for local dev without system z3)
146+
# SMT solver (system libz3 by default; opt into vendored source or a prebuilt release)
147147
z3 = "0.21"
148148

149149
[workspace.lints.rust]

‎crates/openshell-gateway/Cargo.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ telemetry = ["openshell-core/telemetry", "openshell-server/telemetry"]
7373
## telemetry-on build. Kept in sync with `default` by
7474
## `rust:verify:defaults-without-telemetry`.
7575
defaults-without-telemetry = ["in-tree-compute-drivers"]
76-
bundled-z3 = ["openshell-server/bundled-z3"]
76+
vendored-z3 = ["openshell-server/vendored-z3"]
7777

7878
[lints]
7979
workspace = true

‎crates/openshell-prover-cli/Cargo.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ name = "openshell-prover"
1515
path = "src/main.rs"
1616

1717
[features]
18-
bundled-z3 = ["openshell-prover/bundled-z3"]
18+
vendored-z3 = ["openshell-prover/vendored-z3"]
1919
prebuilt-z3 = ["openshell-prover/prebuilt-z3"]
2020

2121
[dependencies]

‎crates/openshell-prover/Cargo.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ license.workspace = true
1111
repository.workspace = true
1212

1313
[features]
14-
bundled-z3 = ["z3/bundled"]
14+
vendored-z3 = ["z3/vendored"]
1515
prebuilt-z3 = ["z3/gh-release"]
1616

1717
[dependencies]

‎crates/openshell-server/Cargo.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ default = ["telemetry"]
120120
## On by default; build with `--no-default-features` for a telemetry-free gateway
121121
## that contains no telemetry endpoint, HTTP client, or emission code.
122122
telemetry = ["openshell-core/telemetry"]
123-
bundled-z3 = ["openshell-prover/bundled-z3"]
123+
vendored-z3 = ["openshell-prover/vendored-z3"]
124124
prebuilt-z3 = ["openshell-prover/prebuilt-z3"]
125125
test-support = []
126126

‎deploy/docker/Dockerfile.cli-macos‎

Lines changed: 0 additions & 131 deletions
This file was deleted.

‎deploy/docker/Dockerfile.driver-vm-macos‎

Lines changed: 0 additions & 119 deletions
This file was deleted.

0 commit comments

Comments
 (0)