Expand description
Windows keg provisioning — “our apt” for the HCS sandbox.
The Windows analogue of the macOS crate::source_build /
crate::prebuilt paths. The HCS sandbox has no package manager, so this
provisions a named tool into a self-contained, relocatable keg with the
same KegManifest layout the macOS kegs use, and the same on-disk cache
key (<cache>/<tool>-<version>-<arch>/ + a .ready marker).
§Strategy
git→ MinGit (ensure_mingit). Git for Windows publishes MinGit, a fully self-contained, relocatable portable zip (no installer, no registry writes, no absolute-path baking) — exactly the Windows equivalent of a relocation-free keg. We resolve the latest release from thegit-for-windows/gitGitHub releases, fetch the right architecture’sMinGit-<ver>-{64-bit,arm64}.zip, and extract it into the keg.- Everything else → choco fallback. Formulae with no relocatable
portable artifact are installed with
choco installinside a throwaway HCS compute system and captured into a keg. That path needs a live HCS host, so it is owned by the runtime/builder layer (which has the HCS machinery) — invoked when this module returnsToolchainError::NotImplementedfor a non-portable formula — rather than pulled into this leaf crate (which must not depend on the HCS stack).
This module is compiled on all hosts (it is pure HTTP + zip extraction + manifest I/O), so the keg format and MinGit resolver are unit-testable on a macOS build host even though the kegs are only provisioned for Windows containers.
Functions§
- ensure_
mingit - Provision the
gitkeg from MinGit (a relocatable portable zip). - ensure_
windows_ keg - Provision (or reuse) a Windows keg for
pkg, returning the keg directory. - windows_
arch_ token - Architecture token used in keg cache keys + MinGit asset names
(
x86_64/arm64).