Struo
← Changelog

Target kinds download pinned packages from mirrors as cacheable actions

The new download Starlark action fetches a file pinned by its checksum from the first of several mirrors that serves it, including a host cache through a file:// URL. It keeps the file as downloaded or expands a zip, tar, or tar.gz archive, optionally dropping leading path components the way tar --strip-components does. Checksums can be written as the Subresource Integrity strings that package lockfiles store, such as sha512-..., or as sha1, sha256, sha384, or sha512 hex digests.

The cache key is the checksum and the extraction settings, never the mirror list or the credential, so the same pinned package hits the cache on every machine whatever mirrors it lists. This lets target kinds fetch each locked dependency as its own graph action, so a build waits only for the packages it uses.

download_and_extract keeps working as the single-URL, sha256, zip form of download.

Target kinds can also use percent_decode to read URL escapes, unicode_normalize for NFC, NFD, NFKC, or NFKD text, and content_digest to hash UTF-8 text with sha1, sha256, sha384, sha512, or blake3. These functions let resolvers handle native package identifiers without invoking host tools.