From 297d5bef3e046b7d26737f695ff63003e98556a4 Mon Sep 17 00:00:00 2001 From: Martin Habovstiak Date: Fri, 21 Mar 2025 08:34:52 +0100 Subject: [PATCH 1/2] Test wasm with pinned dependencies So far testing was was done unpinned however that risked randomly breaking builds whenever a dependency changes by accident. There was a note explicitly acknowledging lack of pinning but with no explanation why that was the case. So it might be because the author didn't want to bother and pinning can be implemented. --- .github/workflows/rust.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index b8746b806..d08c10bf2 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -254,16 +254,18 @@ jobs: run: cargo test --target i686-unknown-linux-gnu WASM: - name: WASM - stable toolchain + name: WASM - MSRV toolchain runs-on: ubuntu-latest strategy: fail-fast: false - # Note we do not use the recent lock file for wasm testing. steps: - name: "Checkout repo" uses: actions/checkout@v4 - name: "Select toolchain" - uses: dtolnay/rust-toolchain@stable + uses: dtolnay/rust-toolchain@1.63.0 + - name: "Set dependencies" + # For now we only use minimal lock + run: cp Cargo-minimal.lock Cargo.lock - name: "Run wasm script" run: ./contrib/wasm.sh From f9a7ea8e8f4a0584a998cc820f43c9411a5cdf1b Mon Sep 17 00:00:00 2001 From: Martin Habovstiak Date: Fri, 21 Mar 2025 08:37:28 +0100 Subject: [PATCH 2/2] Pin wasm-pack version As with anything else, downloading a random version from crates risks breaking CI. This change decreases the risk by pinning the crate but so far makes *no attempts* at trying to update it in a cron job. It would be definitely a nice addition later. --- contrib/wasm.sh | 2 +- wasm-pack-version | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 wasm-pack-version diff --git a/contrib/wasm.sh b/contrib/wasm.sh index 3d8bd8b9b..1d1bcb077 100755 --- a/contrib/wasm.sh +++ b/contrib/wasm.sh @@ -8,7 +8,7 @@ set -euox pipefail clang --version -CARGO_TARGET_DIR=wasm cargo install --force wasm-pack +CARGO_TARGET_DIR=wasm cargo install --locked --force wasm-pack --version "`cat wasm-pack-version`" printf '\n[lib]\ncrate-type = ["cdylib", "rlib"]\n' >> Cargo.toml CC=clang wasm-pack build CC=clang wasm-pack test --node diff --git a/wasm-pack-version b/wasm-pack-version new file mode 100644 index 000000000..c317a9189 --- /dev/null +++ b/wasm-pack-version @@ -0,0 +1 @@ +0.13.1