From 05af3f897887f9788aaf86add6ec156c6efb9e56 Mon Sep 17 00:00:00 2001 From: Jan Haller Date: Thu, 28 Apr 2022 23:36:50 +0200 Subject: [PATCH 1/3] Update cargo-deny + cargo-dinghy versions --- .github/workflows/full-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/full-ci.yml b/.github/workflows/full-ci.yml index 94ea79119..9c5b81f11 100644 --- a/.github/workflows/full-ci.yml +++ b/.github/workflows/full-ci.yml @@ -33,8 +33,8 @@ env: # Local variables # Note: using variables is limited at the moment, see https://github.com/actions/runner/issues/480 GDRUST_FEATURES: "gdnative/async,gdnative/serde,gdnative_bindings_generator/debug" - CARGO_DENY_VERSION: "0.11.0" - CARGO_DINGHY_VERSION: "0.4.68" + CARGO_DENY_VERSION: "0.11.4" + CARGO_DINGHY_VERSION: "0.4.71" on: push: From 63845cc428c73bd51cf7e900c654451a6e58dae0 Mon Sep 17 00:00:00 2001 From: Jan Haller Date: Thu, 28 Apr 2022 23:59:18 +0200 Subject: [PATCH 2/3] Use cargo-machete in CI --- .github/workflows/full-ci.yml | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/workflows/full-ci.yml b/.github/workflows/full-ci.yml index 9c5b81f11..7c765bb4d 100644 --- a/.github/workflows/full-ci.yml +++ b/.github/workflows/full-ci.yml @@ -35,6 +35,7 @@ env: GDRUST_FEATURES: "gdnative/async,gdnative/serde,gdnative_bindings_generator/debug" CARGO_DENY_VERSION: "0.11.4" CARGO_DINGHY_VERSION: "0.4.71" + CARGO_MACHETE_VERSION: "0.3" on: push: @@ -80,11 +81,13 @@ jobs: - name: "Check clippy" run: cargo clippy --workspace --features ${GDRUST_FEATURES} -- -D clippy::style -D clippy::complexity -D clippy::perf -D clippy::dbg_macro -D clippy::todo -D clippy::unimplemented - cargo-deny: + cargo-deny-machete: runs-on: ubuntu-latest needs: rustfmt steps: - uses: actions/checkout@v2 + + # Deny # Note: manually downloading is ~30s faster than https://github.com/EmbarkStudios/cargo-deny-action - name: "Install cargo-deny" run: | @@ -92,9 +95,19 @@ jobs: tar -zxvf cargo-deny.tar.gz mkdir -p $HOME/.cargo/bin mv cargo-deny-$CARGO_DENY_VERSION-x86_64-unknown-linux-musl/cargo-deny $HOME/.cargo/bin - - name: "Check cargo-deny" + - name: "Deny non-conforming dependencies" run: cargo deny check --config tools/deny.toml + # Machete + - name: "Install cargo-machete" + uses: baptiste0928/cargo-install@v1 + with: + crate: cargo-machete + version: ${{ env.CARGO_MACHETE_VERSION }} + - name: "Use machete to cut down dependencies" + run: cargo machete + + test: name: test-${{ matrix.os.name }}${{ matrix.rust.postfix }} needs: rustfmt @@ -285,7 +298,7 @@ jobs: needs: #- rustfmt - clippy - - cargo-deny + - cargo-deny-machete - test - integration-test-godot - build-release From 84c99b12a560f129879cc1672d8c63521eef7ffd Mon Sep 17 00:00:00 2001 From: Jan Haller Date: Mon, 9 May 2022 13:52:45 +0200 Subject: [PATCH 3/3] Remove surplus dependencies detected by cargo-machete, exlude false positive 'libc' --- bindings-generator/Cargo.toml | 1 - gdnative-async/Cargo.toml | 1 - gdnative-bindings/Cargo.toml | 2 -- gdnative-sys/Cargo.toml | 4 ++++ test/Cargo.toml | 2 -- 5 files changed, 4 insertions(+), 6 deletions(-) diff --git a/bindings-generator/Cargo.toml b/bindings-generator/Cargo.toml index 5b520b5ea..20d529d03 100644 --- a/bindings-generator/Cargo.toml +++ b/bindings-generator/Cargo.toml @@ -17,7 +17,6 @@ custom-godot = ["which"] [dependencies] heck = "0.4" -memchr = "2" miniserde = "0.1.16" proc-macro2 = "1" quote = "1" diff --git a/gdnative-async/Cargo.toml b/gdnative-async/Cargo.toml index 4e7ad0602..e4dec5d81 100644 --- a/gdnative-async/Cargo.toml +++ b/gdnative-async/Cargo.toml @@ -19,7 +19,6 @@ gdnative-core = { path = "../gdnative-core", version = "=0.10.0" } gdnative-bindings = { path = "../gdnative-bindings", version = "=0.10.0" } atomic-waker = "1" crossbeam-channel = "0.5" -crossbeam-utils = "0.8" futures-task = "0.3" once_cell = "1" parking_lot = "0.12" diff --git a/gdnative-bindings/Cargo.toml b/gdnative-bindings/Cargo.toml index 1b0b4803a..4e3071d50 100644 --- a/gdnative-bindings/Cargo.toml +++ b/gdnative-bindings/Cargo.toml @@ -17,9 +17,7 @@ one-class-one-file = [] custom-godot = ["gdnative_bindings_generator/custom-godot"] [dependencies] -gdnative-sys = { path = "../gdnative-sys", version = "=0.10.0" } gdnative-core = { path = "../gdnative-core", version = "=0.10.0" } -bitflags = "1" libc = "0.2" [build-dependencies] diff --git a/gdnative-sys/Cargo.toml b/gdnative-sys/Cargo.toml index 56caf74df..ac34b918c 100644 --- a/gdnative-sys/Cargo.toml +++ b/gdnative-sys/Cargo.toml @@ -21,3 +21,7 @@ proc-macro2 = "1" quote = "1" miniserde = "0.1.16" semver = "1" + +# False positives found by cargo-machete +[package.metadata.cargo-machete] +ignored = ["libc"] diff --git a/test/Cargo.toml b/test/Cargo.toml index 42c1389ec..bf6e721d3 100644 --- a/test/Cargo.toml +++ b/test/Cargo.toml @@ -17,7 +17,6 @@ custom-godot = ["gdnative/custom-godot"] [dependencies] gdnative = { path = "../gdnative", features = ["gd-test", "serde", "async"] } -gdnative-derive = { path = "../gdnative-derive" } approx = "0.5" ron = "0.7" serde = "1" @@ -26,4 +25,3 @@ bincode = "1" serde_yaml = "0.8.23" rmp-serde = "1" futures = "0.3" -once_cell = "1"