Skip to content

Commit

Permalink
use original go compiler instead of tinygo
Browse files Browse the repository at this point in the history
Even though tinygo produce much smaller binary files
but it lack of debug information, make debugging very difficult.
  • Loading branch information
zyxkad committed Jan 23, 2025
1 parent 2712728 commit 5fc336a
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 8 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/build-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,16 @@ jobs:
-
name: Action Checkout
uses: actions/checkout@v3
# -
# name: Setup Tinygo
# uses: acifani/setup-tinygo@v1
# with:
# tinygo-version: '0.35.0'
-
name: Setup Tinygo
uses: acifani/setup-tinygo@v1
name: Setup Golang
uses: actions/setup-go@v4
with:
tinygo-version: '0.35.0'
go-version: '1.23.0'
-
name: Build wasm
run: |
Expand Down
14 changes: 10 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,22 @@ jobs:
-
name: Action Checkout
uses: actions/checkout@v3
# -
# name: Setup Tinygo
# uses: acifani/setup-tinygo@v1
# with:
# tinygo-version: '0.35.0'
-
name: Setup Tinygo
uses: acifani/setup-tinygo@v1
name: Setup Golang
uses: actions/setup-go@v4
with:
tinygo-version: '0.35.0'
go-version: '1.23.0'
-
name: Build wasm
run: |
mkdir output
/usr/bin/env bash ./cmd/mcla_wasm/build.sh -o ./output/mcla.wasm -opt=z -no-debug -ldflags="-X 'main.version=${GITHUB_REF#refs/*/}'"
# /usr/bin/env bash ./cmd/mcla_wasm/build.sh -o ./output/mcla.wasm -opt=z -no-debug -ldflags="-X 'main.version=${GITHUB_REF#refs/*/}'"
/usr/bin/env bash ./cmd/mcla_wasm/build.sh -o ./output/mcla.wasm -trimpath -ldflags="-s -w -X 'main.version=${GITHUB_REF#refs/*/}'"
cp ./cmd/mcla_wasm/wasm_exec.js ./output/wasm_exec.js
-
name: Upload wasm output to artifact
Expand Down
3 changes: 2 additions & 1 deletion cmd/mcla_wasm/build.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/sh

exec tinygo build -target wasm "$@" "$(dirname $0)"
# exec tinygo build -target wasm "$@" "$(dirname $0)"
GOOS=js GOARCH=wasm exec go build "$@" "$(dirname $0)"

0 comments on commit 5fc336a

Please sign in to comment.