pub async fn resolve_windows_packages(
linux_pkgs: &[String],
source_distro: &str,
) -> Result<Vec<ResolvedWindowsPackage>>Expand description
Resolve a batch of Linux package names to ResolvedWindowsPackages.
For each package, resolution order is:
- Relocatable artifact โ
GET {discover}/{pkg}?discover=true. A forge-release source yieldsResolvedWindowsPackage::DirectRelease; a portable/archive source yieldsResolvedWindowsPackage::RelocatableArchive. This is preferred so the produced image needs no Chocolatey. - Chocolatey fallback โ the existing shard map. A real choco name
yields
ResolvedWindowsPackage::ChocoFallback; the__skip__sentinel yieldsResolvedWindowsPackage::Skip. - Unresolved โ neither source knows the package: surfaced as
Err(BuildError::ChocoResolutionFailed)by the caller (the translator decides whether an unresolved package is fatal). Here it is simply omitted from the result vector so callers can detect the gap by name.
All shards needed by the batch are fetched once via
resolve_chocolatey_packages and reused. Discovery is a per-package
GET; failures (offline, 404) degrade silently to the choco fallback.
ยงErrors
Returns Err(BuildError::CacheError) if the platform cache directory
cannot be determined (the only unrecoverable setup failure). Per-package
discovery/network failures degrade to the Chocolatey fallback and never
abort the batch.