Expand description
What a produced sysroot carries: every input, where it came from, its hash and its licence.
Design: spec/cross-compile/08-sysroots.md section 8.6 for the licence half and
spec/cross-compile/02-the-goal.md claim 5 for the rest.
§Two jobs, one file
Claim 5 asks for byte identical output from two hosts for the same target. Checking that over a sysroot means comparing several thousand files, and the first thing anybody does when the comparison fails is ask which file and where it came from. A manifest answers both, and comparing two manifests is a diff of a few hundred lines rather than of a directory tree.
The other job is the licence wall. Section 8.6 says the macOS SDK and the Windows SDK cannot be
redistributed, and the way that rule gets enforced rather than remembered is that every input
carries its licence and Manifest::redistributable is a function anything that publishes an
artifact can call. A rule in a document is a rule somebody breaks in eighteen months.
§The format
Tab separated lines, sorted by path, with a two line header. Not JSON, because the thing this is optimized for is a person reading a diff between two of them, and not TOML, because it has no nesting and a parser for it is thirty lines. Sorted because the order files come out of a directory walk is a property of the filesystem, and a manifest whose line order depended on that would report a difference between two identical sysroots.
use rucc_sysroot::{Input, Licence, Manifest};
use rucc_tuple::TargetTuple;
let target: TargetTuple = "aarch64-linux-musl".parse().unwrap();
let mut manifest = Manifest::new(target);
manifest.push(Input {
path: "include/generic/stdio.h".into(),
source: "musl-1.2.5".into(),
sha256: "0".repeat(64),
licence: Licence::Mit,
});
let text = manifest.render();
assert_eq!(Manifest::parse(&text).unwrap(), manifest);
assert!(manifest.redistributable());Structs§
- Input
- One file in a sysroot, and everything that has to be true of it.
- Manifest
- The record of one produced sysroot.
Enums§
- Licence
- The licence an input arrives under.
- Manifest
Error - What went wrong reading a manifest.