2525Options:
2626 --vm DISTRO Run the gateway in a Nix test guest
2727 --with CONFIG Apply a Nix test-guest configuration; repeatable
28+ --host-cli-bin PATH Use a prebuilt host openshell CLI instead of building it
29+ --gateway-bin PATH Use a prebuilt openshell-gateway instead of building it
30+ --sandbox-bin PATH Use a prebuilt openshell-sandbox instead of building it
2831 --gateway-config PATH
2932 Fully resolved gateway TOML
3033 --suite NAME Rust suite at e2e/rust/tests/NAME.rs
@@ -92,6 +95,9 @@ catalog_has_entry() {
9295
9396vm=
9497gateway_config=
98+ gateway_bin=
99+ host_cli_bin=
100+ sandbox_bin=
95101suite_name=
96102with_configurations=()
97103
@@ -107,6 +113,21 @@ while [ "$#" -gt 0 ]; do
107113 with_configurations+=(" $2 " )
108114 shift 2
109115 ;;
116+ --host-cli-bin)
117+ require_value " $1 " " $# " " ${2:- } "
118+ host_cli_bin=" $( resolve_file " $2 " ) " || die " --host-cli-bin does not name a file: $2 "
119+ shift 2
120+ ;;
121+ --gateway-bin)
122+ require_value " $1 " " $# " " ${2:- } "
123+ gateway_bin=" $( resolve_file " $2 " ) " || die " --gateway-bin does not name a file: $2 "
124+ shift 2
125+ ;;
126+ --sandbox-bin)
127+ require_value " $1 " " $# " " ${2:- } "
128+ sandbox_bin=" $( resolve_file " $2 " ) " || die " --sandbox-bin does not name a file: $2 "
129+ shift 2
130+ ;;
110131 --gateway-config)
111132 require_value " $1 " " $# " " ${2:- } "
112133 gateway_config=$2
@@ -230,49 +251,68 @@ target_dir="$(e2e_cargo_target_dir "${ROOT}" mise x -- cargo)"
230251
231252ensure_build_nofile_limit
232253
233- echo " ==> Building native host openshell CLI"
234- mise x -- cargo build " ${cargo_jobs[@]+" ${cargo_jobs[@]} " } " -p openshell-cli --bin openshell
235- host_cli_bin=" ${target_dir} /debug/openshell"
236-
237- echo " ==> Preparing ${linux_musl_target} build target"
238- mise x -- rustup target add " ${linux_musl_target} " > /dev/null
254+ if [ -n " ${host_cli_bin} " ]; then
255+ echo " ==> Using host openshell CLI: ${host_cli_bin} "
256+ else
257+ echo " ==> Building native host openshell CLI"
258+ mise x -- cargo build " ${cargo_jobs[@]+" ${cargo_jobs[@]} " } " -p openshell-cli --bin openshell
259+ host_cli_bin=" ${target_dir} /debug/openshell"
260+ fi
239261
240- echo " ==> Building Linux openshell-sandbox (${linux_musl_target} )"
241- mise x -- cargo zigbuild " ${cargo_jobs[@]+" ${cargo_jobs[@]} " } " \
242- --release \
243- --target " ${linux_musl_target} " \
244- -p openshell-sandbox \
245- --bin openshell-sandbox
246- linux_sandbox_bin=" ${target_dir} /${linux_musl_target} /release/openshell-sandbox"
262+ if [ -n " ${sandbox_bin} " ]; then
263+ echo " ==> Using Linux openshell-sandbox: ${sandbox_bin} "
264+ linux_sandbox_bin=" ${sandbox_bin} "
265+ else
266+ echo " ==> Preparing ${linux_musl_target} build target"
267+ mise x -- rustup target add " ${linux_musl_target} " > /dev/null
268+
269+ echo " ==> Building Linux openshell-sandbox (${linux_musl_target} )"
270+ mise x -- cargo zigbuild " ${cargo_jobs[@]+" ${cargo_jobs[@]} " } " \
271+ --release \
272+ --target " ${linux_musl_target} " \
273+ -p openshell-sandbox \
274+ --bin openshell-sandbox
275+ linux_sandbox_bin=" ${target_dir} /${linux_musl_target} /release/openshell-sandbox"
276+ fi
247277
248278host_gateway_bin=
249279guest_gateway_bin=
250280if [ " ${mode} " = host ]; then
251- echo " ==> Building native host openshell-gateway"
252- mise x -- cargo build " ${cargo_jobs[@]+" ${cargo_jobs[@]} " } " \
253- -p openshell-server \
254- --bin openshell-gateway \
255- --features bundled-z3
256- host_gateway_bin=" ${target_dir} /debug/openshell-gateway"
257- else
258- echo " ==> Preparing ${linux_gateway_rust_target} build target"
259- mise x -- rustup target add " ${linux_gateway_rust_target} " > /dev/null
260- echo " ==> Building Linux openshell-gateway (${linux_gateway_zig_target} )"
261- (
262- eval " $(
263- " ${ROOT} /tasks/scripts/setup-zig-cc-wrapper.sh" \
264- " ${linux_gateway_zig_target} " \
265- " ${linux_gateway_zig_target} " \
266- " ${target_dir} /zig-gnu-wrapper/e2e"
267- ) "
268- mise x -- cargo zigbuild " ${cargo_jobs[@]+" ${cargo_jobs[@]} " } " \
269- --release \
270- --target " ${linux_gateway_zig_target} " \
281+ if [ -n " ${gateway_bin} " ]; then
282+ echo " ==> Using host openshell-gateway: ${gateway_bin} "
283+ host_gateway_bin=" ${gateway_bin} "
284+ else
285+ echo " ==> Building native host openshell-gateway"
286+ mise x -- cargo build " ${cargo_jobs[@]+" ${cargo_jobs[@]} " } " \
271287 -p openshell-server \
272288 --bin openshell-gateway \
273289 --features bundled-z3
274- )
275- guest_gateway_bin=" ${target_dir} /${linux_gateway_rust_target} /release/openshell-gateway"
290+ host_gateway_bin=" ${target_dir} /debug/openshell-gateway"
291+ fi
292+ else
293+ if [ -n " ${gateway_bin} " ]; then
294+ echo " ==> Using Linux openshell-gateway: ${gateway_bin} "
295+ guest_gateway_bin=" ${gateway_bin} "
296+ else
297+ echo " ==> Preparing ${linux_gateway_rust_target} build target"
298+ mise x -- rustup target add " ${linux_gateway_rust_target} " > /dev/null
299+ echo " ==> Building Linux openshell-gateway (${linux_gateway_zig_target} )"
300+ (
301+ eval " $(
302+ " ${ROOT} /tasks/scripts/setup-zig-cc-wrapper.sh" \
303+ " ${linux_gateway_zig_target} " \
304+ " ${linux_gateway_zig_target} " \
305+ " ${target_dir} /zig-gnu-wrapper/e2e"
306+ ) "
307+ mise x -- cargo zigbuild " ${cargo_jobs[@]+" ${cargo_jobs[@]} " } " \
308+ --release \
309+ --target " ${linux_gateway_zig_target} " \
310+ -p openshell-server \
311+ --bin openshell-gateway \
312+ --features bundled-z3
313+ )
314+ guest_gateway_bin=" ${target_dir} /${linux_gateway_rust_target} /release/openshell-gateway"
315+ fi
276316fi
277317
278318expected_binaries=(" ${host_cli_bin} " " ${linux_sandbox_bin} " )
0 commit comments