Build: keep wasm64 fixture builds working on macOS Bash 3.2 - #940
Build: keep wasm64 fixture builds working on macOS Bash 3.2#940brandonpayton wants to merge 1 commit into
Conversation
The program builder runs under Bash 3.2 on macOS, where expanding an empty array with nounset enabled aborts the script. Guard the optional wasm64 compiler flags with the same array-preserving expansion already used by the wasm32 path.
|
CI diagnosis for exact head The failed Representative first failure: The same mismatch affects every package, and Action: do not rerun this pre-#913 head. After #913 merges, rebase #940 onto current |
|
Absorbed by rebase-merged #967. Main is now 6efb411 with the sealed tree b133bfa018f7e2bc84c4845edf2f945b2f844954, and ABI 41 activation completed successfully in run 29550069085. The absorption audit confirmed this PR\x27s behavior and tests are present in that merged tree, so this source PR is closed and its branch is deleted. |
Why
Kandelo's program-fixture build must work with the system Bash shipped by macOS as well as newer Bash versions. The script uses set -u, which turns an unset-variable expansion into an immediate error.
scripts/build-programs.shenablesset -uand directly expands the optional wasm64extra_flagsarray. The array is empty for every current memory64 fixture exceptposix-timer-thread.The macOS system Bash 3.2 treats that empty array expansion as an unbound variable, so the wasm64 build stops before compiling the ordinary fixtures.
What changed
Use the same guarded array expansion already used by the wasm32 build path. An empty array now contributes zero compiler arguments, while a nonempty array still preserves each argument exactly. The nearby comment records why the guard is required.
Validation
Exact validated head:
06ae4bf6f936ccfcc49678e7e30a1437f43e458a./bin/bashis GNU Bash 3.2.57 on macOS.extra_flags[@]: unbound variable.scripts/dev-shell.sh bash -c "bash scripts/build-musl.sh && bash scripts/build-musl.sh --arch wasm64posix"; both sysroots built successfully.scripts/dev-shell.sh /bin/bash scripts/build-programs.sh; the full fixture build completed under Bash 3.2 and produced the wasm64hello64,ifhwaddr,posix-timer-thread,sched-getaffinity, andwait_lifecycle_testmodules.posix-timer-thread.wasm;__wasm_posix_thread_slotsreturnsi32.const 8, confirming the nonempty optional define was preserved.git diff --check.This changes build-script host compatibility only. It does not change runtime behavior, the Kandelo ABI, package metadata, or committed binary artifacts. Runtime and conformance suites were not run because no runtime or POSIX contract changed.