Skip to content

Commit a82e8a1

Browse files
committed
remove wasm-gc for webasm build
1 parent e48fe8d commit a82e8a1

File tree

5 files changed

+6
-11
lines changed

5 files changed

+6
-11
lines changed

.github/workflows/build_ghpages.yml

+2-4
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- name: Install Rust
1818
uses: actions-rs/toolchain@v1
1919
with:
20-
toolchain: nightly
20+
toolchain: stable
2121
target: wasm32-unknown-unknown
2222
profile: minimal
2323
override: true
@@ -29,9 +29,7 @@ jobs:
2929
- run: rm .gitignore
3030
- run: mv .gitignore.ghpages .gitignore
3131
- run: cargo build --lib --target wasm32-unknown-unknown --release
32-
- run: cargo install wasm-gc
33-
- run: wasm-gc ./target/wasm32-unknown-unknown/release/customasm.wasm -o ./target/wasm32-unknown-unknown/release/customasm.gc.wasm
34-
- run: mv ./target/wasm32-unknown-unknown/release/customasm.gc.wasm ./web/customasm.gc.wasm
32+
- run: mv ./target/wasm32-unknown-unknown/release/customasm.wasm ./web/customasm.wasm
3533
- run: git config user.name github-actions
3634
- run: git config user.email github-actions@github.com
3735
- run: git add -A

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
/test.asm
77
/test_output_mismatch
88

9-
/web/customasm.gc.wasm
9+
/web/customasm.wasm

build_wasm.ps1

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
# Build wasm binary
22
cargo build --lib --target wasm32-unknown-unknown --release
33

4-
# Reduce binary size
5-
wasm-gc "./target/wasm32-unknown-unknown/release/customasm.wasm" -o "./target/wasm32-unknown-unknown/release/customasm.gc.wasm"
6-
74
# Copy to web folder
8-
Copy-Item -Path "./target/wasm32-unknown-unknown/release/customasm.gc.wasm" -Destination "./web/customasm.gc.wasm"
5+
Copy-Item -Path "./target/wasm32-unknown-unknown/release/customasm.wasm" -Destination "./web/customasm.wasm"
96

src/webasm/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ pub unsafe extern fn wasm_assemble(
3737
None =>
3838
{
3939
let mut err = Vec::<u8>::new();
40-
report.print_all(&mut err, &fileserver);
40+
report.print_all(&mut err, &fileserver, true);
4141
return wasm_string_new_with(
4242
String::from_utf8(err).unwrap());
4343
}

web/main.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ function main()
1212
window.onkeydown = onKeyDown
1313
window.onbeforeunload = onBeforeUnload
1414

15-
fetch("customasm.gc.wasm")
15+
fetch("customasm.wasm")
1616
.then(r => r.arrayBuffer())
1717
.then(r => WebAssembly.instantiate(r))
1818
.then(wasm =>

0 commit comments

Comments
 (0)