Skip to main content

Module fetch

Module fetch 

Source
Expand description

Remote import fetch and materialization (ADR-0002 §5, §7; ADR-0004 §9).

fetch downloads one artifact over HTTP with ureq (synchronous, minimal — ADR-0004 §9). materialize_imports drives the whole resolution: for every remote import URL it reuses a cache hit when the lockfile-pinned hash is already unpacked, fetches and caches otherwise, and regenerates the lockfile from the hashes it resolved. Under Frozen::Yes it never fetches and fails on any import that is missing from the lockfile or absent from the cache (ADR-0002 §7).

The fetched artifact is an uncompressed tar archive of one package directory (ADR-0007 decision 12, provisional until the registry spec is written); Cache::store unpacks it.

This module sits behind the fetch feature: it pulls ureq for the network and drives the fetch-gated Cache.

Structs§

FetchError
A remote fetch failure: the human-readable reason. It carries no source span because it concerns a URL, not a byte range.

Enums§

Frozen
Whether a materialize run verifies against the lockfile strictly and never fetches (Frozen::Yes, ridlc --frozen) or fetches and regenerates the lockfile as needed (Frozen::No).

Functions§

fetch
Downloads the artifact at url and returns its bytes.
materialize_imports
Materializes every remote import into the cache and returns the resolved (url, unpacked-package-directory) pairs, the regenerated Lockfile, and any diagnostics.