Add download methods which try the OpenWrt mirror, then verify an
upstream source and generate an offline vendor archive with
scripts/gen-cargo-vendor-tarball.sh. cargo-vendor-crate takes a .crate
and cargo-vendor-github a GitHub tag archive. cargo-vendor-archive
takes any other archive tar unpacks: release archives in other
compressions, PyPI source archives, crates published with build
metadata in their version. meson-vendor-wraps puts the files of the
selected [wrap-file] wraps of a meson project into
subprojects/packagecache, as mesa fetches its crates through meson
wraps at configure time.
The GitHub method serves the Rust packages of the packages feed, which
are released as tag archives, some with the Cargo project in a
subdirectory. It fetches the archive from codeload.github.com as
$(PKG_NAME)-$(PKG_VERSION).tar.gz. The top directory of every vendor
archive is the one PKG_BUILD_DIR unpacks to, and an existing
.cargo/config.toml of the project stays in front of the vendor
configuration. With the Cargo project in a subdirectory, both are in
the top directory, where cargo finds them wherever a build runs it.
Canonical tar metadata, checksum normalisation and the staged zstd
compressor keep generated archive contents stable. The archive has mode
0644, which the buildbots keep when they copy new files of dl/ to the
source mirror.
Verify PKG_HASH before atomically publishing the archive. Parse cache
options before selecting Cargo, and use the existing locked, verified
downloader for the pinned official Cargo fallback. The generator keeps
its Cargo home in staging_dir/hostpkg/cargo and its work directory in
tmp/, clears inherited CARGO_* settings and takes the staged cargo or
the pinned official one.
Co-developed-by: Brian Redbeard <redbeard@dead-city.org>
Signed-off-by: Brian Redbeard <redbeard@dead-city.org>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>