Skip to content

Commit 764d930

Browse files
authored
fix(vm): use bash 3.2-safe empty array expansion in supervisor build script (#1311)
macOS ships bash 3.2, which treats empty array expansion ("${arr[@]}") as an unbound variable error under set -u. Unlike set -e, this error is not caught by if-constructs — it kills the shell immediately with no output, causing mise run vm:supervisor to fail silently. Use the ${arr[@]+"${arr[@]}"} idiom so the script works on both bash 3.2 (macOS default) and bash 4+. Signed-off-by: Florent Benoit <fbenoit@redhat.com>
1 parent 957daa0 commit 764d930

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

tasks/scripts/vm/build-supervisor-bundle.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,11 +134,11 @@ run_supervisor_build() {
134134
fi
135135

136136
if command -v cargo-zigbuild >/dev/null 2>&1; then
137-
"${cargo_prefix[@]}" cargo zigbuild --release -p openshell-sandbox --target "${RUST_TARGET}" \
137+
${cargo_prefix[@]+"${cargo_prefix[@]}"} cargo zigbuild --release -p openshell-sandbox --target "${RUST_TARGET}" \
138138
--manifest-path "${ROOT}/Cargo.toml"
139139
else
140140
echo " cargo-zigbuild not found, falling back to cargo build..."
141-
"${cargo_prefix[@]}" cargo build --release -p openshell-sandbox --target "${RUST_TARGET}" \
141+
${cargo_prefix[@]+"${cargo_prefix[@]}"} cargo build --release -p openshell-sandbox --target "${RUST_TARGET}" \
142142
--manifest-path "${ROOT}/Cargo.toml"
143143
fi
144144
}

0 commit comments

Comments
 (0)