From 7e6d207f31fcd9e03ddc2c9363453cc1bfb5d0f9 Mon Sep 17 00:00:00 2001 From: Teemu Kuusisto Date: Tue, 24 Nov 2026 13:25:03 +0000 Subject: [PATCH 1/4] fix(deps): drop unused gio, glib and workspace entries The Linux desktop crate declared gio and glib 0.22, but no source file in it uses either. The GTK crates it depends on use gio and glib 0.20, so only this crate pulled in the 0.22 line and a second copy of both libraries and their -sys crates. Remove the two dependencies. The crate's lockfile loses seven packages: gio, gio-sys, glib, glib-macros, glib-sys, gobject-sys and system-deps 9.0.0. With a single version of each left, the remaining entries drop their version suffixes. Also remove the axis-daemon and axis-pty entries from the root [workspace.dependencies] table. No member crate inherits them, so they only add noise and would be reported by an unused-dependency check. Signed-off-by: Teemu Kuusisto --- Cargo.toml | 2 - gui/linux/Cargo.lock | 233 +++++++++++++------------------------------ gui/linux/Cargo.toml | 2 - 3 files changed, 67 insertions(+), 170 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index caf828f9..7d60b918 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -29,8 +29,6 @@ axis-sandbox = { path = "crates/axis-sandbox" } axis-proxy = { path = "crates/axis-proxy" } axis-router = { path = "crates/axis-router" } axis-gpu = { path = "crates/axis-gpu" } -axis-daemon = { path = "crates/axis-daemon" } -axis-pty = { path = "crates/axis-pty" } axis-gateway = { path = "crates/axis-gateway" } # Serialization diff --git a/gui/linux/Cargo.lock b/gui/linux/Cargo.lock index 8e4879e9..6c08a424 100644 --- a/gui/linux/Cargo.lock +++ b/gui/linux/Cargo.lock @@ -12,8 +12,6 @@ checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53" name = "axis-desktop" version = "0.4.0" dependencies = [ - "gio 0.22.10", - "glib 0.22.10", "gtk4", "libadwaita", "webkit6", @@ -33,7 +31,7 @@ checksum = "91e3bd0f4e25afa9cabc157908d14eeef9067d6448c49414d17b3fb55f0eadd0" dependencies = [ "bitflags", "cairo-sys-rs", - "glib 0.20.12", + "glib", "libc", ] @@ -43,9 +41,9 @@ version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "059cc746549898cbfd9a47754288e5a958756650ef4652bbb6c5f71a6bda4f8b" dependencies = [ - "glib-sys 0.20.10", + "glib-sys", "libc", - "system-deps 7.0.8", + "system-deps", ] [[package]] @@ -143,8 +141,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2fd242894c084f4beed508a56952750bce3e96e85eb68fdc153637daa163e10c" dependencies = [ "gdk-pixbuf-sys", - "gio 0.20.12", - "glib 0.20.12", + "gio", + "glib", "libc", ] @@ -154,11 +152,11 @@ version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b34f3b580c988bd217e9543a2de59823fafae369d1a055555e5f95a8b130b96" dependencies = [ - "gio-sys 0.20.10", - "glib-sys 0.20.10", - "gobject-sys 0.20.10", + "gio-sys", + "glib-sys", + "gobject-sys", "libc", - "system-deps 7.0.8", + "system-deps", ] [[package]] @@ -170,8 +168,8 @@ dependencies = [ "cairo-rs", "gdk-pixbuf", "gdk4-sys", - "gio 0.20.12", - "glib 0.20.12", + "gio", + "glib", "libc", "pango", ] @@ -184,13 +182,13 @@ checksum = "6f6eb95798e2b46f279cf59005daf297d5b69555428f185650d71974a910473a" dependencies = [ "cairo-sys-rs", "gdk-pixbuf-sys", - "gio-sys 0.20.10", - "glib-sys 0.20.10", - "gobject-sys 0.20.10", + "gio-sys", + "glib-sys", + "gobject-sys", "libc", "pango-sys", "pkg-config", - "system-deps 7.0.8", + "system-deps", ] [[package]] @@ -203,25 +201,8 @@ dependencies = [ "futures-core", "futures-io", "futures-util", - "gio-sys 0.20.10", - "glib 0.20.12", - "libc", - "pin-project-lite", - "smallvec", -] - -[[package]] -name = "gio" -version = "0.22.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4620fbafdf19dba814473e19f18e75290cb3338662f6ae35f0402affd3b2b699" -dependencies = [ - "futures-channel", - "futures-core", - "futures-io", - "futures-util", - "gio-sys 0.22.9", - "glib 0.22.10", + "gio-sys", + "glib", "libc", "pin-project-lite", "smallvec", @@ -233,23 +214,10 @@ version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "521e93a7e56fc89e84aea9a52cfc9436816a4b363b030260b699950ff1336c83" dependencies = [ - "glib-sys 0.20.10", - "gobject-sys 0.20.10", - "libc", - "system-deps 7.0.8", - "windows-sys", -] - -[[package]] -name = "gio-sys" -version = "0.22.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c28739f914c15b87a9856000bed9cbd5b3a8afbca5e982d9a299e1601422cb5" -dependencies = [ - "glib-sys 0.22.8", - "gobject-sys 0.22.6", + "glib-sys", + "gobject-sys", "libc", - "system-deps 9.0.0", + "system-deps", "windows-sys", ] @@ -265,31 +233,10 @@ dependencies = [ "futures-executor", "futures-task", "futures-util", - "gio-sys 0.20.10", - "glib-macros 0.20.12", - "glib-sys 0.20.10", - "gobject-sys 0.20.10", - "libc", - "memchr", - "smallvec", -] - -[[package]] -name = "glib" -version = "0.22.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4cf9e5bd8713f1990a92c422998826e0fb34824277b46bc59757373483c6694" -dependencies = [ - "bitflags", - "futures-channel", - "futures-core", - "futures-executor", - "futures-task", - "futures-util", - "gio-sys 0.22.9", - "glib-macros 0.22.6", - "glib-sys 0.22.8", - "gobject-sys 0.22.6", + "gio-sys", + "glib-macros", + "glib-sys", + "gobject-sys", "libc", "memchr", "smallvec", @@ -308,18 +255,6 @@ dependencies = [ "syn", ] -[[package]] -name = "glib-macros" -version = "0.22.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "506d23499707c7142898429757e8d9a3871d965239a2cb66dfa05052be6d6f19" -dependencies = [ - "heck", - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "glib-sys" version = "0.20.10" @@ -327,17 +262,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ab79e1ed126803a8fb827e3de0e2ff95191912b8db65cee467edb56fc4cc215" dependencies = [ "libc", - "system-deps 7.0.8", -] - -[[package]] -name = "glib-sys" -version = "0.22.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "030967459f9f676851872c6304adea7825c6d462ec9b72554c733cf0c5952233" -dependencies = [ - "libc", - "system-deps 7.0.8", + "system-deps", ] [[package]] @@ -346,20 +271,9 @@ version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec9aca94bb73989e3cfdbf8f2e0f1f6da04db4d291c431f444838925c4c63eda" dependencies = [ - "glib-sys 0.20.10", + "glib-sys", "libc", - "system-deps 7.0.8", -] - -[[package]] -name = "gobject-sys" -version = "0.22.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22a861859b887a79cf461359c192c97a57d8fb0229dd291232e57aa11f6fa72c" -dependencies = [ - "glib-sys 0.22.8", - "libc", - "system-deps 7.0.8", + "system-deps", ] [[package]] @@ -368,7 +282,7 @@ version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6b86dfad7d14251c9acaf1de63bc8754b7e3b4e5b16777b6f5a748208fe9519b" dependencies = [ - "glib 0.20.12", + "glib", "graphene-sys", "libc", ] @@ -379,10 +293,10 @@ version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df583a85ba2d5e15e1797e40d666057b28bc2f60a67c9c24145e6db2cc3861ea" dependencies = [ - "glib-sys 0.20.10", + "glib-sys", "libc", "pkg-config", - "system-deps 7.0.8", + "system-deps", ] [[package]] @@ -393,7 +307,7 @@ checksum = "61f5e72f931c8c9f65fbfc89fe0ddc7746f147f822f127a53a9854666ac1f855" dependencies = [ "cairo-rs", "gdk4", - "glib 0.20.12", + "glib", "graphene-rs", "gsk4-sys", "libc", @@ -408,12 +322,12 @@ checksum = "755059de55fa6f85a46bde8caf03e2184c96bfda1f6206163c72fb0ea12436dc" dependencies = [ "cairo-sys-rs", "gdk4-sys", - "glib-sys 0.20.10", - "gobject-sys 0.20.10", + "glib-sys", + "gobject-sys", "graphene-sys", "libc", "pango-sys", - "system-deps 7.0.8", + "system-deps", ] [[package]] @@ -427,8 +341,8 @@ dependencies = [ "futures-channel", "gdk-pixbuf", "gdk4", - "gio 0.20.12", - "glib 0.20.12", + "gio", + "glib", "graphene-rs", "gsk4", "gtk4-macros", @@ -458,14 +372,14 @@ dependencies = [ "cairo-sys-rs", "gdk-pixbuf-sys", "gdk4-sys", - "gio-sys 0.20.10", - "glib-sys 0.20.10", - "gobject-sys 0.20.10", + "gio-sys", + "glib-sys", + "gobject-sys", "graphene-sys", "gsk4-sys", "libc", "pango-sys", - "system-deps 7.0.8", + "system-deps", ] [[package]] @@ -496,7 +410,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "03b28ed9c7c08f906b2a51bc2365eae2ba5e7db1249b89892f7ae4cbd602d1f4" dependencies = [ - "glib 0.20.12", + "glib", "javascriptcore6-sys", "libc", ] @@ -507,10 +421,10 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4741e2a31c2145050dd4971f8dd51e92c840d5839a7124cc68a33c7325523a12" dependencies = [ - "glib-sys 0.20.10", - "gobject-sys 0.20.10", + "glib-sys", + "gobject-sys", "libc", - "system-deps 7.0.8", + "system-deps", ] [[package]] @@ -520,8 +434,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "500135d29c16aabf67baafd3e7741d48e8b8978ca98bac39e589165c8dc78191" dependencies = [ "gdk4", - "gio 0.20.12", - "glib 0.20.12", + "gio", + "glib", "gtk4", "libadwaita-sys", "libc", @@ -535,13 +449,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6680988058c2558baf3f548a370e4e78da3bf7f08469daa822ac414842c912db" dependencies = [ "gdk4-sys", - "gio-sys 0.20.10", - "glib-sys 0.20.10", - "gobject-sys 0.20.10", + "gio-sys", + "glib-sys", + "gobject-sys", "gtk4-sys", "libc", "pango-sys", - "system-deps 7.0.8", + "system-deps", ] [[package]] @@ -571,8 +485,8 @@ version = "0.20.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6576b311f6df659397043a5fa8a021da8f72e34af180b44f7d57348de691ab5c" dependencies = [ - "gio 0.20.12", - "glib 0.20.12", + "gio", + "glib", "libc", "pango-sys", ] @@ -583,10 +497,10 @@ version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "186909673fc09be354555c302c0b3dcf753cd9fa08dcb8077fa663c80fb243fa" dependencies = [ - "glib-sys 0.20.10", - "gobject-sys 0.20.10", + "glib-sys", + "gobject-sys", "libc", - "system-deps 7.0.8", + "system-deps", ] [[package]] @@ -691,8 +605,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b84ccd1f4aee0854a16b0b489ba843798e2eb4cdcddd4a61248f7db9ce8b6df1" dependencies = [ "futures-channel", - "gio 0.20.12", - "glib 0.20.12", + "gio", + "glib", "libc", "soup3-sys", ] @@ -703,11 +617,11 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8869997193d52a61a1db48627bdaa57343f76e2c5132ee6d351245a6ab30631e" dependencies = [ - "gio-sys 0.20.10", - "glib-sys 0.20.10", - "gobject-sys 0.20.10", + "gio-sys", + "glib-sys", + "gobject-sys", "libc", - "system-deps 7.0.8", + "system-deps", ] [[package]] @@ -734,19 +648,6 @@ dependencies = [ "version-compare", ] -[[package]] -name = "system-deps" -version = "9.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a0dae2cbca1f0ff93795713cfe0a4c02f760e3c0b8ae2ab4ec4045808ff429f" -dependencies = [ - "cfg-expr", - "heck", - "pkg-config", - "toml", - "version-compare", -] - [[package]] name = "target-lexicon" version = "0.13.5" @@ -823,8 +724,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8c359ef247305dcade3363c281c505b943e0e6162a42eac76ff76ed8e7cebfbd" dependencies = [ "gdk4", - "gio 0.20.12", - "glib 0.20.12", + "gio", + "glib", "gtk4", "javascriptcore6", "libc", @@ -839,14 +740,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96284c5280af5984dbdae8dae3cfeea11b44b214f9bd42b35c0ca75903bccce2" dependencies = [ "gdk4-sys", - "gio-sys 0.20.10", - "glib-sys 0.20.10", - "gobject-sys 0.20.10", + "gio-sys", + "glib-sys", + "gobject-sys", "gtk4-sys", "javascriptcore6-sys", "libc", "soup3-sys", - "system-deps 7.0.8", + "system-deps", ] [[package]] diff --git a/gui/linux/Cargo.toml b/gui/linux/Cargo.toml index 51e1c624..f3e33b3a 100644 --- a/gui/linux/Cargo.toml +++ b/gui/linux/Cargo.toml @@ -15,5 +15,3 @@ path = "src/main.rs" gtk4 = { version = "0.9", features = ["v4_12"] } libadwaita = { version = "0.7", features = ["v1_4"] } webkit6 = { version = "0.4", package = "webkit6" } -gio = "0.22" -glib = "0.22" From 7a8877f184a8323cf78ce45bacd1e311b01409ed Mon Sep 17 00:00:00 2001 From: Teemu Kuusisto Date: Tue, 24 Nov 2026 13:25:13 +0000 Subject: [PATCH 2/4] ci(deps): check for unused dependencies in the Clippy job Unused dependencies had accumulated unnoticed, among them two in the Linux desktop crate and two workspace entries, because nothing in CI looks for them. They slow builds and widen the dependency surface that has to be audited. Install a pinned cargo-shear in the existing Clippy job and fail when a dependency is unused in either Cargo workspace, the root one and gui/linux. cargo-shear is used rather than cargo-machete because it also checks dev, build and target-specific dependencies, and it works on the pinned toolchain. Document the check in DEVELOPMENT.md, including the [package.metadata.cargo-shear] ignored list for a dependency used in a way the tool cannot see. Signed-off-by: Teemu Kuusisto --- .github/workflows/ci.yml | 5 +++++ DEVELOPMENT.md | 11 +++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1fdb58cf..71df8c43 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -66,6 +66,11 @@ jobs: components: clippy - uses: Swatinem/rust-cache@f0d9c3887740aee45f6153b24b3a6b815192ec16 # v2 - run: cargo clippy --locked --all-targets -- -D warnings + - name: Check for unused dependencies + run: | + cargo install cargo-shear --version 1.13.4 --locked + cargo shear --locked --deny-warnings + cargo shear --locked --deny-warnings gui/linux # Classifies the change set. No job reads the `code` output: build and test # jobs run on every change, including docs-only ones, and the publication diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 2b348026..c97841b1 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -197,7 +197,12 @@ bash scripts/test_security_tier0.sh `cargo audit --file gui/linux/Cargo.lock` and `cargo deny --manifest-path gui/linux/Cargo.toml --config deny.toml --locked check advisories licenses sources`. Use the `cargo-audit` and `cargo-deny` versions that `security.yml` - installs; other versions can report different results. + installs; other versions can report different results. Also run + `cargo shear --locked --deny-warnings` and + `cargo shear --locked --deny-warnings gui/linux`, using the cargo-shear + version `ci.yml` installs. If it flags a dependency that is used in a way it + cannot see, list it under `ignored` in that crate's + `[package.metadata.cargo-shear]` with a comment giving the reason. - `scripts/`, `.github/workflows/`, the installers, packaging metadata, `rust-toolchain.toml`, `README.md`, `docs/setup-and-install.md`, `docs/linux-setup.md`, or `docs/install-and-runtime-dependencies.md`: run @@ -258,7 +263,9 @@ Every PR automatically runs the following checks: 1. **Lint & format** — `cargo fmt --all -- --check`, `cargo fmt --manifest-path gui/linux/Cargo.toml -- --check`, and - `cargo clippy --locked --all-targets -- -D warnings`. + `cargo clippy --locked --all-targets -- -D warnings`. CI also runs + `cargo shear --locked --deny-warnings` to find unused dependencies in both + Cargo workspaces. 2. **Correctness tests** — `cargo test --locked`, the security tier 0/1 tests, the Linux, macOS and Windows test jobs, e2e tests, and policy validation. 3. **Security checks** — dependency audit and review, secret scan, CodeQL, and From 57773c19414aa9fbbd4dd87ba5ce92e1415f8c04 Mon Sep 17 00:00:00 2001 From: Teemu Kuusisto Date: Tue, 24 Nov 2026 13:53:43 +0000 Subject: [PATCH 3/4] ci(deps): align cargo-shear docs and step name with CI The cargo-shear step runs in the Clippy job on every PR, but the local checks listed it only under dependency changes, so a source-only change could fail it in CI without the contributor having run it. Move both invocations into the block that applies to every change. The suppression advice named only [package.metadata.cargo-shear], which does not clear an unused entry in the root [workspace.dependencies] table. Name both places, and the ignored-paths key for a source file that must stay unlinked. With --deny-warnings the check also fails on unlinked source files and on an ignore entry that suppresses nothing, so say so in the documentation and in the step name. Signed-off-by: Teemu Kuusisto --- .github/workflows/ci.yml | 2 +- DEVELOPMENT.md | 27 +++++++++++++++++++-------- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 71df8c43..c4da40cd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -66,7 +66,7 @@ jobs: components: clippy - uses: Swatinem/rust-cache@f0d9c3887740aee45f6153b24b3a6b815192ec16 # v2 - run: cargo clippy --locked --all-targets -- -D warnings - - name: Check for unused dependencies + - name: Check for unused dependencies and unlinked source files run: | cargo install cargo-shear --version 1.13.4 --locked cargo shear --locked --deny-warnings diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index c97841b1..505e5a3a 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -181,10 +181,26 @@ from the repository root unless it says otherwise: cargo fmt --all -- --check cargo fmt --manifest-path gui/linux/Cargo.toml -- --check cargo clippy --locked --all-targets -- -D warnings +cargo shear --locked --deny-warnings +cargo shear --locked --deny-warnings gui/linux cargo test --locked bash scripts/test_security_tier0.sh ``` +`cargo shear` is not part of Cargo: install the cargo-shear version that +`ci.yml` installs. CI runs it in the Clippy job on every PR, so run it for +source-only changes too. It fails on a dependency that nothing uses in either +Cargo workspace, and `--deny-warnings` also fails it on a source file that no +target links and on an `ignored` entry that matches nothing. If it flags a +dependency that is used in a way it cannot see, keep the dependency and list it +under `ignored` with a comment giving the reason: in +`[package.metadata.cargo-shear]` of the crate that declares it, or, for an +entry in the root `[workspace.dependencies]` that no crate inherits, in +`[workspace.metadata.cargo-shear]` in the root `Cargo.toml`. A source file that +must stay unlinked goes under `ignored-paths` in the same table. The +`gui/linux` run reports paths relative to `gui/linux`, so a GitHub annotation +from it can point at the root `Cargo.toml`; the message names the dependency. + - GUI: from `gui/shared`, run `npm ci`, `npm test`, `npm run typecheck`, `npm run build`, and `npm run audit:deps`. The last one runs `npm audit` and fails on any high or critical advisory not listed in @@ -197,12 +213,7 @@ bash scripts/test_security_tier0.sh `cargo audit --file gui/linux/Cargo.lock` and `cargo deny --manifest-path gui/linux/Cargo.toml --config deny.toml --locked check advisories licenses sources`. Use the `cargo-audit` and `cargo-deny` versions that `security.yml` - installs; other versions can report different results. Also run - `cargo shear --locked --deny-warnings` and - `cargo shear --locked --deny-warnings gui/linux`, using the cargo-shear - version `ci.yml` installs. If it flags a dependency that is used in a way it - cannot see, list it under `ignored` in that crate's - `[package.metadata.cargo-shear]` with a comment giving the reason. + installs; other versions can report different results. - `scripts/`, `.github/workflows/`, the installers, packaging metadata, `rust-toolchain.toml`, `README.md`, `docs/setup-and-install.md`, `docs/linux-setup.md`, or `docs/install-and-runtime-dependencies.md`: run @@ -264,8 +275,8 @@ Every PR automatically runs the following checks: 1. **Lint & format** — `cargo fmt --all -- --check`, `cargo fmt --manifest-path gui/linux/Cargo.toml -- --check`, and `cargo clippy --locked --all-targets -- -D warnings`. CI also runs - `cargo shear --locked --deny-warnings` to find unused dependencies in both - Cargo workspaces. + `cargo shear --locked --deny-warnings` in the Clippy job, which fails on + unused dependencies and unlinked source files in both Cargo workspaces. 2. **Correctness tests** — `cargo test --locked`, the security tier 0/1 tests, the Linux, macOS and Windows test jobs, e2e tests, and policy validation. 3. **Security checks** — dependency audit and review, secret scan, CodeQL, and From fea0ebecc6b4a7dfcd8f27f804207795637de335 Mon Sep 17 00:00:00 2001 From: Teemu Kuusisto Date: Tue, 24 Nov 2026 14:19:21 +0000 Subject: [PATCH 4/4] docs(deps): tighten the cargo-shear local-check text The local-checks paragraph about cargo-shear had grown into a block of loosely related claims, several of them inaccurate when run against cargo-shear 1.13.4: - The CI/CD item said one command covers both Cargo workspaces. The root excludes gui/linux, so that command covers only the root; say that CI runs it once for each. - "ignored-paths in the same table" did not say what the paths are relative to. They are relative to the crate in the package table and to the repository root in the workspace table, and a pattern written against the wrong one fails and adds a redundant-pattern warning. - Only an ignore entry that matches nothing was named as a failure. Any cargo-shear warning fails under --deny-warnings, a suppression that is no longer needed included. - A root [workspace.dependencies] entry is flagged when no member crate declares it by name, not when no crate inherits it. Keep a one-line install note under the command block and move the suppression guidance into its own short item. The sentence about GitHub annotations for the gui/linux run is not a local check and is dropped. Signed-off-by: Teemu Kuusisto --- DEVELOPMENT.md | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 505e5a3a..ff13691f 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -187,20 +187,17 @@ cargo test --locked bash scripts/test_security_tier0.sh ``` -`cargo shear` is not part of Cargo: install the cargo-shear version that -`ci.yml` installs. CI runs it in the Clippy job on every PR, so run it for -source-only changes too. It fails on a dependency that nothing uses in either -Cargo workspace, and `--deny-warnings` also fails it on a source file that no -target links and on an `ignored` entry that matches nothing. If it flags a -dependency that is used in a way it cannot see, keep the dependency and list it -under `ignored` with a comment giving the reason: in -`[package.metadata.cargo-shear]` of the crate that declares it, or, for an -entry in the root `[workspace.dependencies]` that no crate inherits, in -`[workspace.metadata.cargo-shear]` in the root `Cargo.toml`. A source file that -must stay unlinked goes under `ignored-paths` in the same table. The -`gui/linux` run reports paths relative to `gui/linux`, so a GitHub annotation -from it can point at the root `Cargo.toml`; the message names the dependency. - +`cargo shear` is not part of Cargo: install the version that `ci.yml` installs. + +- `cargo shear` false positive, such as a dependency used in a way it cannot + see or a source file that must stay unlinked: keep the code and suppress the + finding with a comment giving the reason. Use `ignored` (dependency names) or + `ignored-paths` (file patterns) under `[package.metadata.cargo-shear]` in + that crate's `Cargo.toml`, with paths relative to the crate. For an entry in + the root `[workspace.dependencies]` that no member crate declares, use + `[workspace.metadata.cargo-shear]` in the root `Cargo.toml`, with paths + relative to the repository root. Delete a suppression that is no longer + needed: cargo-shear warns about it, and `--deny-warnings` makes that fail. - GUI: from `gui/shared`, run `npm ci`, `npm test`, `npm run typecheck`, `npm run build`, and `npm run audit:deps`. The last one runs `npm audit` and fails on any high or critical advisory not listed in @@ -275,8 +272,10 @@ Every PR automatically runs the following checks: 1. **Lint & format** — `cargo fmt --all -- --check`, `cargo fmt --manifest-path gui/linux/Cargo.toml -- --check`, and `cargo clippy --locked --all-targets -- -D warnings`. CI also runs - `cargo shear --locked --deny-warnings` in the Clippy job, which fails on - unused dependencies and unlinked source files in both Cargo workspaces. + `cargo shear --locked --deny-warnings` in the Clippy job, once for the root + workspace and once for `gui/linux`. It fails on an unused dependency, an + unlinked source file, or any other cargo-shear warning, such as a + suppression that is no longer needed. 2. **Correctness tests** — `cargo test --locked`, the security tier 0/1 tests, the Linux, macOS and Windows test jobs, e2e tests, and policy validation. 3. **Security checks** — dependency audit and review, secret scan, CodeQL, and