Skip to main content

Module install

Module install 

Source
Expand description

Checking a sysroot artifact and putting it in the cache.

Design: spec/cross-compile/13-distribution.md section 13.8, which divides a fetch in two. A downloader the machine already has moves the bytes, and everything that decides whether the result is correct is here. That division is why this file has no URL in it and runs no network code: what it is handed is a file on disk and the hash that file is supposed to have.

§The order, which is the whole of the argument

The hash of the archive is checked before anything is unpacked. So what tar is pointed at is always a file we have already identified, and an unpacker’s behaviour on a file somebody else chose is not a question this has to have an answer to.

Then the files that came out are checked against the manifest the producer put in the archive, in both directions. Every line has to name a file with the sha256 it recorded, and every file has to be named by a line. The second direction is the one that is easy to leave out and it is the one that matters: rucc_sysroot::Manifest::digest is a claim about what is under a directory, and a file nobody recorded makes it a claim about less than what is there.

The manifest is the producer’s rather than ours because of what is in it. An input carries a source, a URL and a licence, and a walk of a directory tree knows none of the three. The producer in tamnd/rucc-cross knows all of them, so it writes the record and this checks it against the bytes, which is the same shape as section 13.6’s rule about a generated artifact being checked against its generator.

Only then is the result renamed into place, which is section 13.2’s concurrency rule. The staging directory is inside the cache so that the rename is a rename and not a copy, because the two paths are on one filesystem by construction.

Structs§

Installed
What an install left behind.

Enums§

Before
What was at the destination before an install put something there.

Functions§

install
Check an artifact and install it as the sysroot for a target.
install_kernel
Check the kernel header tree’s artifact and install it where every Linux target reads it.
verify
Check a file against the hash it is supposed to have.