From b98b3fd81a6be90091915a21e1ba70981d75a6e2 Mon Sep 17 00:00:00 2001 From: Thierry Berger Date: Mon, 26 Aug 2024 14:02:09 +0200 Subject: [PATCH 1/2] update bevy 0.14 + fix some warnings --- Cargo.toml | 15 ++++++---- build/salva2d/Cargo.toml | 60 +++++++++++++++++++++++-------------- build/salva3d/Cargo.toml | 52 +++++++++++++++++++------------- examples2d/Cargo.toml | 25 +++++++--------- examples2d/all_examples2.rs | 4 +-- examples3d/Cargo.toml | 20 ++++++------- examples3d/all_examples3.rs | 4 +-- 7 files changed, 104 insertions(+), 76 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 0d1c81f..7873b35 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,12 @@ [workspace] -members = [ "build/salva2d", "build/salva3d", "examples2d", "examples3d" ] +members = ["build/salva2d", "build/salva3d", "examples2d", "examples3d"] resolver = "2" +[workspace.lints] +rust.unexpected_cfgs = { level = "warn", check-cfg = [ + 'cfg(feature, values("dim2", "dim3", "nphysics", "ncollide"))', +] } + [profile.release] #lto = true #codegen-units = 1 @@ -32,10 +37,10 @@ salva3d = { path = "./build/salva3d" } # rapier_testbed2d = { git = "https://github.com/dimforge/rapier", rev = "3b0d256" } # rapier_testbed3d = { git = "https://github.com/dimforge/rapier", rev = "3b0d256" } -# rapier2d = { path = "../rapier/build/rapier2d" } -# rapier3d = { path = "../rapier/build/rapier3d" } -# rapier_testbed2d = { path = "../rapier/build/rapier_testbed2d" } -# rapier_testbed3d = { path = "../rapier/build/rapier_testbed3d" } +rapier2d = { path = "../rapier/crates/rapier2d" } +rapier3d = { path = "../rapier/crates/rapier3d" } +rapier_testbed2d = { path = "../rapier/crates/rapier_testbed2d" } +rapier_testbed3d = { path = "../rapier/crates/rapier_testbed3d" } #nphysics2d = { path = "../nphysics/build/nphysics2d" } #nphysics3d = { path = "../nphysics/build/nphysics3d" } diff --git a/build/salva2d/Cargo.toml b/build/salva2d/Cargo.toml index b093b98..c4a2da9 100644 --- a/build/salva2d/Cargo.toml +++ b/build/salva2d/Cargo.toml @@ -1,36 +1,45 @@ [package] -name = "salva2d" +name = "salva2d" version = "0.9.0" -authors = [ "Sébastien Crozet " ] +authors = ["Sébastien Crozet "] description = "2-dimensional particle-based fluid dynamics in Rust." documentation = "https://salva.rs/docs" homepage = "https://salva.rs" repository = "https://github.com/dimforge/salva" readme = "README.md" -categories = [ "science", "game-development", "mathematics", "simulation", "wasm"] -keywords = [ "physics", "dynamics", "particles", "fluids", "SPH" ] +categories = [ + "science", + "game-development", + "mathematics", + "simulation", + "wasm", +] +keywords = ["physics", "dynamics", "particles", "fluids", "SPH"] license = "Apache-2.0" edition = "2021" +[lints] +workspace = true + [badges] maintenance = { status = "actively-developed" } [features] -default = [ "dim2" ] -dim2 = [ ] -parallel = [ "rayon" ] -sampling = [ "rapier" ] -rapier = [ "parry", "rapier2d" ] -rapier-testbed = [ "rapier", "rapier_testbed2d", "graphics" ] -rapier-harness = [ "rapier-testbed" ] -parry = [ "parry2d" ] -wasm-bindgen = [ "rapier2d/wasm-bindgen" ] -graphics = [ "bevy", "bevy_egui" ] +default = ["dim2"] +dim2 = [] +parallel = ["rayon"] +sampling = ["rapier"] +rapier = ["parry", "rapier2d"] +rapier-testbed = ["rapier", "rapier_testbed2d", "graphics"] +rapier-harness = ["rapier-testbed"] +parry = ["parry2d"] +wasm-bindgen = ["rapier2d/wasm-bindgen"] +graphics = ["bevy", "bevy_egui"] [lib] name = "salva2d" path = "../../src/lib.rs" -required-features = [ "dim2" ] +required-features = ["dim2"] [dependencies] approx = "0.5" @@ -38,19 +47,26 @@ num-traits = "0.2" fnv = "1.0" itertools = "0.13" generational-arena = "0.2" -instant = { version = "0.1", features = [ "now" ] } +instant = { version = "0.1", features = ["now"] } rayon = { version = "1.8", optional = true } nalgebra = "0.33" -parry2d = { version = "0.16", optional = true } -rapier2d = { version = "0.21", optional = true } -rapier_testbed2d = { version = "0.21", optional = true } +parry2d = { version = "0.17", optional = true } +rapier2d = { version = "0.22", optional = true } +rapier_testbed2d = { version = "0.22", optional = true } -bevy_egui = { version = "0.26", features = ["immutable_ctx"], optional = true } +bevy_egui = { version = "0.29", features = ["immutable_ctx"], optional = true } [target.'cfg(not(target_arch = "wasm32"))'.dependencies] -bevy = { version = "0.13.2", default-features = false, features = ["bevy_winit", "bevy_render", "x11"], optional = true } +bevy = { version = "0.14", default-features = false, features = [ + "bevy_winit", + "bevy_render", + "x11", +], optional = true } # Dependencies for WASM only. [target.'cfg(target_arch = "wasm32")'.dependencies] -bevy = { version = "0.13", default-features = false, features = ["bevy_winit", "bevy_render"], optional = true } +bevy = { version = "0.14", default-features = false, features = [ + "bevy_winit", + "bevy_render", +], optional = true } diff --git a/build/salva3d/Cargo.toml b/build/salva3d/Cargo.toml index 02ab3f1..98ba109 100644 --- a/build/salva3d/Cargo.toml +++ b/build/salva3d/Cargo.toml @@ -1,32 +1,35 @@ [package] -name = "salva3d" +name = "salva3d" version = "0.9.0" -authors = [ "Sébastien Crozet " ] +authors = ["Sébastien Crozet "] description = "3-dimensional particle-based fluid dynamics in Rust." documentation = "https://salva.rs/rustdoc/salva3d/index.html" homepage = "https://salva.rs" repository = "https://github.com/dimforge/salva" readme = "README.md" -keywords = [ "physics", "dynamics", "particles", "fluids", "SPH" ] +keywords = ["physics", "dynamics", "particles", "fluids", "SPH"] license = "Apache-2.0" edition = "2021" [features] -default = [ "dim3" ] -dim3 = [ ] -parallel = [ "rayon" ] -rapier = [ "parry", "rapier3d" ] -sampling = [ "rapier" ] -rapier-testbed = [ "rapier", "rapier_testbed3d", "graphics" ] -rapier-harness = [ "rapier-testbed" ] -parry = [ "parry3d" ] -wasm-bindgen = [ "rapier3d/wasm-bindgen" ] -graphics = [ "bevy", "bevy_egui" ] +default = ["dim3"] +dim3 = [] +parallel = ["rayon"] +rapier = ["parry", "rapier3d"] +sampling = ["rapier"] +rapier-testbed = ["rapier", "rapier_testbed3d", "graphics"] +rapier-harness = ["rapier-testbed"] +parry = ["parry3d"] +wasm-bindgen = ["rapier3d/wasm-bindgen"] +graphics = ["bevy", "bevy_egui"] + +[lints] +workspace = true [lib] name = "salva3d" path = "../../src/lib.rs" -required-features = [ "dim3" ] +required-features = ["dim3"] [dependencies] approx = "0.5" @@ -34,19 +37,26 @@ num-traits = "0.2" fnv = "1.0" itertools = "0.13" generational-arena = "0.2" -instant = { version = "0.1", features = [ "now" ] } +instant = { version = "0.1", features = ["now"] } rayon = { version = "1.8", optional = true } nalgebra = "0.33" -parry3d = { version = "0.16", optional = true } -rapier3d = { version = "0.21", optional = true } -rapier_testbed3d = { version = "0.21", optional = true } +parry3d = { version = "0.17", optional = true } +rapier3d = { version = "0.22", optional = true } +rapier_testbed3d = { version = "0.22", optional = true } -bevy_egui = { version = "0.26", features = ["immutable_ctx"], optional = true } +bevy_egui = { version = "0.29", features = ["immutable_ctx"], optional = true } [target.'cfg(not(target_arch = "wasm32"))'.dependencies] -bevy = { version = "0.13", default-features = false, features = ["bevy_winit", "bevy_render", "x11"], optional = true } +bevy = { version = "0.14", default-features = false, features = [ + "bevy_winit", + "bevy_render", + "x11", +], optional = true } # Dependencies for WASM only. [target.'cfg(target_arch = "wasm32")'.dependencies] -bevy = { version = "0.13", default-features = false, features = ["bevy_winit", "bevy_render"], optional = true } +bevy = { version = "0.14", default-features = false, features = [ + "bevy_winit", + "bevy_render", +], optional = true } diff --git a/examples2d/Cargo.toml b/examples2d/Cargo.toml index ec07788..778a48b 100644 --- a/examples2d/Cargo.toml +++ b/examples2d/Cargo.toml @@ -1,25 +1,25 @@ [package] -name = "examples2d" +name = "examples2d" version = "0.1.0" -authors = [ "Sébastien Crozet " ] +authors = ["Sébastien Crozet "] edition = "2018" [features] default = [] -parallel = [ "rapier_testbed2d/parallel"] +parallel = ["rapier_testbed2d/parallel"] [dependencies] -Inflector = "0.11" -nalgebra = "0.33" -parry2d = "0.16" -rapier2d = "0.21" -rapier_testbed2d = "0.21" -parry3d = "0.16" -bevy = "0.13.2" +Inflector = "0.11" +nalgebra = "0.33" +parry2d = "0.17" +rapier2d = "0.22" +rapier_testbed2d = "0.22" +parry3d = "0.17" +bevy = "0.14" [dependencies.salva2d] path = "../build/salva2d" -features = [ "rapier", "rapier-testbed", "sampling" ] +features = ["rapier", "rapier-testbed", "sampling"] [target.wasm32-unknown-unknown.dependencies] stdweb = "0.4" @@ -27,9 +27,6 @@ stdweb = "0.4" [target.wasm32-unknown-emscripten.dependencies] stdweb = "0.4" -[target.asmjs-unknown-emscripten.dependencies] -stdweb = "0.4" - [[bin]] name = "all_examples2" path = "./all_examples2.rs" diff --git a/examples2d/all_examples2.rs b/examples2d/all_examples2.rs index 30be6a8..0685ed0 100644 --- a/examples2d/all_examples2.rs +++ b/examples2d/all_examples2.rs @@ -23,7 +23,7 @@ fn demo_name_from_command_line() -> Option { None } -#[cfg(any(target_arch = "wasm32", target_arch = "asmjs"))] +#[cfg(any(target_arch = "wasm32"))] fn demo_name_from_url() -> Option { let window = stdweb::web::window(); let hash = window.location()?.search().ok()?; @@ -34,7 +34,7 @@ fn demo_name_from_url() -> Option { } } -#[cfg(not(any(target_arch = "wasm32", target_arch = "asmjs")))] +#[cfg(not(any(target_arch = "wasm32")))] fn demo_name_from_url() -> Option { None } diff --git a/examples3d/Cargo.toml b/examples3d/Cargo.toml index cd71aeb..0d6a690 100644 --- a/examples3d/Cargo.toml +++ b/examples3d/Cargo.toml @@ -1,25 +1,25 @@ [package] -name = "examples3d" +name = "examples3d" version = "0.1.0" -authors = [ "Sébastien Crozet " ] +authors = ["Sébastien Crozet "] edition = "2018" [features] default = [] -parallel = [ "rapier_testbed3d/parallel", "salva3d/parallel"] +parallel = ["rapier_testbed3d/parallel", "salva3d/parallel"] [dependencies] num-traits = "0.2" -Inflector = "0.11" -nalgebra = "0.33" -rapier3d = "0.21" -rapier_testbed3d = "0.21" -parry3d = "0.16" -bevy = "0.13.2" +Inflector = "0.11" +nalgebra = "0.33" +rapier3d = "0.22" +rapier_testbed3d = "0.22" +parry3d = "0.17" +bevy = "0.14" [dependencies.salva3d] path = "../build/salva3d" -features = [ "rapier", "rapier-testbed", "sampling", "rapier-harness" ] +features = ["rapier", "rapier-testbed", "sampling", "rapier-harness"] [target.wasm32-unknown-unknown.dependencies] stdweb = "0.4" diff --git a/examples3d/all_examples3.rs b/examples3d/all_examples3.rs index 85bb0c0..f02addf 100644 --- a/examples3d/all_examples3.rs +++ b/examples3d/all_examples3.rs @@ -27,7 +27,7 @@ fn demo_name_from_command_line() -> Option { None } -#[cfg(any(target_arch = "wasm32", target_arch = "asmjs"))] +#[cfg(any(target_arch = "wasm32"))] fn demo_name_from_url() -> Option { None // let window = stdweb::web::window(); @@ -39,7 +39,7 @@ fn demo_name_from_url() -> Option { // } } -#[cfg(not(any(target_arch = "wasm32", target_arch = "asmjs")))] +#[cfg(not(any(target_arch = "wasm32")))] fn demo_name_from_url() -> Option { None } From 8ec386de744c9001c928d899ccb1041d4ada0345 Mon Sep 17 00:00:00 2001 From: Thierry Berger Date: Mon, 9 Sep 2024 11:10:49 +0200 Subject: [PATCH 2/2] rely on github rather than local path --- Cargo.toml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 7873b35..995d754 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,20 +27,20 @@ salva3d = { path = "./build/salva3d" } #rapier_testbed2d = { git = "https://github.com/dimforge/rapier", branch = "split_geom" } #rapier_testbed3d = { git = "https://github.com/dimforge/rapier", branch = "split_geom" } -#rapier2d = { git = "https://github.com/dimforge/rapier" } -#rapier3d = { git = "https://github.com/dimforge/rapier" } -#rapier_testbed2d = { git = "https://github.com/dimforge/rapier" } -#rapier_testbed3d = { git = "https://github.com/dimforge/rapier" } +rapier2d = { git = "https://github.com/dimforge/rapier" } +rapier3d = { git = "https://github.com/dimforge/rapier" } +rapier_testbed2d = { git = "https://github.com/dimforge/rapier" } +rapier_testbed3d = { git = "https://github.com/dimforge/rapier" } # rapier2d = { git = "https://github.com/dimforge/rapier", rev = "3b0d256" } # rapier3d = { git = "https://github.com/dimforge/rapier", rev = "3b0d256" } # rapier_testbed2d = { git = "https://github.com/dimforge/rapier", rev = "3b0d256" } # rapier_testbed3d = { git = "https://github.com/dimforge/rapier", rev = "3b0d256" } -rapier2d = { path = "../rapier/crates/rapier2d" } -rapier3d = { path = "../rapier/crates/rapier3d" } -rapier_testbed2d = { path = "../rapier/crates/rapier_testbed2d" } -rapier_testbed3d = { path = "../rapier/crates/rapier_testbed3d" } +# rapier2d = { path = "../rapier/crates/rapier2d" } +# rapier3d = { path = "../rapier/crates/rapier3d" } +# rapier_testbed2d = { path = "../rapier/crates/rapier_testbed2d" } +# rapier_testbed3d = { path = "../rapier/crates/rapier_testbed3d" } #nphysics2d = { path = "../nphysics/build/nphysics2d" } #nphysics3d = { path = "../nphysics/build/nphysics3d" }