Skip to content

Commit b072cf9

Browse files
SDAChesselezar
authored andcommitted
chore(build): remove bundled Z3 support
Signed-off-by: Simon Scatton <sscatton@nvidia.com>
1 parent 5b9daab commit b072cf9

19 files changed

Lines changed: 29 additions & 441 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
@@ -260,7 +260,7 @@ MXC on Windows. Each other `compute-driver-*` feature installs its own Windows
260260
rejection stub without linking that driver crate. The default
261261
`in-tree-compute-drivers` alias enables all five features. An MXC-only build
262262
uses `--no-default-features --features compute-driver-mxc` (add `telemetry`
263-
and `bundled-z3` as needed).
263+
and `openshell-server/prebuilt-z3` as needed).
264264

265265
| Driver | Windows build behavior | Runtime behavior |
266266
|---|---|---|

‎CONTRIBUTING.md‎

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -309,16 +309,15 @@ 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 links directly against Z3. The `openshell-server`
317316
crate depends on the prover, and the `openshell-gateway` binary crate depends
318-
on `openshell-server` in turn; both forward a `bundled-z3` feature down to
319-
`openshell-prover/bundled-z3`. The `openshell-cli` crate does not depend on
320-
Z3. On macOS and Linux, install the system Z3 development package; `z3-sys`
321-
discovers it through `pkg-config`.
317+
on `openshell-server` in turn. The `openshell-cli` crate does not depend on Z3.
318+
The Nix development shell supplies Z3. For builds outside that shell on macOS
319+
and Linux, install the system Z3 development package; `z3-sys` discovers it
320+
through `pkg-config`.
322321

323322
```bash
324323
# macOS
@@ -331,13 +330,6 @@ sudo apt install libz3-dev
331330
sudo dnf install z3-devel
332331
```
333332

334-
If you prefer not to install Z3 system-wide, use the bundled Z3 feature. This
335-
compiles Z3 from source during the Rust build and requires CMake 3.16+:
336-
337-
```bash
338-
cargo build -p openshell-prover --features bundled-z3
339-
```
340-
341333
For x86-64 and ARM64 Windows MSVC builds, use one of these Z3 paths:
342334

343335
- Prebuilt Z3 (the default for `windows:*` tasks): `z3-sys` downloads the
@@ -351,14 +343,12 @@ For x86-64 and ARM64 Windows MSVC builds, use one of these Z3 paths:
351343
target-compatible MSVC Z3 library and `Z3_SYS_Z3_HEADER` at the full path to `z3.h`.
352344
The `windows:*` tasks use this path automatically when `Z3_LIBRARY_PATH_OVERRIDE`
353345
is set.
354-
- Bundled Z3: for direct Cargo builds, pass `--features bundled-z3` so `z3-sys`
355-
builds Z3 from source.
356346

357347
`openshell-prover` itself has no `bindgen`/`libclang` dependency, so building
358348
just this crate does not require `LIBCLANG_PATH`:
359349

360350
```powershell
361-
cargo build -p openshell-prover --target x86_64-pc-windows-msvc --features bundled-z3
351+
cargo build -p openshell-prover --target x86_64-pc-windows-msvc --features prebuilt-z3
362352
```
363353

364354
### Windows full build

‎Cargo.lock‎

Lines changed: 0 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Cargo.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ k8s-openapi = { version = "0.24", features = ["v1_29"] }
139139
# IDs
140140
uuid = { version = "1.10", features = ["v4"] }
141141

142-
# SMT solver (uses system libz3; enable z3/bundled via the prover's bundled-z3 feature for local dev without system z3)
142+
# SMT solver (uses system libz3; Windows build tasks enable the prebuilt release feature)
143143
z3 = "0.20"
144144

145145
[workspace.lints.rust]

‎README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,8 +283,8 @@ cargo build --release -p openshell-gateway --no-default-features --features tele
283283
# Docker and VM only, with telemetry compiled out.
284284
cargo build --release -p openshell-gateway --no-default-features --features compute-driver-docker,compute-driver-vm
285285

