Chapter 23: third-party-notices/src, two verbs again

One file, shaped like cargo-gen's (chapter 21):

third-party-notices generate <texts-dir> (-- <out-file> <package> <binary> <crate-dir>...)...
third-party-notices write (<generated-file> <name>)...

generate runs in the buck build. Each -- group is one artifact: the file to write, the package and binary it is for, and the crate archives linked into it. For each crate it reads package.name, version, license and license-file from the crate's Cargo.toml, every top-level LICENSE, LICENCE, COPYING or NOTICE file, and the files of a REUSE LICENSES/ folder, falling back to texts/ for the crates that ship none. Identical texts are written once, naming every crate that carries them. write copies the generated files into the checkout, each under its name.

Try it. Read the header of main.rs: its rules for what fails the build are the reason the notices can be trusted.

For the people who maintain it

FileWhat
main.rsgenerate and write.

← Previous: Chapter 22, third-party-notices/ · Up: third-party-notices · Next: Chapter 24, record-gates/ →