build(notices): say why the generator is offline, and what to do when it fails
cargo-about is run with --offline so the notices text is the same on every machine: it reads only the files each crate was packaged with, and never looks in a crate's repository for a licence file the package left out. Today the two give the same text, byte for byte. The cost is that every crate in Cargo.lock has to be in the local registry, every platform's included, so a failure now says to run `cargo fetch --locked`. The check is not seconds: it reads every crate's files for licence text, about two minutes of wall clock. docs/testing.md says so. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
1 parent
9baf71b2a5
commit
7992c78d30
2 files changed
+14
-6
No files matched your search
+13
-5
@@ -126,12 +126,20 @@ write_notices() {
|
||||
echo "notices: cargo is not installed (mise install)" >&2
|
||||
exit 2
|
||||
}
|
||||
# --offline: no network lookup, so the same crates give the same file
|
||||
# on every machine. The manifest is ledger-cli's, the one executable:
|
||||
# that dependency graph is what the binary links.
|
||||
cargo about generate --locked --all-features --offline \
|
||||
# --offline: cargo-about reads only the crates' own packaged files.
|
||||
# Without it, a crate packaged without its licence file is looked up
|
||||
# in its git repository, so the file could change with no change
|
||||
# here. The cost: such a crate gets the licence's standard text,
|
||||
# without the copyright line its repository holds. The manifest is
|
||||
# ledger-cli's, the one executable: that dependency graph is what the
|
||||
# binary links.
|
||||
if ! cargo about generate --locked --all-features --offline \
|
||||
-m crates/ledger-cli/Cargo.toml -c about.toml \
|
||||
deploy/notices/about.hbs > "$work/about.txt"
|
||||
deploy/notices/about.hbs > "$work/about.txt"; then
|
||||
echo "notices: cargo-about failed. It reads every crate in Cargo.lock from the local" >&2
|
||||
echo "registry, every platform's included: if one is missing, run \`cargo fetch --locked\` first." >&2
|
||||
exit 2
|
||||
fi
|
||||
{
|
||||
cat "$work/about.txt"
|
||||
echo
|
||||
|
||||
Reference in new issue
Block a user