286-
# Windows MXC only, with telemetry support and bundled Z3.
287-
cargo build --release -p openshell-gateway --no-default-features --features telemetry,compute-driver-mxc,bundled-z3
286+
# Windows MXC only, with telemetry support and prebuilt Z3.
287+
cargo build --release -p openshell-gateway --no-default-features --features telemetry,compute-driver-mxc,openshell-server/prebuilt-z3
288288
```
289289

290290
Regular builds retain their platform driver set through the default `in-tree-compute-drivers` compatibility feature. On Windows, `compute-driver-mxc` selects MXC; the other four features install unsupported-driver stubs. On other platforms, MXC is excluded.

‎architecture/build.md‎

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ already satisfies Linux distribution trust-store policy.
8282

8383
The workspace uses `z3` versions whose `z3-sys` dependency keeps downloader
8484
HTTP/TLS support behind explicit build features, so default system-Z3 builds do
85-
not reintroduce bundled Mozilla roots. Release builds that need bundled Z3
86-
continue to opt in with `bundled-z3`.
85+
not reintroduce bundled Mozilla roots. Windows builds can explicitly select the
86+
prebuilt Z3 release path.
8787

8888
## Linux Runtime Environments
8989

@@ -92,9 +92,9 @@ The standalone `openshell` CLI is built as a static musl binary so it can run on
9292
a wide range of Linux distributions without depending on the host's glibc. Host
9393
runtime binaries that use the GNU/Linux runtime environment are GNU-linked.
9494
`openshell-gateway` and `openshell-driver-vm` are built with a glibc 2.28 floor.
95-
The gateway bundles z3 into the release binary so Linux packages, standalone
96-
tarballs, and gateway images do not depend on distro-specific z3 shared-library
97-
SONAMEs.
95+
The gateway statically links the target-specific Z3 library supplied by the Nix
96+
toolchain so Linux packages, standalone tarballs, and gateway images do not
97+
depend on distro-specific Z3 shared-library SONAMEs.
9898

9999
The supervisor is the one binary whose libc is selectable, because it is the one
100100
binary executed inside a userland OpenShell does not control. `SUPERVISOR_LIBC`
@@ -138,12 +138,12 @@ otherwise fail with `ProcessFdQuotaExceeded` under macOS's default soft limit of
138138
256. The guard is a no-op on Linux and when `cargo-zigbuild` is absent. Gateway
139139
binaries use `cargo zigbuild` with GNU targets pinned to glibc 2.28, including
140140
native-architecture builds, so the gateway image, standalone tarballs, and Linux
141-
packages share the same host portability floor. The gateway build enables
142-
`bundled-z3`. Linux VM driver release artifacts use the same glibc floor so
143-
package-managed VM support does not raise the package runtime requirement.
144-
Gateway staging and release workflows set up the Zig C/C++ wrapper before
145-
bundled Z3 builds and verify the maximum referenced `GLIBC_*` symbol version
146-
before publishing or copying artifacts.
141+
packages share the same host portability floor. The gateway build links the
142+
target-specific static Z3 library from the Nix toolchain. Linux VM driver
143+
release artifacts use the same glibc floor so package-managed VM support does
144+
not raise the package runtime requirement. Gateway staging and release
145+
workflows use the target-specific C/C++ toolchain and verify the maximum
146+
referenced `GLIBC_*` symbol version before publishing or copying artifacts.
147147
Supervisor binaries are static in every configuration. The default `musl`
148148
variant uses `cargo zigbuild` when available, including native CPU
149149
architectures, so C dependencies are compiled for the musl target instead of the
@@ -217,8 +217,8 @@ Runtime layout:
217217
- **Gateway**: `gcr.io/distroless/cc-debian13:nonroot` base, GNU-linked binary at
218218
`/usr/local/bin/openshell-gateway`, runs as UID/GID `1000:1000`. Linux GNU
219219
gateway binaries must not reference `GLIBC_*` symbols newer than
220-
`GLIBC_2.28`; release workflows verify this before publishing artifacts. The
221-
gateway bundles z3, so the image does not need a distro-provided z3 runtime.
220+
`GLIBC_2.28`; release workflows verify this before publishing artifacts. Z3
221+
is statically linked, so the image does not need a distro-provided Z3 runtime.
222222
The base is pinned to a multi-architecture digest; distro security updates
223223
require refreshing that digest and rebuilding the gateway image.
224224
- **VM driver**: host GNU-linked binary installed at

‎crates/openshell-gateway/Cargo.toml‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ telemetry = ["openshell-core/telemetry", "openshell-server/telemetry"]
7272
## telemetry-on build. Kept in sync with `default` by
7373
## `rust:verify:defaults-without-telemetry`.
7474
defaults-without-telemetry = ["in-tree-compute-drivers"]
75-
bundled-z3 = ["openshell-server/bundled-z3"]
7675

7776
[lints]
7877
workspace = true

‎crates/openshell-prover/Cargo.toml‎

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

1313
[features]
14-
bundled-z3 = ["z3/bundled"]
1514
prebuilt-z3 = ["z3/gh-release"]
1615

1716
[dependencies]

‎crates/openshell-server/Cargo.toml‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ default = ["telemetry"]
119119
## On by default; build with `--no-default-features` for a telemetry-free gateway
120120
## that contains no telemetry endpoint, HTTP client, or emission code.
121121
telemetry = ["openshell-core/telemetry"]
122-
bundled-z3 = ["openshell-prover/bundled-z3"]
123122
prebuilt-z3 = ["openshell-prover/prebuilt-z3"]
124123
test-support = []
125124

‎deploy/docker/Dockerfile.cli-macos‎

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

0 commit comments

Comments
 (0)