Skip to content

Commit 8563402

Browse files
SDAChesspimlock
authored andcommitted
chore(build): remove bundled Z3 support
Signed-off-by: Simon Scatton <sscatton@nvidia.com> Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com>
1 parent 12ef86c commit 8563402

19 files changed

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

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

‎CONTRIBUTING.md‎

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -309,17 +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 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`.
323321

324322
```bash
325323
# macOS
@@ -332,14 +330,6 @@ sudo apt install libz3-dev
332330
sudo dnf install z3-devel
333331
```
334332

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+:
337-
338-
```bash
339-
cargo build -p openshell-prover --features bundled-z3
340-
cargo build -p openshell-prover-cli --features bundled-z3
341-
```
342-
343333
For x86-64 and ARM64 Windows MSVC builds, use one of these Z3 paths:
344334

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

359347
`openshell-prover` itself has no `bindgen`/`libclang` dependency, so building
360348
just this crate does not require `LIBCLANG_PATH`:
361349

362350
```powershell
363-
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
364352
```
365353

366354
### 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
@@ -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 (uses system libz3; Windows build tasks enable the prebuilt release feature)
147147
z3 = "0.21"
148148

149149
[workspace.lints.rust]

‎architecture/build.md‎

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

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

8484
Release workflows build the standalone `openshell-prover` executable for Linux
8585
musl x86_64 and aarch64 and macOS Apple Silicon. The standard Debian, RPM, and
@@ -96,9 +96,9 @@ The standalone `openshell` CLI is built as a static musl binary so it can run on
9696
a wide range of Linux distributions without depending on the host's glibc. Host
9797
runtime binaries that use the GNU/Linux runtime environment are GNU-linked.
9898
`openshell-gateway` and `openshell-driver-vm` are built with a glibc 2.28 floor.
99-
The gateway bundles z3 into the release binary so Linux packages, standalone
100-
tarballs, and gateway images do not depend on distro-specific z3 shared-library
101-
SONAMEs.
99+
The gateway statically links the target-specific Z3 library supplied by the Nix
100+
toolchain so Linux packages, standalone tarballs, and gateway images do not
101+
depend on distro-specific Z3 shared-library SONAMEs.
102102

103103
The workload-side `openshell-sandbox` binary is statically linked with musl so
104104
drivers can stage it into an arbitrary agent image without depending on that
@@ -128,12 +128,12 @@ otherwise fail with `ProcessFdQuotaExceeded` under macOS's default soft limit of
128128
256. The guard is a no-op on Linux and when `cargo-zigbuild` is absent. Gateway
129129
binaries use `cargo zigbuild` with GNU targets pinned to glibc 2.28, including
130130
native-architecture builds, so the gateway image, standalone tarballs, and Linux
131-
packages share the same host portability floor. The gateway build enables
132-
`bundled-z3`. Linux VM driver release artifacts use the same glibc floor so
133-
package-managed VM support does not raise the package runtime requirement.
134-
Gateway staging and release workflows set up the Zig C/C++ wrapper before
135-
bundled Z3 builds and verify the maximum referenced `GLIBC_*` symbol version
136-
before publishing or copying artifacts.
131+
packages share the same host portability floor. The gateway links the
132+
target-specific static Z3 library from the Nix toolchain. Linux VM driver
133+
release artifacts use the same glibc floor so package-managed VM support does
134+
not raise the package runtime requirement. Gateway staging and release
135+
workflows verify the maximum referenced `GLIBC_*` symbol version before
136+
publishing or copying artifacts.
137137
Supervisor staging uses the GNU build path and verifies the glibc 2.28 floor.
138138
Sandbox staging uses the static musl build path. Local Docker image tasks infer the
139139
target architecture from `DOCKER_PLATFORM` when set. Otherwise, they require
@@ -184,8 +184,8 @@ Runtime layout:
184184
- **Gateway**: `gcr.io/distroless/cc-debian13:nonroot` base, GNU-linked binary at
185185
`/usr/local/bin/openshell-gateway`, runs as UID/GID `1000:1000`. Linux GNU
186186
gateway binaries must not reference `GLIBC_*` symbols newer than
187-
`GLIBC_2.28`; release workflows verify this before publishing artifacts. The
188-
gateway bundles z3, so the image does not need a distro-provided z3 runtime.
187+
`GLIBC_2.28`; release workflows verify this before publishing artifacts. Z3
188+
is statically linked, so the image does not need a distro-provided Z3 runtime.
189189
The base is pinned to a multi-architecture digest; distro security updates
190190
require refreshing that digest and rebuilding the gateway image.
191191
Updating the container's glibc package does not raise the binary's glibc

‎crates/openshell-gateway/Cargo.toml‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ 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"]
7776

7877
[lints]
7978
workspace = true

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

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

1717
[features]
18-
bundled-z3 = ["openshell-prover/bundled-z3"]
1918
prebuilt-z3 = ["openshell-prover/prebuilt-z3"]
2019

2120
[dependencies]

‎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
@@ -120,7 +120,6 @@ 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"]
124123
prebuilt-z3 = ["openshell-prover/prebuilt-z3"]
125124
test-support = []
126125

‎deploy/docker/Dockerfile.cli-macos‎

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

0 commit comments

Comments
 (0)