Skip to content

ci: check Rust dependencies with cargo-deny - #26

Open
gabref wants to merge 2 commits into
silvermine:masterfrom
gabref:ci/cargo-deny
Open

gabref wants to merge 2 commits into
silvermine:masterfrom
gabref:ci/cargo-deny

Conversation

@gabref

@gabref gabref commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

CI currently does not check Rust dependencies for advisories or enforce license and source policies. Add a dedicated cargo-deny job on pushes and pull requests.

The policy checks all platforms and development dependencies, rejects wildcard dependencies and unapproved sources, and reports duplicate versions as warnings. Update affected dependencies, raise the Tokio minimum version, and document two upstream exceptions: proc-macro-error and glib in Tauri's GTK stack.

Closes #23

@gabref
gabref requested a review from a team October 27, 2026 09:06
Comment thread Cargo.toml Resolved
Comment thread .github/workflows/ci.yml Resolved
Comment thread .github/workflows/ci.yml Resolved
Comment thread .github/workflows/ci.yml Resolved
Comment thread .github/workflows/ci.yml Resolved

@velocitysystems velocitysystems left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please squash the review follow-up commits into the commits they amend before merge:

  • chore: sync example Tokio lockfile into fix: update vulnerable Rust dependencies
  • ci: run pinned cargo-deny directly into ci: check Rust dependencies with cargo-deny

Comment thread README.md Outdated
Comment on lines +509 to +525
Rust dependency policy is checked on pushes, pull requests, and weekly against the
committed lockfile. Install cargo-deny and run the same check locally:

```bash
cargo install cargo-deny --version 0.20.2 --locked
cargo deny --workspace --all-features --locked check
```

`deny.toml` checks advisories, licenses, duplicate versions, and dependency sources
across all platforms, including development dependencies. Duplicate versions produce
warnings; wildcard dependencies and unapproved sources fail the check. The example
app has a separate lockfile and is not included in this audit.

Update affected dependencies before adding advisory exceptions. Each exception must
identify the upstream constraint and explain why an update cannot resolve it. Remove
exceptions when upstream dependencies no longer require them. Review license additions
and allow only the registries and Git repositories the package needs.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we tighten this section? deny.toml is the source of truth for what's checked, and listing its settings here will drift.

Suggested change
Rust dependency policy is checked on pushes, pull requests, and weekly against the
committed lockfile. Install cargo-deny and run the same check locally:
```bash
cargo install cargo-deny --version 0.20.2 --locked
cargo deny --workspace --all-features --locked check
```
`deny.toml` checks advisories, licenses, duplicate versions, and dependency sources
across all platforms, including development dependencies. Duplicate versions produce
warnings; wildcard dependencies and unapproved sources fail the check. The example
app has a separate lockfile and is not included in this audit.
Update affected dependencies before adding advisory exceptions. Each exception must
identify the upstream constraint and explain why an update cannot resolve it. Remove
exceptions when upstream dependencies no longer require them. Review license additions
and allow only the registries and Git repositories the package needs.
Rust dependencies are checked with cargo-deny on every push and pull request. The example
app has its own lockfile and is not checked. Run the same check locally:
```bash
cargo install cargo-deny@0.20.2 --locked
cargo deny --workspace --all-features --locked check
```
Fix advisories by updating the dependency where possible. Any exception in `deny.toml`
must say why an update cannot resolve it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simplified the section as suggested, keeping the local commands and exception guidance.

Comment thread .github/workflows/ci.yml Outdated
run: rustup toolchain install

- name: Install cargo-deny
run: cargo install cargo-deny@0.19.8 --locked

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's standardise on cargo-deny 0.20.2, the latest release, across the plugins.

Suggested change
run: cargo install cargo-deny@0.19.8 --locked
run: cargo install cargo-deny@0.20.2 --locked

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated CI to cargo-deny 0.20.2 to match the README and the other plugins.

Update the affected HTTP, TLS, XML, and error-handling dependencies.
Require patched Tokio versions for downstream consumers.
Check advisories, licenses, duplicate versions, and sources on pushes
and pull requests. Document unavoidable GTK exceptions.
@gabref

gabref commented Oct 30, 2026

Copy link
Copy Markdown
Contributor Author

Squashed both follow-up commits into their original commits. The PR now contains two commits.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add cargo-deny to CI

2 participants