Fix WASM kernel deploy: 3.6MB js_of_ocaml → 68KB wasm_of_ocaml
The deployed sx_browser.bc.wasm.js was actually the js_of_ocaml output (pure JS), not the wasm_of_ocaml loader. Nothing synced the correct build output from _build/ to shared/static/wasm/. - sx_build target=ocaml now auto-syncs WASM kernel + JS fallback + assets - sx-build-all.sh syncs after dune build - Correct 68KB WASM loader replaces 3.6MB JS imposter Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -6,6 +6,15 @@ cd "$(dirname "$0")/.."
|
||||
|
||||
echo "=== OCaml build ==="
|
||||
(cd hosts/ocaml && eval $(opam env 2>/dev/null) && dune build) || { echo "FAIL: OCaml build"; exit 1; }
|
||||
|
||||
echo "=== Sync WASM kernel to shared/static/wasm/ ==="
|
||||
OCAML_BUILD=hosts/ocaml/_build/default/browser
|
||||
cp "$OCAML_BUILD/sx_browser.bc.wasm.js" shared/static/wasm/sx_browser.bc.wasm.js
|
||||
cp "$OCAML_BUILD/sx_browser.bc.js" shared/static/wasm/sx_browser.bc.js
|
||||
cp -r "$OCAML_BUILD/sx_browser.bc.wasm.assets" shared/static/wasm/
|
||||
echo " WASM loader: $(du -sh shared/static/wasm/sx_browser.bc.wasm.js | cut -f1)"
|
||||
echo " JS fallback: $(du -sh shared/static/wasm/sx_browser.bc.js | cut -f1)"
|
||||
|
||||
echo "=== JS browser build ==="
|
||||
python3 hosts/javascript/cli.py --output shared/static/scripts/sx-browser.js || { echo "FAIL: JS build"; exit 1; }
|
||||
echo "=== JS test build ==="
|
||||
|
||||
Reference in New Issue
Block a user