Skip to content

Commit 57fffa0

Browse files
committed
fix(docker,ci): use bundled-z3 everywhere and add libclang-dev for bindgen
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.
1 parent 69bf6db commit 57fffa0

File tree

5 files changed

+10
-7
lines changed

5 files changed

+10
-7
lines changed

.github/workflows/release-dev.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ jobs:
211211
# Remove workspace members that are not needed for openshell-cli.
212212
# This avoids Cargo feature-unification pulling in aws-lc-sys (via
213213
# russh in openshell-sandbox / openshell-server).
214-
sed -i 's|members = \["crates/\*"\]|members = ["crates/openshell-cli", "crates/openshell-core", "crates/openshell-bootstrap", "crates/openshell-policy", "crates/openshell-providers", "crates/openshell-tui"]|' Cargo.toml
214+
sed -i 's|members = \["crates/\*"\]|members = ["crates/openshell-cli", "crates/openshell-core", "crates/openshell-bootstrap", "crates/openshell-policy", "crates/openshell-prover", "crates/openshell-providers", "crates/openshell-tui"]|' Cargo.toml
215215
216216
- name: Patch workspace version
217217
if: needs.compute-versions.outputs.cargo_version != ''
@@ -220,7 +220,7 @@ jobs:
220220
sed -i -E '/^\[workspace\.package\]/,/^\[/{s/^version[[:space:]]*=[[:space:]]*".*"/version = "'"${{ needs.compute-versions.outputs.cargo_version }}"'"/}' Cargo.toml
221221
222222
- name: Build ${{ matrix.target }}
223-
run: mise x -- cargo build --release --target ${{ matrix.target }} -p openshell-cli
223+
run: mise x -- cargo build --release --target ${{ matrix.target }} -p openshell-cli --features bundled-z3
224224

225225
- name: sccache stats
226226
if: always()

.github/workflows/release-tag.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ jobs:
233233
# Remove workspace members that are not needed for openshell-cli.
234234
# This avoids Cargo feature-unification pulling in aws-lc-sys (via
235235
# russh in openshell-sandbox / openshell-server).
236-
sed -i 's|members = \["crates/\*"\]|members = ["crates/openshell-cli", "crates/openshell-core", "crates/openshell-bootstrap", "crates/openshell-policy", "crates/openshell-providers", "crates/openshell-tui"]|' Cargo.toml
236+
sed -i 's|members = \["crates/\*"\]|members = ["crates/openshell-cli", "crates/openshell-core", "crates/openshell-bootstrap", "crates/openshell-policy", "crates/openshell-prover", "crates/openshell-providers", "crates/openshell-tui"]|' Cargo.toml
237237
238238
- name: Patch workspace version
239239
if: needs.compute-versions.outputs.cargo_version != ''
@@ -242,7 +242,7 @@ jobs:
242242
sed -i -E '/^\[workspace\.package\]/,/^\[/{s/^version[[:space:]]*=[[:space:]]*".*"/version = "'"${{ needs.compute-versions.outputs.cargo_version }}"'"/}' Cargo.toml
243243
244244
- name: Build ${{ matrix.target }}
245-
run: mise x -- cargo build --release --target ${{ matrix.target }} -p openshell-cli
245+
run: mise x -- cargo build --release --target ${{ matrix.target }} -p openshell-cli --features bundled-z3
246246

247247
- name: sccache stats
248248
if: always()

deploy/docker/Dockerfile.cli-macos

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
3131
clang \
3232
cmake \
3333
curl \
34+
libclang-dev \
3435
pkg-config \
3536
&& rm -rf /var/lib/apt/lists/*
3637

deploy/docker/Dockerfile.python-wheels

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@ ENV PATH="/root/.cargo/bin:${PATH}"
1212

1313
RUN apt-get update && apt-get install -y --no-install-recommends \
1414
build-essential \
15+
cmake \
1516
curl \
1617
gcc \
1718
libc6-dev \
18-
libz3-dev \
19+
libclang-dev \
1920
pkg-config \
2021
libssl-dev \
2122
&& rm -rf /var/lib/apt/lists/*
@@ -74,7 +75,7 @@ RUN --mount=type=cache,id=cargo-registry-python-wheels-${TARGETARCH},sharing=loc
7475
--mount=type=cache,id=cargo-git-python-wheels-${TARGETARCH},sharing=locked,target=/root/.cargo/git \
7576
--mount=type=cache,id=cargo-target-python-wheels-${TARGETARCH}-${CARGO_TARGET_CACHE_SCOPE},sharing=locked,target=/build/target \
7677
--mount=type=cache,id=sccache-python-wheels-${TARGETARCH},sharing=locked,target=/tmp/sccache \
77-
. cross-build.sh && cargo_cross_build --release -p openshell-cli 2>/dev/null || true
78+
. cross-build.sh && cargo_cross_build --release -p openshell-cli --features bundled-z3 2>/dev/null || true
7879

7980
# Copy actual source code and Python packaging files.
8081
COPY crates/ crates/
@@ -108,7 +109,7 @@ RUN --mount=type=cache,id=cargo-registry-python-wheels-${TARGETARCH},sharing=loc
108109
if [ -n "${OPENSHELL_CARGO_VERSION:-}" ]; then \
109110
sed -i -E '/^\[workspace\.package\]/,/^\[/{s/^version[[:space:]]*=[[:space:]]*".*"/version = "'"${OPENSHELL_CARGO_VERSION}"'"/}' Cargo.toml; \
110111
fi && \
111-
maturin build --release --target "${CARGO_BUILD_TARGET}" --out /wheels
112+
maturin build --release --target "${CARGO_BUILD_TARGET}" --features bundled-z3 --out /wheels
112113

113114
FROM scratch AS wheels
114115
COPY --from=builder /wheels/*.whl /

deploy/docker/Dockerfile.python-wheels-macos

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
2525
clang \
2626
cmake \
2727
curl \
28+
libclang-dev \
2829
libssl-dev \
2930
pkg-config \
3031
&& rm -rf /var/lib/apt/lists/*

0 commit comments

Comments
 (0)