Skip to content

fix(docker): add openshell-prover to Dockerfile skeleton stages and provide z3#800

Open
johntmyers wants to merge 8 commits intomainfrom
fix/docker-add-openshell-prover-skeleton
Open

fix(docker): add openshell-prover to Dockerfile skeleton stages and provide z3#800
johntmyers wants to merge 8 commits intomainfrom
fix/docker-add-openshell-prover-skeleton

Conversation

@johntmyers
Copy link
Copy Markdown
Collaborator

Summary

The openshell-prover crate was added in #741 as a dependency of openshell-cli but the Docker build infrastructure was not updated, breaking all Docker builds that resolve the workspace.

Related Issue

Regression from #741.

Changes

  • Add openshell-prover Cargo.toml, mkdir, and stub lib.rs to the skeleton stages of all affected Dockerfiles (Dockerfile.images, Dockerfile.python-wheels, Dockerfile.python-wheels-macos, Dockerfile.cli-macos)
  • Backfill missing openshell-policy and openshell-tui skeleton entries in the python-wheels Dockerfiles (also path deps of openshell-cli)
  • Add libz3-dev to Dockerfile.python-wheels for native Linux z3 linking
  • Add cmake to Dockerfile.python-wheels-macos and enable --features bundled-z3 on both macOS cross-compile Dockerfiles to compile z3 from source (system libz3-dev only provides a Linux .so, not a macOS .dylib)
  • Add bundled-z3 forwarding feature to openshell-cli so both cargo build and maturin build can activate it uniformly

Testing

Checklist

  • Follows Conventional Commits
  • Commits are signed off (DCO)
  • Architecture docs updated (if applicable)

The openshell-prover crate was added as a dependency of openshell-cli
in #741 but the Docker build infrastructure was not updated. Cargo
workspace resolution requires every crate manifest to be present even
when only building a subset of packages.

Add openshell-prover Cargo.toml, mkdir, and stub lib.rs to the skeleton
stages of all affected Dockerfiles. Also add the previously missing
openshell-policy and openshell-tui entries to the python-wheels
Dockerfiles where they were absent.
The openshell-prover crate depends on z3. For Linux-targeted builds
(python-wheels), install libz3-dev to link against the system library.
For macOS cross-compilation (python-wheels-macos, cli-macos), compile
z3 from source via the bundled-z3 feature since system libz3-dev only
provides a Linux .so, not a macOS .dylib.

Add a bundled-z3 forwarding feature to openshell-cli so both cargo and
maturin can activate it uniformly.
@johntmyers johntmyers requested a review from a team as a code owner April 10, 2026 14:29
@johntmyers johntmyers self-assigned this Apr 10, 2026
@copy-pr-bot
Copy link
Copy Markdown

copy-pr-bot bot commented Apr 10, 2026

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

…ndgen

Switch all CLI builds to bundled-z3 (compile z3 from source) instead
of relying on system libz3-dev. This is required because:
- Linux musl CLI builds cannot link against glibc libz3.so
- macOS cross-compilation has no system z3 available
- Distributable Python wheels should not depend on runtime libz3

Add libclang-dev to all CLI Dockerfiles since z3-sys uses bindgen
which requires libclang at compile time.

Add openshell-prover to the sed workspace scope in both release
workflows so Cargo can resolve the path dependency from openshell-cli.
@github-actions
Copy link
Copy Markdown

…compiler

musl-tools only provides musl-gcc (C compiler wrapper), not musl-g++.
The z3 bundled cmake build needs a C++ compiler to compile z3 from
source. Use the system g++ since z3 exposes a C-linkage API and
libstdc++ is statically linked in the final musl binary.
Using system g++ directly produces object files with glibc symbols
like __printf_chk that don't exist in musl. Instead, create a musl-g++
wrapper that mirrors musl-gcc: it invokes g++ with the musl-gcc.specs
file, which redirects include and library paths to musl. This ensures
z3 compiles against musl headers and avoids glibc symbol references.
The musl-gcc.specs approach strips all system include paths via
-nostdinc, which removes C++ standard library headers and breaks
std::atomic detection in z3's cmake build.

Simpler approach: the only glibc-specific symbols z3 was pulling in
were __printf_chk and similar __*_chk functions generated by
_FORTIFY_SOURCE hardening.  Disabling _FORTIFY_SOURCE makes g++ emit
standard printf/memcpy/etc. calls that musl provides, while keeping
all C++ headers intact.
pimlock
pimlock previously approved these changes Apr 10, 2026
In Alpine, Rust build scripts are compiled for the musl host target which
defaults to static linking. Static musl binaries cannot dlopen, causing
bindgen to fail when loading libclang.so for z3 FFI generation.

Set CARGO_HOST_RUSTFLAGS="-C target-feature=-crt-static" so build scripts
are dynamically linked (can dlopen) while the target CLI binary stays static.
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.

3 participants