Skip to content

Build: keep wasm64 fixture builds working on macOS Bash 3.2 - #940

Closed
brandonpayton wants to merge 1 commit into
mainfrom
fix/wasm64-empty-extra-flags-bash32
Closed

Build: keep wasm64 fixture builds working on macOS Bash 3.2#940
brandonpayton wants to merge 1 commit into
mainfrom
fix/wasm64-empty-extra-flags-bash32

Conversation

@brandonpayton

@brandonpayton brandonpayton commented Jul 14, 2026

Copy link
Copy Markdown
Member

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.sh enables set -u and directly expands the optional wasm64 extra_flags array. The array is empty for every current memory64 fixture except posix-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.

  • Confirmed /bin/bash is GNU Bash 3.2.57 on macOS.
  • Reproduced the original unguarded behavior as extra_flags[@]: unbound variable.
  • Ran scripts/dev-shell.sh bash -c "bash scripts/build-musl.sh && bash scripts/build-musl.sh --arch wasm64posix"; both sysroots built successfully.
  • Ran scripts/dev-shell.sh /bin/bash scripts/build-programs.sh; the full fixture build completed under Bash 3.2 and produced the wasm64 hello64, ifhwaddr, posix-timer-thread, sched-getaffinity, and wait_lifecycle_test modules.
  • Disassembled the resulting posix-timer-thread.wasm; __wasm_posix_thread_slots returns i32.const 8, confirming the nonempty optional define was preserved.
  • Ran Bash 3.2 and dev-shell Bash syntax checks plus 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.

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.
@brandonpayton

Copy link
Copy Markdown
Member Author

CI diagnosis for exact head 06ae4bf6f936ccfcc49678e7e30a1437f43e458a:

The failed test-gate-prepare did not reach the Bash 3.2 program build. Its binary-materialization step downloaded all 71 ABI 39 archives successfully, then rejected every one because this branch (based on pre-#913 main) computes the old package cache keys while the shared binaries-abi-v39/index.toml now points at the #913 keys promoted by #913's successful prepare-merge run.

Representative first failure:

bash: local 4fcd4793... archive 9fe79ff8...

The same mismatch affects every package, and resolved=0 total=71. This is the known shared-index transition already diagnosed on #939, not a regression in this one-line build-script fix.

Action: do not rerun this pre-#913 head. After #913 merges, rebase #940 onto current main and rerun CI; the branch and release index will then compute the same cache keys. The exact local macOS Bash 3.2 full wasm32/wasm64 build evidence remains valid for the current commit.

@brandonpayton

Copy link
Copy Markdown
Member Author

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.

@brandonpayton
brandonpayton deleted the fix/wasm64-empty-extra-flags-bash32 branch July 17, 2026 02:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant