Skip to content

feat: add `download_template` extension

Matthew Clarkson requested to merge download_triplet into main
download = use_extension("@download_utils//download/template:defs.bzl", "download_template")
download.archive(
    name = "coreutils-{version}-{triplet}",
    srcs = ["entrypoint"],
    links = {
        "coreutils{executable.extension}": "entrypoint",
    },
    lock = "//coreutils:lock.json",
    strip_prefix = "coreutils-{version}-{rust.triplet}",
    substitutions = {
        "version": [
            "0.0.28",
            "0.1.0",
        ],
        "triplet": [
            "arm64-linux-gnu",
            "amd64-linux-gnu",
            "arm64-linux-musl",
            "amd64-linux-musl",
            "amd64-windows-msvc",
            "arm64-macos-darwin",
            "amd64-macos-darwin",
        ],
    },
    uploads = [
        "https://gitlab.arm.com/api/v4/projects/bazel%2Fdownload_utils/packages/generic/coreutils/{version}/{rust.archive.basename}",
    ],
    urls = [
        "https://gitlab.arm.com/api/v4/projects/bazel%2Fdownload_utils/packages/generic/coreutils/{version}/{rust.archive.basename}",
        "https://github.com/uutils/coreutils/releases/download/{version}/coreutils-{version}-{rust.archive.basename}",
    ],
)

Run bazel mod tidy --lockfile_mode=update to generate the lock file.

Run bazel run @download_utils//download/triplet/lock:upload coreutils/lock.json to mirror the downloads and lock the integrities.

Edited by Matthew Clarkson

Merge request reports

Loading