pub struct Manifest { /* private fields */ }Expand description
The record of one produced sysroot.
Implementations§
Source§impl Manifest
impl Manifest
Sourcepub const fn new(target: TargetTuple) -> Self
pub const fn new(target: TargetTuple) -> Self
An empty manifest for this target.
Sourcepub const fn target(&self) -> TargetTuple
pub const fn target(&self) -> TargetTuple
The target this sysroot is for.
Sourcepub const fn kernel(&self) -> Option<Version>
pub const fn kernel(&self) -> Option<Version>
The Linux release the kernel headers in this sysroot came out of, when one was recorded.
Absent has one meaning and it is not “nobody knows”: it is that this sysroot has no kernel headers in it. Every target that is not Linux is in that case, and so is a Linux sysroot produced before a kernel tree was installed beside it, which is a state the producer allows because the two trees are two commands. That is the one thing an optional line can mean here and it is why this one is optional where the provenance field is not: a file with no kernel headers in it has no kernel version, and an input always came from somewhere.
What it is for is the question somebody asks after a cross build read a header nobody
expected. -print-sysroot answers where and the manifest answers what, and a sysroot whose
record names the release its linux/ headers came out of makes a stale pairing visible
instead of leaving it to be guessed at. Nothing here checks the version against the headers
themselves, which is tamnd/rucc#925’s argument applied to the kernel tree rather than to
glibc.
Sourcepub const fn set_kernel(&mut self, version: Version)
pub const fn set_kernel(&mut self, version: Version)
Record which Linux release the kernel headers came out of.
Infallible, and in particular it does not refuse a target that has no kernel headers. The
property this type owes its callers is that Manifest::parse reads back what
Manifest::render wrote, so the reader accepts every manifest a producer can build and a
kernel line on a Windows sysroot is a bug in the producer rather than a corrupt file.
Sourcepub fn redistributable(&self) -> bool
pub fn redistributable(&self) -> bool
Whether an artifact containing this whole sysroot can be published.
One input under a licence that says no makes the answer no, which is the only reading of a licence wall that is worth anything.
Sourcepub fn sources(&self) -> Vec<&str>
pub fn sources(&self) -> Vec<&str>
Every distinct source in the manifest, sorted.
What a person asks first when two manifests differ, and what a licence notice is generated from.
Sourcepub fn render(&self) -> String
pub fn render(&self) -> String
The manifest as text, sorted by path.
The sort is what makes two runs comparable. A directory walk returns files in whatever order the filesystem keeps them, which differs between ext4 and APFS and sometimes between two runs on one of them, and a manifest that carried that order would report a difference between two identical sysroots.