Skip to main content

Module distribution

Module distribution 

Source
Expand description

What a release brings onto a machine, per target, as one file an auditor can read.

Design: spec/cross-compile/13-distribution.md section 13.5, whose last line asks for the same provenance as -print-sysroot-provenance gives, for every target, shipped beside the binary so that it can be audited without running the compiler.

§What it can honestly say today

Not what a produced sysroot is made of, because no release ships one yet. crate::Manifest is that record and it is written by the producer that writes the files, which means it exists on a machine that has the tree rather than in a release that has not got one. What a release can say is what it will bring: for every target in the table, whether the sysroot for it is in the archive already, is pinned as a download with a URL and a hash, is behind a licence wall and therefore will never be either, or is ours to ship and nobody has published it yet.

That is four states and they are the four sentences a person gets from the compiler when they ask for a target, which is the property worth having: the file says in advance what --fetch and a cross compile will say, so somebody deciding whether this compiler can be used inside their organization does not have to run it once per target to find out.

§Why a file in the repository rather than something the release writes

Because the release builds a binary per host and two of those hosts cannot run what they built, so a file produced by running the compiler would be produced on three machines and absent on two. Generated and committed instead, the way docs/TARGETS.md and tests/link-lines already are, with cargo xtask provenance --check in CI holding it to the tables it came from. So the file is auditable in the repository as well as in the archive, and a release whose file drifted from its own tables does not get built, because the check runs before the tag is packaged.

§Why there is no parser here

Nothing of ours reads it. The sysroot manifest has crate::Manifest::parse because an install checks a tree against the one inside it, and this file has no such consumer: it is written for whoever is asking what the release contains, and they have cut and grep. The format is lines of tab separated fields under a version so that writing the parser they do want is ten minutes.

Enums§

Arrival
How the sysroot for one target reaches the machine that compiles for it.

Functions§

render
The whole file, for a release named by version.