build(deny): a supply-chain gate: advisories, licences, sources (cargo-deny)

Nothing checked what the program is built from. `just deny` now does, in
the lint part of `just check` and weekly in scheduled.yml (an advisory
is published when it is, not when we push), from one file, deny.toml:

- advisories: no crate in the lock file with a known vulnerability
  (RustSec), none yanked; an unmaintained crate is refused when it is
  one of our own direct dependencies. Two advisories are lived with,
  each with its reason and date: the quick-xml 0.38 that typst's
  citation reader brings, which no XML from outside reaches.
- licences: the permissive ones, plus MPL-2.0 for one unchanged crate
  (option-ext) and CDLA-Permissive-2.0 for Mozilla's root certificates.
  No font licence is allowed, so a crate that carries fonts is refused
  and every font we ship is a file here beside its licence. A crate
  offering only a copyleft licence is refused.
- sources: crates.io and the bookspec repository, nothing else.
- bans: no dependency by wildcard version.

The crates are marked `publish = false` (one line in the workspace,
inherited by all eleven): they are parts of one program, not libraries
for crates.io, and with that cargo-deny accepts their path dependencies
on each other.

cargo-deny 0.20.2 is a build tool pinned in mise.toml, not a dependency
of the program.

Shown: `just deny` prints advisories ok, bans ok, licenses ok, sources
ok on this tree.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
swaitsandClaude committed 2026-11-09 20:03:51 -07:00
1 parent 9ad6f89816
commit 1726c8b6dd
17 files changed
+124

No files matched your search

+10
View File
@@ -38,6 +38,7 @@ check-shard shard:
RUSTDOCFLAGS="-D warnings" cargo doc --workspace --no-deps --quiet
just server-only
just check-shards-agree
just deny
;;
# The viewer's tests are half of the suite's time, in two halves
# of their own: its unit tests, and its integration tests. Between
@@ -56,6 +57,15 @@ check-shard shard:
;;
esac
# What every dependency must be (deny.toml): free of known vulnerabilities
# (the RustSec database, fetched now), not yanked, under a licence that
# fits MIT OR Apache-2.0, and from crates.io or the bookspec repository.
# The first run (2026-11-09) found 23 advisories in the lock file. A new
# advisory turns this red on an unchanged tree: that is its job, and the
# weekly run makes it within a week of the advisory, push or no push.
deny:
cargo deny check
# CI's list of parts is this file's: a part CI never runs is a check
# nobody makes, and a part only CI names fails there, not here.
check-shards-agree: