1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
//! Generating `PROVENANCE` from the target table, the pinned artifacts and the licence walls.
//!
//! Design: `spec/cross-compile/13-distribution.md` section 13.5, whose last line asks for the
//! provenance of every target to ship beside the binary so it can be audited without running the
//! compiler.
//!
//! The text is `rucc_sysroot::distribution::render` and what is here is the file and the two modes,
//! which is the shape `docs`, `abi-corpus` and `link-lines` already have. A generated file that is
//! committed and checked is the only form that works for this one: the release builds a binary per
//! host, two of those hosts cannot run what they built, and a file written by running the compiler
//! would therefore be written on three machines and missing on two.
//!
//! The release version is in the file, so a version bump regenerates it. That is deliberate rather
//! than tolerated. A provenance record that did not name the release it describes would be a file
//! somebody extracted from one archive and read beside another, and the check below is what makes
//! the bump and the file move together.
use Path;
use ExitCode;
/// Write the file or check the one on disk, which is what the two flags are.
pub
/// The file's name, at the top of the repository beside the readme and the licence.
///
/// Uppercase and without an extension because of where it ends up: `.github/package.sh` copies it
/// into the archive next to `README.md`, `LICENSE-APACHE` and `CHANGELOG.md`, and somebody who has
/// unpacked a release and is looking for what is in it reads the names in that column.
const NAME: &str = "PROVENANCE";
/// Write the file, or check that the one on disk matches what the tables say.
pub