Expand description
Getting the Windows SDK and the MSVC CRT onto this machine, with the licence said out loud and accepted first.
Design: spec/cross-compile/13-distribution.md section 13.4. Neither of those two things is
ours to redistribute, and neither ever will be, so there is no artifact a release of this
compiler pins for an MSVC target and rucc --fetch of one says so. What Microsoft does publish
is a manifest naming every file its own installer would fetch, and a licence that lets a person
who accepts it fetch them, which is the mechanism cargo-xwin uses and the one copied here.
rucc_sysroot::msvc is the reading half: it takes the two documents and says which files a
compiler needs out of the nineteen thousand packages in them. This is the half that moves bytes.
It prints the licence, refuses to go on without explicit acceptance, downloads the selection into
the cache with every file held against the hash the manifest gives for it, and then lays the
downloads out as the tree --sysroot reads. tree is the mapping from a file in a package to
its place in that tree, and rucc_unpack is the four readers a download is four formats deep
of.
§Why the tree is per target
Because the record of it is. spec/cross-compile/13-distribution.md section 13.5 asks for a
manifest saying where every file came from and what may be done with it, Manifest is that
record, and it carries one target. A tree that served three architectures would carry a record
that named one of them and said nothing about the other two.
What that costs is the headers, which are the same for every architecture and are written again under each target that is fetched. That is 78 MB of the 330 MB a target comes to, measured on the September 2026 kit, and it is only paid by somebody who fetched more than one architecture on one machine. The libraries, which are the larger half, were never shared.
§The two downloads with no hash behind them
The channel manifest is the root of the chain, so nothing above it could name its hash. The
installer manifest has a hash published for it in the channel and that hash does not match the
file served at the URL the channel names in the same breath, which was measured rather than
assumed and is written down in section 13.4. Both go through crate::fetch::trusted, which
carries that weaker claim in its name. Every file after them goes through crate::fetch::fetch
with the hash the installer manifest gives for it, and those hashes are exact.
§Why the manifests are fetched before the licence is accepted
Because the licence is in them. The channel manifest is where the link to the Build Tools licence comes from, so a run that printed a licence without fetching it would be printing a URL this compiler had made up and kept up to date by hand. The two documents are Microsoft’s description of what it publishes rather than the things the licence is about, and what the acceptance guards is the download of the files themselves, which is what happens after it.
Modules§
- tree
- Where each file in a Microsoft package goes in the tree
--sysrootreads.
Constants§
- CHANNEL
- The channel manifest, which is where every run starts.
Functions§
- fetch_
msvc_ sdk - Fetch the SDK for
target, having printed the licence and been told it is accepted.