Skip to content

Commit

Permalink
chore: remove wasm_exec.js copy step from Wasm build scripts (goplu…
Browse files Browse the repository at this point in the history
…s#1203)

The `wasm_exec.js` file is already tracked at
`spx-gui/src/assets/wasm_exec.js`, making the copy step redundant.

Additionally, copying from `$GOROOT/misc/wasm/wasm_exec.js` is
unreliable because:

1. In Go 1.24, the file will be moved to `$GOROOT/lib/wasm`[^1].
2. `$GOROOT/misc` is not included in Go toolchain archives, which breaks
   Wasm builds when using `GOTOOLCHAIN`[^2].

[^1]: https://tip.golang.org/doc/go1.24#wasm
[^2]: https://go.dev/issue/68024

Signed-off-by: Aofei Sheng <[email protected]>
  • Loading branch information
aofei authored Jan 7, 2025
1 parent 72e6893 commit 1bc8b88
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 4 deletions.
3 changes: 0 additions & 3 deletions spx-gui/build-wasm.bat
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,5 @@ copy ispx\main.wasm ..\spx-gui\src\assets\ispx\main.wasm
REM Get GOROOT environment variable
for /f "tokens=*" %%i in ('go env GOROOT') do set GOROOT=%%i

REM Copy the wasm_exec.js file
copy "%GOROOT%\misc\wasm\wasm_exec.js" ..\spx-gui\src\assets\wasm_exec.js

echo Build WASM complete
endlocal
1 change: 0 additions & 1 deletion spx-gui/build-wasm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,3 @@ cd ..

cp fmt/static/main.wasm ../spx-gui/src/assets/format.wasm
cp ispx/main.wasm ../spx-gui/src/assets/ispx/main.wasm
cp "$(go env GOROOT)/misc/wasm/wasm_exec.js" ../spx-gui/src/assets/wasm_exec.js

0 comments on commit 1bc8b88

Please sign in to comment.