fix(docker): Replace emsdk image with Ubuntu + emsdk from source
The Docker build used emscripten/emsdk:4.0.2-arm64 as base image but env.sh couldn't find emsdk there, installing a second copy. The build then applied wasm-opt/finalize stubs to the wrong emsdk (hardcoded /emsdk/), so the real wasm-emscripten-finalize ran in Docker and got OOM-killed. - Use ubuntu:22.04 base with emsdk installed from source at /emsdk/ - Make stub paths dynamic via $EMSDK instead of hardcoded /emsdk/ - Skip local emsdk install in env.sh when $EMSDK is already active Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
b46b4b69f1
commit
d557b21eac
3 changed files with 39 additions and 16 deletions
|
|
@ -181,7 +181,11 @@ log_info "Stub libraries built"
|
|||
# Step 6.2: Replace Emscripten's wasm-opt with stub to bypass asyncify transformation
|
||||
# This allows Emscripten to generate JS with Asyncify runtime, but we run the real
|
||||
# wasm-opt --asyncify on the host where more RAM is available (needs 50GB+ for KiCad)
|
||||
EMSDK_WASM_OPT="/emsdk/upstream/bin/wasm-opt"
|
||||
if [ -z "${EMSDK}" ]; then
|
||||
log_error "EMSDK environment variable is not set."
|
||||
exit 1
|
||||
fi
|
||||
EMSDK_WASM_OPT="${EMSDK}/upstream/bin/wasm-opt"
|
||||
if [ -f "${EMSDK_WASM_OPT}" ] && [ ! -f "${EMSDK_WASM_OPT}.real" ]; then
|
||||
log_info "Backing up real wasm-opt..."
|
||||
mv "${EMSDK_WASM_OPT}" "${EMSDK_WASM_OPT}.real"
|
||||
|
|
@ -193,7 +197,7 @@ log_info "wasm-opt stub installed (asyncify will run on host)"
|
|||
|
||||
# Step 6.3: Replace wasm-emscripten-finalize with stub (same pattern as wasm-opt)
|
||||
# This tool also OOMs on large WASM with debug symbols, so we run it on the host
|
||||
EMSDK_FINALIZE="/emsdk/upstream/bin/wasm-emscripten-finalize"
|
||||
EMSDK_FINALIZE="${EMSDK}/upstream/bin/wasm-emscripten-finalize"
|
||||
if [ -f "${EMSDK_FINALIZE}" ] && [ ! -f "${EMSDK_FINALIZE}.real" ]; then
|
||||
log_info "Backing up real wasm-emscripten-finalize..."
|
||||
mv "${EMSDK_FINALIZE}" "${EMSDK_FINALIZE}.real"
|
||||
|
|
|
|||
Loading…
Reference in a new issue