From 0cd1ec2981f584084dcd17baa6eb26cb98c562a2 Mon Sep 17 00:00:00 2001 From: Dzmitry Malyshau Date: Thu, 18 Jun 2020 14:01:59 -0400 Subject: [PATCH] Dummy workspace crate --- .github/workflows/ci.yml | 8 +++++--- Cargo.lock | 7 +++++++ Cargo.toml | 1 + dummy/Cargo.toml | 16 ++++++++++++++++ dummy/README.md | 3 +++ dummy/src/lib.rs | 1 + wgpu-core/Cargo.toml | 7 +------ wgpu-core/src/device/trace.rs | 4 ++-- wgpu-types/Cargo.toml | 5 +---- 9 files changed, 37 insertions(+), 15 deletions(-) create mode 100644 dummy/Cargo.toml create mode 100644 dummy/README.md create mode 100644 dummy/src/lib.rs diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2d663d837..6db744830 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -96,14 +96,16 @@ jobs: name: Install latest nightly uses: actions-rs/toolchain@v1 with: - # temporary due to https://github.com/rust-lang/rust/issues/72467 + # temporary due to https://github.com/Xudong-Huang/generator-rs/issues/21 toolchain: nightly-2020-05-01 override: true - if: matrix.channel == 'stable' run: rustup component add clippy - - name: cargo clippy/test - run: ${{ matrix.build_command }} + # build with no features first + - if: matrix.additional_core_features == '' + run: cargo check --manifest-path wgpu-core/Cargo.toml --no-default-features - if: matrix.additional_core_features != '' run: cargo check --manifest-path wgpu-core/Cargo.toml --features ${{ matrix.additional_core_features }} - if: matrix.additional_player_features != '' run: cargo check --manifest-path player/Cargo.toml --features ${{ matrix.additional_player_features }} + - run: ${{ matrix.build_command }} diff --git a/Cargo.lock b/Cargo.lock index a1fb1e8aa..9ce5e285a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -279,6 +279,13 @@ version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "52ba6eb47c2131e784a38b726eb54c1e1484904f013e576a25354d0124161af6" +[[package]] +name = "dummy" +version = "0.1.0" +dependencies = [ + "wgpu-core", +] + [[package]] name = "env_logger" version = "0.7.1" diff --git a/Cargo.toml b/Cargo.toml index b9d820c1e..1e4ad8b58 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,6 @@ [workspace] members = [ + "dummy", "player", "wgpu-core", "wgpu-types", diff --git a/dummy/Cargo.toml b/dummy/Cargo.toml new file mode 100644 index 000000000..4c9b23711 --- /dev/null +++ b/dummy/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "dummy" +version = "0.1.0" +authors = [ + "Dzmitry Malyshau ", +] +edition = "2018" +publish = false + +[features] + +[dependencies.wgc] +path = "../wgpu-core" +package = "wgpu-core" +version = "0.5" +features = ["battery", "trace"] diff --git a/dummy/README.md b/dummy/README.md new file mode 100644 index 000000000..5a95a787a --- /dev/null +++ b/dummy/README.md @@ -0,0 +1,3 @@ +# wgpu dummy + +This is a dummy build target that makes `cargo check` and `cargo test` in the workspace to cover all the API. diff --git a/dummy/src/lib.rs b/dummy/src/lib.rs new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/dummy/src/lib.rs @@ -0,0 +1 @@ + diff --git a/wgpu-core/Cargo.toml b/wgpu-core/Cargo.toml index 44b7ea403..823400677 100644 --- a/wgpu-core/Cargo.toml +++ b/wgpu-core/Cargo.toml @@ -1,10 +1,7 @@ [package] name = "wgpu-core" version = "0.5.0" -authors = [ - "Dzmitry Malyshau ", - "Joshua Groves ", -] +authors = ["wgpu developers"] edition = "2018" description = "WebGPU core logic on gfx-hal" homepage = "https://github.com/gfx-rs/wgpu" @@ -18,8 +15,6 @@ license = "MPL-2.0" default = [] trace = ["ron", "serde", "wgt/trace"] replay = ["serde", "wgt/replay"] -#NOTE: glutin feature is not stable, use at your own risk -#glutin = ["gfx-backend-gl/glutin"] [dependencies] arrayvec = "0.5" diff --git a/wgpu-core/src/device/trace.rs b/wgpu-core/src/device/trace.rs index 0d2ece6e1..94502304d 100644 --- a/wgpu-core/src/device/trace.rs +++ b/wgpu-core/src/device/trace.rs @@ -256,7 +256,7 @@ impl Trace { pub fn new(path: &std::path::Path) -> Result { log::info!("Tracing into '{:?}'", path); let mut file = std::fs::File::create(path.join(FILE_NAME))?; - file.write(b"[\n")?; + file.write_all(b"[\n")?; Ok(Trace { path: path.to_path_buf(), file, @@ -287,6 +287,6 @@ impl Trace { #[cfg(feature = "trace")] impl Drop for Trace { fn drop(&mut self) { - let _ = self.file.write(b"]"); + let _ = self.file.write_all(b"]"); } } diff --git a/wgpu-types/Cargo.toml b/wgpu-types/Cargo.toml index 79b2d1e93..f806b358d 100644 --- a/wgpu-types/Cargo.toml +++ b/wgpu-types/Cargo.toml @@ -1,10 +1,7 @@ [package] name = "wgpu-types" version = "0.5.0" -authors = [ - "Dzmitry Malyshau ", - "Joshua Groves ", -] +authors = ["wgpu developers"] edition = "2018" description = "WebGPU types" homepage = "https://github.com/gfx-rs/wgpu"