Skip to content

Commit

Permalink
Use cargo 1.64 workspace inheritance feature
Browse files Browse the repository at this point in the history
  • Loading branch information
jinleili committed Oct 14, 2022
1 parent 7aca31f commit 0a7abc3
Show file tree
Hide file tree
Showing 11 changed files with 170 additions and 150 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

env:
RUST_BACKTRACE: 1
RUST_VERSION: 1.62
RUST_VERSION: 1.64

# We distinguish the following kinds of builds:
# - local: build for the same target as we compile on, and do local tests
Expand Down
56 changes: 54 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,66 @@ members = [
"wgpu-hal",
"wgpu-info",
"wgpu-types",
"run-wasm",
"run-wasm"
]
exclude = [
"cts_runner",
"deno_webgpu",
"deno_webgpu"
]
default-members = ["wgpu", "wgpu-hal", "wgpu-info"]

[workspace.package]
edition = "2021"
rust-version = "1.64"
keywords = ["graphics"]
license = "MIT OR Apache-2.0"
homepage = "https://wgpu.rs/"
repository = "https://github.com/gfx-rs/wgpu"
authors = ["wgpu developers"]

[workspace.dependencies.wgc]
package = "wgpu-core"
path = "./wgpu-core"
version = "0.14"

[workspace.dependencies.wgt]
package = "wgpu-types"
path = "./wgpu-types"
version = "0.14"

[workspace.dependencies.hal]
package = "wgpu-hal"
path = "./wgpu-hal"
version = "0.14"

[workspace.dependencies.naga]
git = "https://github.com/gfx-rs/naga"
rev = "c52d9102"
version = "0.10"

[workspace.dependencies]
arrayvec = "0.7"
bitflags = "1"
egl = { package = "khronos-egl", version = "4.1" }
env_logger = "0.9"
fxhash = "0.2.1"
log = "0.4"
# parking_lot 0.12 switches from `winapi` to `windows`; permit either
parking_lot = ">=0.11,<0.13"
raw-window-handle = "0.5"
ron = "0.8"
smallvec = "1"
serde = "1"
thiserror = "1"
wgpu = { version = "0.14", path = "./wgpu" }
winit = "0.27.1"

# wasm32 dependencies
js-sys = "0.3.60"
wasm-bindgen = "0.2.83"
wasm-bindgen-futures = "0.4.33"
web-sys = "0.3.60"

