Skip to content

Commit 2d03367

Browse files
committed
fix(ci): bundle z3 in gateway artifacts
Signed-off-by: Alexander Watson <[email protected]>
1 parent d1ce9bb commit 2d03367

8 files changed

Lines changed: 23 additions & 5 deletions

File tree

‎.github/workflows/docker-build.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ jobs:
162162
cargo-version: ${{ inputs['cargo-version'] }}
163163
image-tag: ${{ needs.resolve.outputs.image_tag_base }}
164164
checkout-ref: ${{ inputs['checkout-ref'] }}
165-
features: openshell-core/dev-settings
165+
features: ${{ inputs.component == 'gateway' && 'openshell-core/dev-settings bundled-z3' || 'openshell-core/dev-settings' }}
166166
artifact-name: ${{ needs.resolve.outputs.artifact_prefix }}-linux-${{ matrix.arch }}
167167
secrets: inherit
168168

‎.github/workflows/release-dev.yml‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ jobs:
435435
run: |
436436
set -euo pipefail
437437
mise x -- rustup target add ${{ matrix.target }}
438-
mise x -- cargo zigbuild --release --target ${{ matrix.zig_target }} -p openshell-server --bin openshell-gateway
438+
mise x -- cargo zigbuild --release --target ${{ matrix.zig_target }} -p openshell-server --bin openshell-gateway --features bundled-z3
439439
mkdir -p artifacts/bin
440440
install -m 0755 target/${{ matrix.target }}/release/openshell-gateway artifacts/bin/openshell-gateway
441441
@@ -445,6 +445,11 @@ jobs:
445445
OUTPUT="$(artifacts/bin/openshell-gateway --version)"
446446
echo "$OUTPUT"
447447
grep -q '^openshell-gateway ' <<<"$OUTPUT"
448+
ldd artifacts/bin/openshell-gateway || true
449+
if ldd artifacts/bin/openshell-gateway | grep -q 'libz3'; then
450+
echo "gateway binary must not depend on shared libz3; build with bundled-z3" >&2
451+
exit 1
452+
fi
448453
449454
- name: Verify glibc symbol floor
450455
run: tasks/scripts/verify-glibc-symbols.sh 2.31 artifacts/bin/openshell-gateway

‎.github/workflows/release-tag.yml‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ jobs:
469469
run: |
470470
set -euo pipefail
471471
mise x -- rustup target add ${{ matrix.target }}
472-
mise x -- cargo zigbuild --release --target ${{ matrix.zig_target }} -p openshell-server --bin openshell-gateway
472+
mise x -- cargo zigbuild --release --target ${{ matrix.zig_target }} -p openshell-server --bin openshell-gateway --features bundled-z3
473473
mkdir -p artifacts/bin
474474
install -m 0755 target/${{ matrix.target }}/release/openshell-gateway artifacts/bin/openshell-gateway
475475
@@ -479,6 +479,11 @@ jobs:
479479
OUTPUT="$(artifacts/bin/openshell-gateway --version)"
480480
echo "$OUTPUT"
481481
grep -q '^openshell-gateway ' <<<"$OUTPUT"
482+
ldd artifacts/bin/openshell-gateway || true
483+
if ldd artifacts/bin/openshell-gateway | grep -q 'libz3'; then
484+
echo "gateway binary must not depend on shared libz3; build with bundled-z3" >&2
485+
exit 1
486+
fi
482487
483488
- name: Verify glibc symbol floor
484489
run: tasks/scripts/verify-glibc-symbols.sh 2.31 artifacts/bin/openshell-gateway

‎.github/workflows/rust-native-build.yml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,10 @@ jobs:
245245
# Record linkage so image runtime drift is visible in logs.
246246
ldd --version
247247
ldd "$BIN" || true
248+
if [[ "${{ inputs.component }}" == "gateway" ]] && ldd "$BIN" | grep -q 'libz3'; then
249+
echo "gateway binary must not depend on shared libz3; enable bundled-z3 for image artifacts" >&2
250+
exit 1
251+
fi
248252
249253
- name: Verify glibc symbol floor
250254
if: inputs.component == 'gateway'

‎crates/openshell-server/Cargo.toml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ rustix = { workspace = true }
9696
x509-parser = "0.16"
9797

9898
[features]
99+
bundled-z3 = ["openshell-prover/bundled-z3"]
99100
dev-settings = ["openshell-core/dev-settings"]
100101
test-support = []
101102

‎snapcraft.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ parts:
7373
set -euo pipefail
7474
7575
cargo build --release --locked -p openshell-cli --features bundled-z3
76-
cargo build --release --locked -p openshell-server --bin openshell-gateway
76+
cargo build --release --locked -p openshell-server --bin openshell-gateway --features bundled-z3
7777
cargo build --release --locked -p openshell-sandbox --bin openshell-sandbox
7878
7979
install -D -m 0755 "$CRAFT_PART_BUILD/target/release/openshell" \

‎tasks/ci.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ hide = true
3131
description = "Build release Rust binaries consumed by the hand-staged snap"
3232
run = [
3333
"cargo build --release -p openshell-cli --features bundled-z3",
34-
"cargo build --release -p openshell-server",
34+
"cargo build --release -p openshell-server --features bundled-z3",
3535
"cargo build --release -p openshell-sandbox",
3636
]
3737

‎tasks/scripts/stage-prebuilt-binaries.sh‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,9 @@ build_component_for_arch() {
149149
target="$(target_triple "$arch" "$target_libc")"
150150
stage="${ROOT}/deploy/docker/.build/prebuilt-binaries/${arch}"
151151
features="${EXTRA_CARGO_FEATURES:-openshell-core/dev-settings}"
152+
if [[ "$component" == "gateway" && " ${features} " != *" bundled-z3 "* ]]; then
153+
features="${features} bundled-z3"
154+
fi
152155
current_host_os="$(host_os)"
153156
current_host_arch="$(host_arch)"
154157

0 commit comments

Comments
 (0)