diff --git a/Makefile b/Makefile index 2531e96010..e15e189e62 100644 --- a/Makefile +++ b/Makefile @@ -197,7 +197,7 @@ lmbench: $(MERGE_TIRPC_STAMP) # ---------------- bash (WASM build) ------------------------------------------- # Uses bash/compile_bash.sh to build bash as a wasm32-wasi binary using the # merged sysroot and toolchain detected by preflight, and stages artifacts -# under build/bin/bash/wasm32-wasi/. +# under build/bash/bin/bash. bash: $(MERGE_BASE_STAMP) . '$(TOOL_ENV)' JOBS='$(JOBS)' '$(APPS_ROOT)/bash/compile_bash.sh' diff --git a/bash/compile_bash.sh b/bash/compile_bash.sh index 6546aa92db..0e71f11922 100755 --- a/bash/compile_bash.sh +++ b/bash/compile_bash.sh @@ -54,7 +54,8 @@ ARTIFACT_MODE="${ARTIFACT_MODE:-fast}" FORCE_CLEAN="${FORCE_CLEAN:-0}" FORCE_CONFIGURE="${FORCE_CONFIGURE:-0}" -BASH_OUT_DIR="$APPS_ROOT/build/bin/bash/wasm32-wasi" +# Output location +BASH_OUT_DIR="$APPS_ROOT/build/bash/bin/bash" BASH_STATE_DIR="$APPS_ROOT/build/.bash_state" HOST_SIG_FILE="$BASH_STATE_DIR/host-config.sig" CACHE_REVISION="2" @@ -63,7 +64,7 @@ CACHE_REVISION="2" # phase is still valid. That phase is slow, and in practice it only needs to # rerun when bash's configure inputs change or the user explicitly asks for it. ################## -mkdir -p "$BASH_OUT_DIR" "$BASH_STATE_DIR" +mkdir -p "$BASH_OUT_DIR" "$BASH_STATE_DIR" WASM_COMPAT_H="$BASH_ROOT/wasm_compat.h" @@ -497,6 +498,9 @@ if [[ "$ARTIFACT_MODE" == "full" ]]; then CLEAN_CWASM="$BASH_OUT_DIR/bash.cwasm" if [[ -f "$OPT_CWASM" ]]; then mv "$OPT_CWASM" "$CLEAN_CWASM" + # Strip .cwasm extension for final staged binary (required by issue #125) + cp "$CLEAN_CWASM" "$BASH_OUT_DIR/bash" + echo "[bash] staged final binary: $BASH_OUT_DIR/bash" fi else echo "[bash] WARNING: lind-boot --precompile failed; skipping cwasm generation."