[patch."https://github.com/gfx-rs/naga"]
#naga = { path = "../naga" }

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ For an overview of all the components in the gfx-rs ecosystem, see [the big pict

### MSRV policy

Minimum Supported Rust Version is **1.62**.
Minimum Supported Rust Version is **1.64**.
It is enforced on CI (in "/.github/workflows/ci.yml") with `RUST_VERSION` variable.
This version can only be upgraded in breaking releases.

Expand Down
9 changes: 4 additions & 5 deletions dummy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@
name = "dummy"
version = "0.1.0"
authors = [
"Dzmitry Malyshau <kvark@mozilla.com>",
"Dzmitry Malyshau <kvark@mozilla.com>"
]
edition = "2021"
license = "MIT OR Apache-2.0"
edition.workspace = true
license.workspace = true
publish = false

[features]

[dependencies.wgc]
path = "../wgpu-core"
package = "wgpu-core"
workspace = true
features = ["serial-pass", "trace"]
30 changes: 14 additions & 16 deletions player/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,32 @@
name = "player"
version = "0.1.0"
authors = [
"Dzmitry Malyshau <kvark@mozilla.com>",
"Dzmitry Malyshau <kvark@mozilla.com>"
]
edition = "2021"
edition.workspace = true
description = "WebGPU trace player"
homepage = "https://github.com/gfx-rs/wgpu"
repository = "https://github.com/gfx-rs/wgpu"
keywords = ["graphics"]
license = "MIT OR Apache-2.0"
homepage.workspace = true
repository.workspace = true
keywords.workspace = true
license.workspace = true
publish = false

[features]

[dependencies]
env_logger = "0.9"
log = "0.4"
raw-window-handle = "0.5"
ron = "0.8"
winit = { version = "0.27", optional = true }
env_logger.workspace = true
log.workspace = true
raw-window-handle.workspace = true
ron.workspace = true
winit = { workspace = true, optional = true }

[dependencies.wgt]
path = "../wgpu-types"
package = "wgpu-types"
workspace = true
features = ["replay"]

[dependencies.wgc]
path = "../wgpu-core"
package = "wgpu-core"
workspace = true
features = ["replay", "raw-window-handle", "strict_asserts", "wgsl"]

[dev-dependencies]
serde = "1"
serde.workspace = true
2 changes: 1 addition & 1 deletion run-wasm/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "run-wasm"
version = "0.1.0"
edition = "2021"
edition.workspace = true

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
57 changes: 25 additions & 32 deletions wgpu-core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[package]
name = "wgpu-core"
version = "0.14.0"
authors = ["wgpu developers"]
edition = "2021"
authors.workspace = true
edition.workspace = true
description = "WebGPU core logic on wgpu-hal"
homepage = "https://github.com/gfx-rs/wgpu"
repository = "https://github.com/gfx-rs/wgpu"
keywords = ["graphics"]
license = "MIT OR Apache-2.0"
homepage.workspace = true
repository.workspace = true
keywords.workspace = true
license.workspace = true

[lib]

Expand All @@ -29,55 +29,48 @@ wgsl = ["naga/wgsl-in"]
vulkan-portability = ["hal/vulkan"]

[dependencies]
arrayvec = "0.7"
bitflags = "1.0"
arrayvec.workspace = true
bitflags.workspace = true
bit-vec = "0.6"
codespan-reporting = "0.11"
fxhash = "0.2"
log = "0.4"
# parking_lot 0.12 switches from `winapi` to `windows`; permit either
parking_lot = ">=0.11,<0.13"
fxhash.workspace = true
log.workspace = true
parking_lot.workspace = true
profiling = { version = "1", default-features = false }
raw-window-handle = { version = "0.5", optional = true }
ron = { version = "0.8", optional = true }
serde = { version = "1.0", features = ["serde_derive"], optional = true }
smallvec = "1"
thiserror = "1"
raw-window-handle = { workspace = true, optional = true }
ron = { workspace = true, optional = true }
serde = { workspace = true, features = ["serde_derive"], optional = true }
smallvec.workspace = true
thiserror.workspace = true

[dependencies.naga]
git = "https://github.com/gfx-rs/naga"
rev = "c52d9102"
version = "0.10"
workspace = true
features = ["clone", "span", "validate"]

[dependencies.wgt]
path = "../wgpu-types"
package = "wgpu-types"
version = "0.14"
workspace = true

[dependencies.hal]
path = "../wgpu-hal"
package = "wgpu-hal"
version = "0.14"
workspace = true

[target.'cfg(all(target_arch = "wasm32", not(target_os = "emscripten")))'.dependencies]
web-sys = { version = "0.3", features = ["HtmlCanvasElement", "OffscreenCanvas"] }
web-sys = { workspace = true, features = ["HtmlCanvasElement", "OffscreenCanvas"] }

[target.'cfg(target_arch = "wasm32")'.dependencies]
hal = { path = "../wgpu-hal", package = "wgpu-hal", version = "0.14", features = ["gles"] }
hal = { workspace = true, features = ["gles"] }

[target.'cfg(all(not(target_arch = "wasm32"), any(target_os = "ios", target_os = "macos")))'.dependencies]
hal = { path = "../wgpu-hal", package = "wgpu-hal", version = "0.14", features = ["metal"] }
hal = { workspace = true, features = ["metal"] }
#Note: could also enable "vulkan" for Vulkan Portability

[target.'cfg(all(not(target_arch = "wasm32"), unix, not(target_os = "ios"), not(target_os = "macos")))'.dependencies]
hal = { path = "../wgpu-hal", package = "wgpu-hal", version = "0.14", features = ["vulkan", "gles", "renderdoc"] }
hal = { workspace = true, features = ["vulkan", "gles", "renderdoc"] }

[target.'cfg(all(not(target_arch = "wasm32"), windows))'.dependencies]
hal = { path = "../wgpu-hal", package = "wgpu-hal", version = "0.14", features = ["vulkan", "dx12", "dx11", "renderdoc"] }
hal = { workspace = true, features = ["vulkan", "dx12", "dx11", "renderdoc"] }

[target.'cfg(target_os = "emscripten")'.dependencies]
hal = { path = "../wgpu-hal", package = "wgpu-hal", version = "0.14", features = ["emscripten"] }
hal = { workspace = true, features = ["emscripten"] }

[build-dependencies]
cfg_aliases = "0.1"
56 changes: 25 additions & 31 deletions wgpu-hal/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[package]
name = "wgpu-hal"
version = "0.14.0"
authors = ["wgpu developers"]
edition = "2021"
authors.workspace = true
edition.workspace = true
description = "WebGPU hardware abstraction layer"
homepage = "https://github.com/gfx-rs/wgpu"
repository = "https://github.com/gfx-rs/wgpu"
keywords = ["graphics"]
license = "MIT OR Apache-2.0"
rust-version = "1.60"
homepage.workspace = true
repository.workspace = true
keywords.workspace = true
license.workspace = true
rust-version.workspace = true

[lib]

Expand All @@ -30,17 +30,16 @@ name = "raw-gles"
required-features = ["gles"]

[dependencies]
bitflags = "1.0"
# parking_lot 0.12 switches from `winapi` to `windows`; permit either
parking_lot = ">=0.11,<0.13"
bitflags.workspace = true
parking_lot.workspace = true
profiling = { version = "1", default-features = false }
raw-window-handle = "0.5"
thiserror = "1"
raw-window-handle.workspace = true
thiserror.workspace = true

# backends common
arrayvec = "0.7"
fxhash = "0.2.1"
log = "0.4"
arrayvec.workspace = true
fxhash.workspace = true
log.workspace = true
renderdoc-sys = { version = "0.7.1", optional = true }

# backend: Metal
Expand All @@ -51,7 +50,7 @@ foreign-types = { version = "0.3", optional = true }
ash = { version = "0.37", optional = true }
gpu-alloc = { version = "0.5", optional = true }
gpu-descriptor = { version = "0.2", optional = true }
smallvec = { version = "1", optional = true, features = ["union"] }
smallvec = { workspace = true, optional = true, features = ["union"] }

# backend: Gles
#glow = { version = "0.11.2", optional = true }
Expand All @@ -63,17 +62,15 @@ bit-set = { version = "0.5", optional = true }
range-alloc = { version = "0.1", optional = true }

[dependencies.wgt]
package = "wgpu-types"
path = "../wgpu-types"
version = "0.14"
workspace = true

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
egl = { package = "khronos-egl", version = "4.1", features = ["dynamic"], optional = true }
egl = { workspace = true, features = ["dynamic"], optional = true }
#Note: it's only unused on Apple platforms
libloading = { version = "0.7", optional = true }

[target.'cfg(target_os = "emscripten")'.dependencies]
egl = { package = "khronos-egl", version = "4.1", features = ["static", "no-pkg-config"] }
egl = { workspace = true, features = ["static", "no-pkg-config"] }
#Note: it's unused by emscripten, but we keep it to have single code base in egl.rs
libloading = { version = "0.7", optional = true }

Expand All @@ -89,29 +86,26 @@ objc = "0.2.5"
core-graphics-types = "0.1"

[target.'cfg(all(target_arch = "wasm32", not(target_os = "emscripten")))'.dependencies]
wasm-bindgen = { version = "0.2" }
web-sys = { version = "=0.3.60", features = ["Window", "HtmlCanvasElement", "WebGl2RenderingContext", "OffscreenCanvas"] }
js-sys = { version = "0.3" }
wasm-bindgen.workspace = true
web-sys = { workspace = true, features = ["Window", "HtmlCanvasElement", "WebGl2RenderingContext", "OffscreenCanvas"] }
js-sys.workspace = true

[target.'cfg(target_os = "android")'.dependencies]
android_system_properties = "0.1.1"

[dependencies.naga]
git = "https://github.com/gfx-rs/naga"
rev = "c52d9102"
version = "0.10"
workspace = true
features = ["clone"]

# DEV dependencies

[dev-dependencies.naga]
git = "https://github.com/gfx-rs/naga"
rev = "c52d9102"
workspace = true
features = ["wgsl-in"]

[dev-dependencies]
env_logger = "0.9"
winit = "0.27.1" # for "halmark" example
env_logger.workspace = true
winit.workspace = true # for "halmark" example

[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
glutin = "0.29.1" # for "gles" example
16 changes: 8 additions & 8 deletions wgpu-info/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[package]
name = "wgpu-info"
version = "0.14.0"
authors = ["wgpu developers"]
edition = "2021"
authors.workspace = true
edition.workspace = true
description = "Adapter information and per-adapter test program"
homepage = "https://github.com/gfx-rs/wgpu"
repository = "https://github.com/gfx-rs/wgpu"
keywords = ["graphics"]
license = "MIT OR Apache-2.0"
homepage.workspace = true
repository.workspace = true
keywords.workspace = true
license.workspace = true

[dependencies]
env_logger = "0.9"
wgpu = { version = "0.14", path = "../wgpu" }
env_logger.workspace = true
wgpu.workspace = true
Loading

0 comments on commit 0a7abc3

Please sign in to comment.