diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1fdb58cf..c4da40cd 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 and unlinked source files + 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/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/DEVELOPMENT.md b/DEVELOPMENT.md index 2b348026..ff13691f 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -181,10 +181,23 @@ 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 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 @@ -258,7 +271,11 @@ 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` 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 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"