From 452cf24fa1f96188eb3314397e2b7ad6dfe136a9 Mon Sep 17 00:00:00 2001 From: Andreas Reich Date: Mon, 13 May 2024 01:05:00 +0200 Subject: [PATCH] Remove unnecessary Cargo.toml dependencies via `cargo machete` (#5692) --- Cargo.lock | 10 ---------- deno_webgpu/Cargo.toml | 5 ----- examples/Cargo.toml | 6 ++++-- naga-cli/Cargo.toml | 1 - tests/Cargo.toml | 5 ----- wgpu-core/Cargo.toml | 10 ++++------ wgpu-hal/Cargo.toml | 4 ++++ wgpu-info/Cargo.toml | 1 - wgpu/Cargo.toml | 6 +++++- 9 files changed, 17 insertions(+), 31 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index eee65954e..51f377980 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1086,7 +1086,6 @@ dependencies = [ "serde", "tokio", "wgpu-core", - "wgpu-hal", "wgpu-types", ] @@ -2174,7 +2173,6 @@ dependencies = [ "bincode", "codespan-reporting", "env_logger", - "log", "naga", ] @@ -4060,7 +4058,6 @@ name = "wgpu" version = "0.20.0" dependencies = [ "arrayvec 0.7.4", - "cfg-if", "cfg_aliases", "document-features", "js-sys", @@ -4102,7 +4099,6 @@ dependencies = [ "serde", "smallvec", "thiserror", - "web-sys", "wgpu-hal", "wgpu-types", ] @@ -4121,7 +4117,6 @@ dependencies = [ "flume", "getrandom", "glam", - "js-sys", "ktx2", "log", "nanorand", @@ -4135,7 +4130,6 @@ dependencies = [ "web-sys", "web-time", "wgpu", - "wgpu-hal", "wgpu-test", "winit 0.29.15", ] @@ -4199,7 +4193,6 @@ dependencies = [ "serde", "serde_json", "wgpu", - "wgpu-types", ] [[package]] @@ -4224,18 +4217,15 @@ dependencies = [ "ctor", "env_logger", "futures-lite", - "heck 0.5.0", "image", "js-sys", "libtest-mimic", "log", - "naga", "nv-flip", "parking_lot", "png", "pollster", "profiling", - "raw-window-handle 0.6.1", "serde", "serde_json", "wasm-bindgen", diff --git a/deno_webgpu/Cargo.toml b/deno_webgpu/Cargo.toml index 8b56e324b..ba72507dd 100644 --- a/deno_webgpu/Cargo.toml +++ b/deno_webgpu/Cargo.toml @@ -44,11 +44,6 @@ features = ["metal"] workspace = true features = ["dx12"] -[target.'cfg(windows)'.dependencies.wgpu-hal] -version = "0.20.0" -path = "../wgpu-hal" -features = ["windows_rs"] - # We want the wgpu-core Vulkan backend on Unix (but not Emscripten) and Windows. [target.'cfg(any(windows, all(unix, not(target_os = "emscripten"))))'.dependencies.wgpu-core] workspace = true diff --git a/examples/Cargo.toml b/examples/Cargo.toml index 9d5785108..902dcc210 100644 --- a/examples/Cargo.toml +++ b/examples/Cargo.toml @@ -10,6 +10,10 @@ keywords.workspace = true license.workspace = true publish = false +[package.metadata.cargo-machete] +# Cargo machete struggles with this dev dependency: +ignored = ["wasm_bindgen_test"] + [lib] path = "src/lib.rs" harness = false @@ -47,10 +51,8 @@ env_logger.workspace = true console_error_panic_hook.workspace = true console_log.workspace = true fern.workspace = true -js-sys.workspace = true wasm-bindgen.workspace = true wasm-bindgen-futures.workspace = true -hal = { workspace = true, optional = true } # We need these features in the framework examples and tests web-sys = { workspace = true, features = [ "Location", diff --git a/naga-cli/Cargo.toml b/naga-cli/Cargo.toml index dc03fc96c..9ffe6e937 100644 --- a/naga-cli/Cargo.toml +++ b/naga-cli/Cargo.toml @@ -19,7 +19,6 @@ test = false [dependencies] bincode = "1" -log = "0.4" codespan-reporting = "0.11" env_logger = "0.11" argh = "0.1.5" diff --git a/tests/Cargo.toml b/tests/Cargo.toml index c4cbaa9e3..0e509c712 100644 --- a/tests/Cargo.toml +++ b/tests/Cargo.toml @@ -27,7 +27,6 @@ bytemuck.workspace = true cfg-if.workspace = true ctor.workspace = true futures-lite.workspace = true -heck.workspace = true libtest-mimic.workspace = true log.workspace = true parking_lot.workspace = true @@ -47,13 +46,9 @@ parking_lot = { workspace = true, features = ["deadlock_detection"] } [target.'cfg(target_arch = "wasm32")'.dependencies] console_log.workspace = true -raw-window-handle.workspace = true wasm-bindgen.workspace = true web-sys = { workspace = true } -[dev-dependencies] -naga = { workspace = true, features = ["wgsl-in"] } - [target.'cfg(target_arch = "wasm32")'.dev-dependencies] image.workspace = true js-sys.workspace = true diff --git a/wgpu-core/Cargo.toml b/wgpu-core/Cargo.toml index 42278afbc..8fbfbb01a 100644 --- a/wgpu-core/Cargo.toml +++ b/wgpu-core/Cargo.toml @@ -25,6 +25,10 @@ targets = [ "wasm32-unknown-unknown", ] +[package.metadata.cargo-machete] +# Cargo machete can't check build.rs dependencies. See https://github.com/bnjbvr/cargo-machete/issues/100 +ignored = ["cfg_aliases"] + [lib] [features] @@ -129,11 +133,5 @@ path = "../wgpu-hal" version = "0.20.0" default_features = false -[target.'cfg(all(target_arch = "wasm32", not(target_os = "emscripten")))'.dependencies] -web-sys = { version = "0.3.69", features = [ - "HtmlCanvasElement", - "OffscreenCanvas", -] } - [build-dependencies] cfg_aliases.workspace = true diff --git a/wgpu-hal/Cargo.toml b/wgpu-hal/Cargo.toml index fd0fadb19..0685ef699 100644 --- a/wgpu-hal/Cargo.toml +++ b/wgpu-hal/Cargo.toml @@ -30,6 +30,10 @@ targets = [ "wasm32-unknown-unknown", ] +[package.metadata.cargo-machete] +# Cargo machete can't check build.rs dependencies. See https://github.com/bnjbvr/cargo-machete/issues/100 +ignored = ["cfg_aliases"] + [lib] [features] diff --git a/wgpu-info/Cargo.toml b/wgpu-info/Cargo.toml index 59fc074fa..7491aee7e 100644 --- a/wgpu-info/Cargo.toml +++ b/wgpu-info/Cargo.toml @@ -17,4 +17,3 @@ pico-args.workspace = true serde.workspace = true serde_json.workspace = true wgpu.workspace = true -wgpu-types = { workspace = true, features = ["serde"] } diff --git a/wgpu/Cargo.toml b/wgpu/Cargo.toml index 8d8ab17aa..9d52f54d0 100644 --- a/wgpu/Cargo.toml +++ b/wgpu/Cargo.toml @@ -21,6 +21,11 @@ targets = [ "wasm32-unknown-unknown", ] +[package.metadata.cargo-machete] +# Cargo machete can't check build.rs dependencies. See https://github.com/bnjbvr/cargo-machete/issues/100 +ignored = ["cfg_aliases"] + + [lib] [features] @@ -165,7 +170,6 @@ optional = true [dependencies] arrayvec.workspace = true -cfg-if.workspace = true document-features.workspace = true log.workspace = true parking_lot.workspace = true