From 9f90371503647388d2b416164a6c1bdad5c3951d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Magnenat?= Date: Fri, 12 Jun 2026 10:03:56 +0200 Subject: [PATCH 1/3] Use itertools chunk_by instead of group_by as the later has been deprecated since version 0.13.0, and box2d-rs uses version 0.14 --- examples/testbed/main_loop.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/testbed/main_loop.rs b/examples/testbed/main_loop.rs index 1a19c91..8c5613b 100644 --- a/examples/testbed/main_loop.rs +++ b/examples/testbed/main_loop.rs @@ -572,7 +572,7 @@ impl System { TabItem::new("Tests").build(ui, || { let tests = &g_test_entries; - for (key, group) in &tests.into_iter().group_by(|v| v.category) { + for (key, group) in &tests.into_iter().chunk_by(|v| v.category) { let category_selected: bool = g_test_entries[s_settings.m_test_index as usize].category == key; From e4dfc73168cc870ee645d7c6d44e1ab45206ae2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Magnenat?= Date: Fri, 12 Jun 2026 10:14:55 +0200 Subject: [PATCH 2/3] Install fontconfig dependency needed to compile in CI. --- .github/workflows/rust.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index cfbae61..ea9272b 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -17,8 +17,10 @@ jobs: runs-on: ubuntu-latest steps: - - name: Install xmllint - run: sudo apt-get install libxcb-composite0-dev + - name: Install Linux dependencies + run: | + sudo apt-get update + sudo apt-get install -y libfontconfig-dev libxcb-composite0-dev - uses: actions/checkout@v2 - name: Build run: cargo build --verbose --examples --tests --features serde_support From 0b77ee2d280b889f898ec75a085b2e4381e394bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Magnenat?= Date: Fri, 12 Jun 2026 13:06:43 +0200 Subject: [PATCH 3/3] Use web-time for wasm timers --- Cargo.toml | 3 +++ README.md | 2 +- src/b2_timer.rs | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 7ed5311..b022ae7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,6 +22,9 @@ serde = {version = "1.0.163", features = ["derive"], optional = true} strum = {version = "0.27.2", optional = true} strum_macros = {version ="0.27.2", optional = true} +[target.'cfg(all(target_arch = "wasm32", target_os = "unknown"))'.dependencies] +web-time = "1.1" + [features] serde_support = ["serde", "strum", "strum_macros"] diff --git a/README.md b/README.md index 5afc897..adb7aa7 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ A native port of [Box2D](https://github.com/erincatto/box2d) to Rust. -Minimum Rust version: 1.56.0 (1.61 for dev-dependecies) +Minimum Rust version: 1.56.0 (1.61 for dev-dependecies, 1.60 for `wasm32-unknown-unknown` support) Ported Box2D version: 2.4.2 diff --git a/src/b2_timer.rs b/src/b2_timer.rs index 40eec6a..8d90ba7 100644 --- a/src/b2_timer.rs +++ b/src/b2_timer.rs @@ -1,4 +1,7 @@ +#[cfg(not(all(target_arch = "wasm32", target_os = "unknown")))] use std::time::Instant; +#[cfg(all(target_arch = "wasm32", target_os = "unknown"))] +use web_time::Instant; pub struct B2timer { start: Instant,