From 650c4bd9bddd7e66c2e4c4e42bb1a8c86a450009 Mon Sep 17 00:00:00 2001 From: PgBiel <9021226+PgBiel@users.noreply.github.com> Date: Sat, 9 Aug 2025 00:08:28 -0300 Subject: [PATCH 01/12] add testweb --- check.sh | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/check.sh b/check.sh index d4cbd8958..109ef8dcd 100755 --- a/check.sh +++ b/check.sh @@ -28,6 +28,7 @@ Commands: fmt format code, fail if bad test run unit tests (no Godot needed) itest run integration tests (from within Godot) + testweb run unit tests on web environment (requires node.js and emcc) clippy validate clippy lints klippy validate + fix clippy doc generate docs for 'godot' crate @@ -179,6 +180,21 @@ function cmd_itest() { run "$godotBin" $GODOT_ARGS --path itest/godot --headless -- "[${extraArgs[@]}]" } +function cmd_testweb() { + # For the flag: https://github.com/rust-lang/cargo/issues/7471 + CARGO_TARGET_WASM32_UNKNOWN_EMSCRIPTEN_RUNNER=node RUSTFLAGS="-C link-args=-pthread \ + -C link-args=-g \ + -C link-args=-sPTHREAD_POOL_SIZE=4 \ + -C link-args=-sASSERTIONS=2 \ + -C link-args=-sINITIAL_MEMORY=268435456 \ + -C panic=unwind \ + -C target-feature=+atomics \ + -Zlink-native-libraries=no \ + -Cllvm-args=-enable-emscripten-cxx-exceptions=0" EM_CACHE=$(mktemp -d) run cargo +nightly test \ + --features godot/experimental-wasm,godot/lazy-function-tables \ + -Zbuild-std --target wasm32-unknown-emscripten -- --nocapture +} + function cmd_doc() { run cargo doc --lib -p godot --no-deps "${extraCargoArgs[@]}" } @@ -211,7 +227,7 @@ while [[ $# -gt 0 ]]; do --double) extraCargoArgs+=("--features" "godot/double-precision,godot/api-custom") ;; - fmt | test | itest | clippy | klippy | doc | dok) + fmt | test | itest | testweb | clippy | klippy | doc | dok) cmds+=("$arg") ;; -f | --filter) From 15e008e440450946c7f986ddf7030c5a3a647580 Mon Sep 17 00:00:00 2001 From: PgBiel <9021226+PgBiel@users.noreply.github.com> Date: Sat, 9 Aug 2025 00:59:26 -0300 Subject: [PATCH 02/12] remove changes to flags in exceptions --- check.sh | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/check.sh b/check.sh index 109ef8dcd..2b2d4f29c 100755 --- a/check.sh +++ b/check.sh @@ -184,13 +184,8 @@ function cmd_testweb() { # For the flag: https://github.com/rust-lang/cargo/issues/7471 CARGO_TARGET_WASM32_UNKNOWN_EMSCRIPTEN_RUNNER=node RUSTFLAGS="-C link-args=-pthread \ -C link-args=-g \ - -C link-args=-sPTHREAD_POOL_SIZE=4 \ - -C link-args=-sASSERTIONS=2 \ -C link-args=-sINITIAL_MEMORY=268435456 \ - -C panic=unwind \ - -C target-feature=+atomics \ - -Zlink-native-libraries=no \ - -Cllvm-args=-enable-emscripten-cxx-exceptions=0" EM_CACHE=$(mktemp -d) run cargo +nightly test \ + -C target-feature=+atomics" EM_CACHE=$(mktemp -d) run cargo +nightly test \ --features godot/experimental-wasm,godot/lazy-function-tables \ -Zbuild-std --target wasm32-unknown-emscripten -- --nocapture } From f91c6e017fced98552c5eefdcab0f9aabc37d8bb Mon Sep 17 00:00:00 2001 From: PgBiel <9021226+PgBiel@users.noreply.github.com> Date: Tue, 12 Aug 2025 23:55:53 -0300 Subject: [PATCH 03/12] reorder flags --- check.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/check.sh b/check.sh index 2b2d4f29c..8734c6b8b 100755 --- a/check.sh +++ b/check.sh @@ -183,9 +183,9 @@ function cmd_itest() { function cmd_testweb() { # For the flag: https://github.com/rust-lang/cargo/issues/7471 CARGO_TARGET_WASM32_UNKNOWN_EMSCRIPTEN_RUNNER=node RUSTFLAGS="-C link-args=-pthread \ + -C target-feature=+atomics \ -C link-args=-g \ - -C link-args=-sINITIAL_MEMORY=268435456 \ - -C target-feature=+atomics" EM_CACHE=$(mktemp -d) run cargo +nightly test \ + -C link-args=-sINITIAL_MEMORY=268435456" EM_CACHE=$(mktemp -d) run cargo +nightly test \ --features godot/experimental-wasm,godot/lazy-function-tables \ -Zbuild-std --target wasm32-unknown-emscripten -- --nocapture } From f963b40dd56290778db98185d09805c08401cc13 Mon Sep 17 00:00:00 2001 From: PgBiel <9021226+PgBiel@users.noreply.github.com> Date: Wed, 13 Aug 2025 00:32:16 -0300 Subject: [PATCH 04/12] add non-threaded tests --- check.sh | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/check.sh b/check.sh index 8734c6b8b..04003694e 100755 --- a/check.sh +++ b/check.sh @@ -181,13 +181,35 @@ function cmd_itest() { } function cmd_testweb() { - # For the flag: https://github.com/rust-lang/cargo/issues/7471 + # Add more debug symbols to build + common_flags="-C link-args=-g" + + # Avoid problems with emcc potentially writing to read-only dir + cache_dir="target/emscripten_cache" + mkdir -p "${cache_dir}" + + echo "===============================" + echo "Initiating threaded Wasm tests." + echo "===============================" + + # For the runner env var: https://github.com/rust-lang/cargo/issues/7471 + # More memory (256 MiB) is needed for the parallel godot-cell tests which + # spawn 70 threads each. CARGO_TARGET_WASM32_UNKNOWN_EMSCRIPTEN_RUNNER=node RUSTFLAGS="-C link-args=-pthread \ -C target-feature=+atomics \ - -C link-args=-g \ - -C link-args=-sINITIAL_MEMORY=268435456" EM_CACHE=$(mktemp -d) run cargo +nightly test \ + -C link-args=-sINITIAL_MEMORY=268435456 \ + ${common_flags}" EM_CACHE="${cache_dir}" run cargo +nightly test \ --features godot/experimental-wasm,godot/lazy-function-tables \ - -Zbuild-std --target wasm32-unknown-emscripten -- --nocapture + -Zbuild-std --target wasm32-unknown-emscripten + + echo "===================================" + echo "Initiating non-threaded Wasm tests." + echo "===================================" + + CARGO_TARGET_WASM32_UNKNOWN_EMSCRIPTEN_RUNNER=node RUSTFLAGS="${common_flags}" \ + EM_CACHE="${cache_dir}" run cargo +nightly test \ + --features godot/experimental-wasm-nothreads,godot/experimental-wasm,godot/lazy-function-tables \ + -Zbuild-std --target wasm32-unknown-emscripten } function cmd_doc() { From 84dfe037ef165644a18a0c84d102b4ed51fd6c19 Mon Sep 17 00:00:00 2001 From: PgBiel <9021226+PgBiel@users.noreply.github.com> Date: Wed, 13 Aug 2025 00:52:22 -0300 Subject: [PATCH 05/12] fix non-absolute target path --- check.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/check.sh b/check.sh index 04003694e..dd758f547 100755 --- a/check.sh +++ b/check.sh @@ -185,7 +185,7 @@ function cmd_testweb() { common_flags="-C link-args=-g" # Avoid problems with emcc potentially writing to read-only dir - cache_dir="target/emscripten_cache" + cache_dir="$(realpath ./target)/emscripten_cache" mkdir -p "${cache_dir}" echo "===============================" From ebf0a38e516c271340ee5e658b889db955f22326 Mon Sep 17 00:00:00 2001 From: PgBiel <9021226+PgBiel@users.noreply.github.com> Date: Wed, 13 Aug 2025 00:43:26 -0300 Subject: [PATCH 06/12] ignore godot-cell threaded tests in nothreads --- godot-cell/Cargo.toml | 1 + godot-cell/tests/mock/blocking.rs | 20 ++++++++++++++++++++ godot-cell/tests/mock/panicking.rs | 16 ++++++++++++++++ godot-core/Cargo.toml | 2 +- 4 files changed, 38 insertions(+), 1 deletion(-) diff --git a/godot-cell/Cargo.toml b/godot-cell/Cargo.toml index 36d1b55e4..af75e534b 100644 --- a/godot-cell/Cargo.toml +++ b/godot-cell/Cargo.toml @@ -12,6 +12,7 @@ homepage = "https://godot-rust.github.io" [features] proptest = ["dep:proptest"] +experimental-wasm-nothreads = [] [dependencies] proptest = { workspace = true, optional = true } diff --git a/godot-cell/tests/mock/blocking.rs b/godot-cell/tests/mock/blocking.rs index 18b96db42..e4b09bf94 100644 --- a/godot-cell/tests/mock/blocking.rs +++ b/godot-cell/tests/mock/blocking.rs @@ -40,6 +40,10 @@ impl MyClass { /// /// This should not cause borrow failures and should not lead to deadlocks. #[test] +#[cfg_attr( + feature = "experimental-wasm-nothreads", + ignore = "Threading not available" +)] fn calls_parallel() { use std::thread; @@ -72,6 +76,10 @@ fn calls_parallel() { /// Runs each method several times in a row. This should reduce the non-determinism that comes from /// scheduling of threads. #[test] +#[cfg_attr( + feature = "experimental-wasm-nothreads", + ignore = "Threading not available" +)] fn calls_parallel_many_serial() { use std::thread; @@ -106,6 +114,10 @@ fn calls_parallel_many_serial() { /// Runs all the tests several times. This is different from [`calls_parallel_many_serial`] as that calls the /// methods like AAA...BBB...CCC..., whereas this interleaves the methods like ABC...ABC...ABC... #[test] +#[cfg_attr( + feature = "experimental-wasm-nothreads", + ignore = "Threading not available" +)] fn calls_parallel_many_parallel() { use std::thread; @@ -142,6 +154,10 @@ fn calls_parallel_many_parallel() { /// a) Thread A holds mutable reference AND thread B holds no references. /// b) One or more threads hold shared references AND thread A holds no references #[test] +#[cfg_attr( + feature = "experimental-wasm-nothreads", + ignore = "Threading not available" +)] fn non_blocking_reborrow() { use std::thread; let instance_id = MyClass::init(); @@ -172,6 +188,10 @@ fn non_blocking_reborrow() { /// This verifies that the thread which initialized the `GdCell` does not panic when it attempts to mutably borrow while there is already a /// shared borrow on an other thread. #[test] +#[cfg_attr( + feature = "experimental-wasm-nothreads", + ignore = "Threading not available" +)] fn no_mut_panic_on_main() { use std::thread; let instance_id = MyClass::init(); diff --git a/godot-cell/tests/mock/panicking.rs b/godot-cell/tests/mock/panicking.rs index 7d279b80c..89dca8984 100644 --- a/godot-cell/tests/mock/panicking.rs +++ b/godot-cell/tests/mock/panicking.rs @@ -58,6 +58,10 @@ fn all_calls_work() { /// Run each method both from the main thread and a newly created thread. #[test] +#[cfg_attr( + feature = "experimental-wasm-nothreads", + ignore = "Threading not available" +)] fn calls_different_thread() { use std::thread; @@ -87,6 +91,10 @@ fn calls_different_thread() { /// if the first call failed, so then we know the integer was incremented by 0. Otherwise, we at least know /// the range of values that it can be incremented by. #[test] +#[cfg_attr( + feature = "experimental-wasm-nothreads", + ignore = "Threading not available" +)] fn calls_parallel() { use std::thread; @@ -121,6 +129,10 @@ fn calls_parallel() { /// Runs each method several times in a row. This should reduce the non-determinism that comes from /// scheduling of threads. #[test] +#[cfg_attr( + feature = "experimental-wasm-nothreads", + ignore = "Threading not available" +)] fn calls_parallel_many_serial() { use std::thread; @@ -157,6 +169,10 @@ fn calls_parallel_many_serial() { /// Runs all the tests several times. This is different from [`calls_parallel_many_serial`] as that calls the /// methods like AAA...BBB...CCC..., whereas this interleaves the methods like ABC...ABC...ABC... #[test] +#[cfg_attr( + feature = "experimental-wasm-nothreads", + ignore = "Threading not available" +)] fn calls_parallel_many_parallel() { use std::thread; diff --git a/godot-core/Cargo.toml b/godot-core/Cargo.toml index 9a81bc89f..cb417498b 100644 --- a/godot-core/Cargo.toml +++ b/godot-core/Cargo.toml @@ -22,7 +22,7 @@ codegen-lazy-fptrs = [ double-precision = ["godot-codegen/double-precision"] experimental-godot-api = ["godot-codegen/experimental-godot-api"] experimental-threads = ["godot-ffi/experimental-threads", "godot-codegen/experimental-threads"] -experimental-wasm-nothreads = ["godot-ffi/experimental-wasm-nothreads"] +experimental-wasm-nothreads = ["godot-ffi/experimental-wasm-nothreads", "godot-cell/experimental-wasm-nothreads"] debug-log = ["godot-ffi/debug-log"] trace = [] From 6113b0beeec6a27df52b5cbc272ded0c40d36803 Mon Sep 17 00:00:00 2001 From: PgBiel <9021226+PgBiel@users.noreply.github.com> Date: Wed, 13 Aug 2025 01:14:06 -0300 Subject: [PATCH 07/12] undo godot-cell feature since it's only used for tests --- godot-cell/Cargo.toml | 1 - godot-cell/tests/mock/blocking.rs | 20 -------------------- godot-cell/tests/mock/panicking.rs | 16 ---------------- godot-core/Cargo.toml | 2 +- 4 files changed, 1 insertion(+), 38 deletions(-) diff --git a/godot-cell/Cargo.toml b/godot-cell/Cargo.toml index af75e534b..36d1b55e4 100644 --- a/godot-cell/Cargo.toml +++ b/godot-cell/Cargo.toml @@ -12,7 +12,6 @@ homepage = "https://godot-rust.github.io" [features] proptest = ["dep:proptest"] -experimental-wasm-nothreads = [] [dependencies] proptest = { workspace = true, optional = true } diff --git a/godot-cell/tests/mock/blocking.rs b/godot-cell/tests/mock/blocking.rs index e4b09bf94..18b96db42 100644 --- a/godot-cell/tests/mock/blocking.rs +++ b/godot-cell/tests/mock/blocking.rs @@ -40,10 +40,6 @@ impl MyClass { /// /// This should not cause borrow failures and should not lead to deadlocks. #[test] -#[cfg_attr( - feature = "experimental-wasm-nothreads", - ignore = "Threading not available" -)] fn calls_parallel() { use std::thread; @@ -76,10 +72,6 @@ fn calls_parallel() { /// Runs each method several times in a row. This should reduce the non-determinism that comes from /// scheduling of threads. #[test] -#[cfg_attr( - feature = "experimental-wasm-nothreads", - ignore = "Threading not available" -)] fn calls_parallel_many_serial() { use std::thread; @@ -114,10 +106,6 @@ fn calls_parallel_many_serial() { /// Runs all the tests several times. This is different from [`calls_parallel_many_serial`] as that calls the /// methods like AAA...BBB...CCC..., whereas this interleaves the methods like ABC...ABC...ABC... #[test] -#[cfg_attr( - feature = "experimental-wasm-nothreads", - ignore = "Threading not available" -)] fn calls_parallel_many_parallel() { use std::thread; @@ -154,10 +142,6 @@ fn calls_parallel_many_parallel() { /// a) Thread A holds mutable reference AND thread B holds no references. /// b) One or more threads hold shared references AND thread A holds no references #[test] -#[cfg_attr( - feature = "experimental-wasm-nothreads", - ignore = "Threading not available" -)] fn non_blocking_reborrow() { use std::thread; let instance_id = MyClass::init(); @@ -188,10 +172,6 @@ fn non_blocking_reborrow() { /// This verifies that the thread which initialized the `GdCell` does not panic when it attempts to mutably borrow while there is already a /// shared borrow on an other thread. #[test] -#[cfg_attr( - feature = "experimental-wasm-nothreads", - ignore = "Threading not available" -)] fn no_mut_panic_on_main() { use std::thread; let instance_id = MyClass::init(); diff --git a/godot-cell/tests/mock/panicking.rs b/godot-cell/tests/mock/panicking.rs index 89dca8984..7d279b80c 100644 --- a/godot-cell/tests/mock/panicking.rs +++ b/godot-cell/tests/mock/panicking.rs @@ -58,10 +58,6 @@ fn all_calls_work() { /// Run each method both from the main thread and a newly created thread. #[test] -#[cfg_attr( - feature = "experimental-wasm-nothreads", - ignore = "Threading not available" -)] fn calls_different_thread() { use std::thread; @@ -91,10 +87,6 @@ fn calls_different_thread() { /// if the first call failed, so then we know the integer was incremented by 0. Otherwise, we at least know /// the range of values that it can be incremented by. #[test] -#[cfg_attr( - feature = "experimental-wasm-nothreads", - ignore = "Threading not available" -)] fn calls_parallel() { use std::thread; @@ -129,10 +121,6 @@ fn calls_parallel() { /// Runs each method several times in a row. This should reduce the non-determinism that comes from /// scheduling of threads. #[test] -#[cfg_attr( - feature = "experimental-wasm-nothreads", - ignore = "Threading not available" -)] fn calls_parallel_many_serial() { use std::thread; @@ -169,10 +157,6 @@ fn calls_parallel_many_serial() { /// Runs all the tests several times. This is different from [`calls_parallel_many_serial`] as that calls the /// methods like AAA...BBB...CCC..., whereas this interleaves the methods like ABC...ABC...ABC... #[test] -#[cfg_attr( - feature = "experimental-wasm-nothreads", - ignore = "Threading not available" -)] fn calls_parallel_many_parallel() { use std::thread; diff --git a/godot-core/Cargo.toml b/godot-core/Cargo.toml index cb417498b..9a81bc89f 100644 --- a/godot-core/Cargo.toml +++ b/godot-core/Cargo.toml @@ -22,7 +22,7 @@ codegen-lazy-fptrs = [ double-precision = ["godot-codegen/double-precision"] experimental-godot-api = ["godot-codegen/experimental-godot-api"] experimental-threads = ["godot-ffi/experimental-threads", "godot-codegen/experimental-threads"] -experimental-wasm-nothreads = ["godot-ffi/experimental-wasm-nothreads", "godot-cell/experimental-wasm-nothreads"] +experimental-wasm-nothreads = ["godot-ffi/experimental-wasm-nothreads"] debug-log = ["godot-ffi/debug-log"] trace = [] From 0f8ad4bc8bbaedcc249d9027d3fc76fbf598acd8 Mon Sep 17 00:00:00 2001 From: PgBiel <9021226+PgBiel@users.noreply.github.com> Date: Wed, 13 Aug 2025 01:16:33 -0300 Subject: [PATCH 08/12] check wasm with atomics to run threaded tests no feature needed --- godot-cell/tests/mock/blocking.rs | 20 ++++++++++++++++++++ godot-cell/tests/mock/panicking.rs | 16 ++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/godot-cell/tests/mock/blocking.rs b/godot-cell/tests/mock/blocking.rs index 18b96db42..7402d0056 100644 --- a/godot-cell/tests/mock/blocking.rs +++ b/godot-cell/tests/mock/blocking.rs @@ -40,6 +40,10 @@ impl MyClass { /// /// This should not cause borrow failures and should not lead to deadlocks. #[test] +#[cfg_attr( + all(target_family = "wasm", not(target_feature = "atomics")), + ignore = "Threading not available" +)] fn calls_parallel() { use std::thread; @@ -72,6 +76,10 @@ fn calls_parallel() { /// Runs each method several times in a row. This should reduce the non-determinism that comes from /// scheduling of threads. #[test] +#[cfg_attr( + all(target_family = "wasm", not(target_feature = "atomics")), + ignore = "Threading not available" +)] fn calls_parallel_many_serial() { use std::thread; @@ -106,6 +114,10 @@ fn calls_parallel_many_serial() { /// Runs all the tests several times. This is different from [`calls_parallel_many_serial`] as that calls the /// methods like AAA...BBB...CCC..., whereas this interleaves the methods like ABC...ABC...ABC... #[test] +#[cfg_attr( + all(target_family = "wasm", not(target_feature = "atomics")), + ignore = "Threading not available" +)] fn calls_parallel_many_parallel() { use std::thread; @@ -142,6 +154,10 @@ fn calls_parallel_many_parallel() { /// a) Thread A holds mutable reference AND thread B holds no references. /// b) One or more threads hold shared references AND thread A holds no references #[test] +#[cfg_attr( + all(target_family = "wasm", not(target_feature = "atomics")), + ignore = "Threading not available" +)] fn non_blocking_reborrow() { use std::thread; let instance_id = MyClass::init(); @@ -172,6 +188,10 @@ fn non_blocking_reborrow() { /// This verifies that the thread which initialized the `GdCell` does not panic when it attempts to mutably borrow while there is already a /// shared borrow on an other thread. #[test] +#[cfg_attr( + all(target_family = "wasm", not(target_feature = "atomics")), + ignore = "Threading not available" +)] fn no_mut_panic_on_main() { use std::thread; let instance_id = MyClass::init(); diff --git a/godot-cell/tests/mock/panicking.rs b/godot-cell/tests/mock/panicking.rs index 7d279b80c..36fa88ea8 100644 --- a/godot-cell/tests/mock/panicking.rs +++ b/godot-cell/tests/mock/panicking.rs @@ -58,6 +58,10 @@ fn all_calls_work() { /// Run each method both from the main thread and a newly created thread. #[test] +#[cfg_attr( + all(target_family = "wasm", not(target_feature = "atomics")), + ignore = "Threading not available" +)] fn calls_different_thread() { use std::thread; @@ -87,6 +91,10 @@ fn calls_different_thread() { /// if the first call failed, so then we know the integer was incremented by 0. Otherwise, we at least know /// the range of values that it can be incremented by. #[test] +#[cfg_attr( + all(target_family = "wasm", not(target_feature = "atomics")), + ignore = "Threading not available" +)] fn calls_parallel() { use std::thread; @@ -121,6 +129,10 @@ fn calls_parallel() { /// Runs each method several times in a row. This should reduce the non-determinism that comes from /// scheduling of threads. #[test] +#[cfg_attr( + all(target_family = "wasm", not(target_feature = "atomics")), + ignore = "Threading not available" +)] fn calls_parallel_many_serial() { use std::thread; @@ -157,6 +169,10 @@ fn calls_parallel_many_serial() { /// Runs all the tests several times. This is different from [`calls_parallel_many_serial`] as that calls the /// methods like AAA...BBB...CCC..., whereas this interleaves the methods like ABC...ABC...ABC... #[test] +#[cfg_attr( + all(target_family = "wasm", not(target_feature = "atomics")), + ignore = "Threading not available" +)] fn calls_parallel_many_parallel() { use std::thread; From 4e9a8a39ae5c38a097d1890ded5feea2a8f04223 Mon Sep 17 00:00:00 2001 From: PgBiel <9021226+PgBiel@users.noreply.github.com> Date: Thu, 14 Aug 2025 22:18:58 -0300 Subject: [PATCH 09/12] run web unit tests on ci --- .github/workflows/minimal-ci.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/.github/workflows/minimal-ci.yml b/.github/workflows/minimal-ci.yml index 3592f05da..8cd21c0c0 100644 --- a/.github/workflows/minimal-ci.yml +++ b/.github/workflows/minimal-ci.yml @@ -128,6 +128,33 @@ jobs: run: cargo test $TEST_FEATURES + unit-test-web: + name: unit-test-web + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + + - name: "Patch Cargo.toml to use nightly extension API" + run: .github/other/patch-prebuilt.sh nightly + + - name: "Install Rust" + uses: ./.github/composite/rust + with: + rust: nightly + + - name: "Install emscripten" + run: | + git clone https://github.com/emscripten-core/emsdk.git + pushd emsdk + ./emsdk install 3.1.74 + ./emsdk activate 3.1.74 + source ./emsdk.sh + popd + + - name: "Test (Wasm)" + run: ./check.sh testweb + + # For complex matrix workflow, see https://stackoverflow.com/a/65434401 godot-itest: name: godot-itest (${{ matrix.name }}) From dfc7f80f03351e619754c323ad18d9109a8b8909 Mon Sep 17 00:00:00 2001 From: PgBiel <9021226+PgBiel@users.noreply.github.com> Date: Thu, 14 Aug 2025 22:29:42 -0300 Subject: [PATCH 10/12] update to emsdk_env.sh this needs fixing in the book --- .github/workflows/minimal-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/minimal-ci.yml b/.github/workflows/minimal-ci.yml index 8cd21c0c0..eaba9f62d 100644 --- a/.github/workflows/minimal-ci.yml +++ b/.github/workflows/minimal-ci.yml @@ -148,7 +148,7 @@ jobs: pushd emsdk ./emsdk install 3.1.74 ./emsdk activate 3.1.74 - source ./emsdk.sh + source ./emsdk_env.sh popd - name: "Test (Wasm)" From 328abbd8a4d38d7a28a859c6349b9e1ed751e6f6 Mon Sep 17 00:00:00 2001 From: PgBiel <9021226+PgBiel@users.noreply.github.com> Date: Thu, 14 Aug 2025 22:36:25 -0300 Subject: [PATCH 11/12] pin emscripten on ci this might call for another composite... second attempt at pinning emscripten --- .github/workflows/minimal-ci.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/minimal-ci.yml b/.github/workflows/minimal-ci.yml index eaba9f62d..789605f39 100644 --- a/.github/workflows/minimal-ci.yml +++ b/.github/workflows/minimal-ci.yml @@ -143,13 +143,15 @@ jobs: rust: nightly - name: "Install emscripten" + env: + EMSCRIPTEN_SRC_REF: 4.0.13 + EMSCRIPTEN_VERSION: 3.1.74 run: | - git clone https://github.com/emscripten-core/emsdk.git - pushd emsdk - ./emsdk install 3.1.74 - ./emsdk activate 3.1.74 - source ./emsdk_env.sh - popd + git clone https://github.com/emscripten-core/emsdk.git --depth 1 --branch $EMSCRIPTEN_SRC_REF --single-branch + ./emsdk/emsdk install $EMSCRIPTEN_VERSION + ./emsdk/emsdk activate $EMSCRIPTEN_VERSION + source ./emsdk/emsdk_env.sh + echo PATH=$PATH >> $GITHUB_ENV - name: "Test (Wasm)" run: ./check.sh testweb From 27dab3d6219fdf2bef1e1a474fe6890d11ec2f1e Mon Sep 17 00:00:00 2001 From: PgBiel <9021226+PgBiel@users.noreply.github.com> Date: Thu, 14 Aug 2025 22:36:57 -0300 Subject: [PATCH 12/12] add rust src component to ci --- .github/workflows/minimal-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/minimal-ci.yml b/.github/workflows/minimal-ci.yml index 789605f39..85da6e168 100644 --- a/.github/workflows/minimal-ci.yml +++ b/.github/workflows/minimal-ci.yml @@ -141,6 +141,7 @@ jobs: uses: ./.github/composite/rust with: rust: nightly + components: rust-src - name: "Install emscripten" env: