From 00e2b5e2e45183d6dc1d927f0a001ee8f0833b50 Mon Sep 17 00:00:00 2001 From: Lachlan Deakin Date: Tue, 28 Apr 2026 10:51:28 +1000 Subject: [PATCH 1/3] feat(CI): WASM check --- .github/workflows/ci.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 29354d1..177218c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -80,3 +80,13 @@ jobs: - uses: dtolnay/rust-toolchain@nightly - run: cargo update -Z minimal-versions - run: cargo check --all-features + + wasm: + name: WASM + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - uses: dtolnay/rust-toolchain@stable + with: + targets: wasm32-unknown-unknown + - run: cargo check --all-features --target wasm32-unknown-unknown From 0d4abe3dcddd70e213cb77d35e52cbb7f7146973 Mon Sep 17 00:00:00 2001 From: Lachlan Deakin Date: Tue, 28 Apr 2026 10:55:34 +1000 Subject: [PATCH 2/3] fix: getrandom WASM build --- Cargo.lock | 3 +++ Cargo.toml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index a021887..61c4308 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -88,9 +88,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" dependencies = [ "cfg-if", + "js-sys", "libc", "r-efi", "wasip2", + "wasm-bindgen", ] [[package]] @@ -136,6 +138,7 @@ name = "microfloat" version = "0.1.0" dependencies = [ "bytemuck", + "getrandom", "libm", "num-traits", "proptest", diff --git a/Cargo.toml b/Cargo.toml index b52718c..2f9bb3f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -34,5 +34,8 @@ rand_distr = ["dep:rand", "dep:rand_distr"] [dev-dependencies] proptest = { version = "1.11", default-features = false, features = ["std"] } +[target.'cfg(target_arch = "wasm32")'.dependencies] +getrandom = { version = "0.3", features = ["wasm_js"] } + [package.metadata.docs.rs] all-features = true From b1fa29311f7207aa0ccc1546198d7417e7f8590b Mon Sep 17 00:00:00 2001 From: Lachlan Deakin Date: Tue, 28 Apr 2026 10:56:06 +1000 Subject: [PATCH 3/3] chore: changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d6424b..14bcf55 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Enable semver checks in CI - Add `documentation` to `Cargo.toml` +### Fixed + +- Fix WASM build + ## [0.1.0](https://github.com/LDeakin/microfloat/releases/tag/v0.1.0) - 2026-04-28 ### Added