Compare commits

...
30 Commits
Author SHA1 Message Date
Taiki Endo b80e2bb263 Release 2.90.0 2026-11-03 12:37:08 +00:00
Taiki Endo eb7aa1c1f5 Add fallback: skip input option 2026-11-03 21:35:44 +09:00
Taiki Endo c846932407 Update zizmor manifest 2026-11-03 20:28:12 +09:00
Taiki Endo 29b5f800e9 Update vacuum@latest to 0.36.2 2026-11-03 20:28:12 +09:00
Taiki Endo 9787a83ea2 Update uv manifest 2026-11-03 20:28:12 +09:00
Taiki Endo 8d24cc9594 Update typos manifest 2026-11-03 20:28:12 +09:00
Taiki Endo 55b8476233 Update tombi manifest 2026-11-03 20:28:12 +09:00
Taiki Endo dcaca98789 Update release-plz@latest to 0.4.3 2026-11-03 20:28:12 +09:00
Taiki Endo ee94ee5c39 Update cargo-nextest manifest 2026-11-03 20:28:12 +09:00
Taiki Endo 8c1946470a Update bpf-linker@latest to 0.13.0 2026-11-03 20:28:12 +09:00
Taiki Endo 5863fd8b94 ci: Skip xbuild on fedora:latest
Same as
https://github.com/taiki-e/install-action/commit/b95191edaa5c9e3d0d3453611e4a85e076b224c5.
2026-11-03 19:57:53 +09:00
Taiki Endo a3c31bf9a1 Update jq to 1.8.2 2026-11-03 19:56:16 +09:00
Taiki Endo 3d3be60c8e Tweak printf 2026-11-03 19:56:14 +09:00
Taiki Endo 24437237af Remove duplicate definition of RUSTUP_MAX_RETRIES 2026-11-03 19:05:38 +09:00
Taiki Endo 0e788e25d5 Adjust sys_install usage 2026-11-03 18:58:55 +09:00
Taiki Endo 51eaf0f90c Update rustup to 1.29.2 2026-11-03 18:58:52 +09:00
Taiki Endo 682ce6c3c6 Release 2.89.1 2026-11-02 19:55:53 +00:00
Taiki Endo 0d9077fcb6 Update changelog 2026-11-03 04:29:00 +09:00
FirelightFlagboy ad358d449d Add missing bin ld.mold (#2050)
Missing the file `ld.mold` comming from the linux assets.

NB.1: `ld.mold` is a symlink to `mold`.

NB.2: Window platform only provide `mold.exe`.
2026-11-03 04:26:26 +09:00
Taiki Endo 353b306589 Update vacuum manifest 2026-11-03 03:58:31 +09:00
Taiki Endo e1a0ce81ae Update syft manifest 2026-11-03 03:58:31 +09:00
Taiki Endo 2a3464cd4b Update release-plz manifest 2026-11-03 03:58:31 +09:00
Taiki Endo 5f1e428a2a Update parse-dockerfile@latest to 0.1.9 2026-11-03 03:58:31 +09:00
Taiki Endo 96f9ee39b0 Update parse-changelog@latest to 0.6.18 2026-11-03 03:58:31 +09:00
Taiki Endo 75d961f4a7 Update kache manifest 2026-11-03 03:58:31 +09:00
Taiki Endo 202fd96ad6 Update cargo-minimal-versions@latest to 0.1.38 2026-11-03 03:58:31 +09:00
Taiki Endo df5c3c0999 Update cargo-hack@latest to 0.6.46 2026-11-03 03:58:31 +09:00
Taiki Endo f371bdc125 Update bpf-linker manifest 2026-11-03 03:58:31 +09:00
Taiki Endo e9605306a6 codegen: Clean up error handling
Follow-up to 525387f706.
2026-11-03 03:15:30 +09:00
Taiki Endo 8bf69897ab Update changelog 2026-11-02 05:16:40 +09:00
26 changed files with 548 additions and 184 deletions
+6 -2
View File
@@ -300,6 +300,7 @@ jobs:
matrix:
include:
- fallback: none
- fallback: skip
- fallback: cargo-install
- fallback: cargo-binstall
- fallback: cargo-binstall
@@ -334,6 +335,9 @@ jobs:
fallback: ${{ matrix.fallback }}
- run: exit 1
if: matrix.fallback == 'none' && steps.install.outcome != 'failure'
- run: |
! type -P parse-changelog
if: matrix.fallback == 'skip'
- run: |
[[ "$("${RUNNER_TEMP}/binstall/bin/cargo-binstall" binstall -V)" == '0.0.0' ]] || exit 1
[[ "$(cargo-binstall binstall -V)" == "$(jq -r '.latest.version' manifests/cargo-binstall.json)" ]] || exit 1
@@ -341,8 +345,8 @@ jobs:
- name: Test bash
run: parse-changelog --version
shell: bash
if: matrix.fallback != 'none'
if: matrix.fallback == 'cargo-binstall' || matrix.fallback == 'cargo-install'
- name: Test sh
run: parse-changelog --version
shell: sh
if: matrix.fallback != 'none'
if: matrix.fallback == 'cargo-binstall' || matrix.fallback == 'cargo-install'
+26 -2
View File
@@ -10,13 +10,35 @@ Note: In this file, do not use the hard wrap in the middle of a sentence for com
## [Unreleased]
## [2.90.0] - 2026-11-03
- Add `fallback: skip` input option. This is similar to `fallback: none` but skip unsupported tools instead of error. ([#2052](https://github.com/taiki-e/install-action/issues/2052))
- Update `vacuum@latest` to 0.36.2.
- Update `release-plz@latest` to 0.4.3.
- Update `bpf-linker@latest` to 0.13.0.
## [2.89.1] - 2026-11-02
- Install `ld.mold` symlink when installing `mold` on Linux. Previously, only `mold` binary was installed. ([#2050](https://github.com/taiki-e/install-action/pull/2050), thanks @FirelightFlagboy)
- Update `parse-dockerfile@latest` to 0.1.9.
- Update `parse-changelog@latest` to 0.6.18.
- Update `cargo-minimal-versions@latest` to 0.1.38.
- Update `cargo-hack@latest` to 0.6.46.
## [2.89.0] - 2026-11-01
- Support `yq`. ([#2036](https://github.com/taiki-e/install-action/pull/2036), thanks @FirelightFlagboy)
- Support `mold`. ([#2044](https://github.com/taiki-e/install-action/pull/2044), thanks @FirelightFlagboy)
- Fix an error when cargo-binstall had already been installed at non-standard location. ([#2048](https://github.com/taiki-e/install-action/pull/2048))
- Fix an error when old cargo-binstall had already been installed at non-standard location. ([#2048](https://github.com/taiki-e/install-action/pull/2048))
- Update `wasm-tools@latest` to 1.263.0.
@@ -8000,7 +8022,9 @@ Note: This release is considered a breaking change because installing on version
Initial release
[Unreleased]: https://github.com/taiki-e/install-action/compare/v2.89.0...HEAD
[Unreleased]: https://github.com/taiki-e/install-action/compare/v2.90.0...HEAD
[2.90.0]: https://github.com/taiki-e/install-action/compare/v2.89.1...v2.90.0
[2.89.1]: https://github.com/taiki-e/install-action/compare/v2.89.0...v2.89.1
[2.89.0]: https://github.com/taiki-e/install-action/compare/v2.88.1...v2.89.0
[2.88.1]: https://github.com/taiki-e/install-action/compare/v2.88.0...v2.88.1
[2.88.0]: https://github.com/taiki-e/install-action/compare/v2.87.33...v2.88.0
+4 -3
View File
@@ -24,7 +24,7 @@ GitHub Action for installing development tools (mainly from GitHub Releases).
| ---- | :------: | ----------- | ---- | ------- |
| tool | **✓** | Tools to install (whitespace or comma separated list) | String | |
| checksum | | Whether to enable checksums (strongly discouraged to disable) | Boolean | `true` |
| fallback | | Whether to use fallback (none, cargo-binstall, or cargo-install) | String | `cargo-binstall` |
| fallback | | Whether to use fallback (none, skip, cargo-binstall, or cargo-install) | String | `cargo-binstall` |
### Example workflow
@@ -101,14 +101,15 @@ See [TOOLS.md](TOOLS.md) for the list of tools that are installed from manifests
If a tool not included in the list above is specified, this action uses [cargo-binstall] as a fallback.
If you want to ensure that fallback is not used, use `fallback: none`.
If you want to ensure that fallback is not used, use `fallback: none` or `fallback: skip`.
```yaml
- uses: taiki-e/install-action@v2
with:
tool: cargo-hack
# Possible values:
# - none: disable all fallback options
# - none: disable all fallback options (error on unsupported tools)
# - skip: disable all fallback options (skip unsupported tools instead of error)
# - cargo-binstall (default): use cargo-binstall (includes "quickinstall" and "install from source")
# - cargo-install: use `cargo install`
fallback: none
+1 -1
View File
@@ -11,7 +11,7 @@ inputs:
required: false
default: 'true'
fallback:
description: Whether to use fallback (none, cargo-binstall, or cargo-install)
description: Whether to use fallback (none, skip, cargo-binstall, or cargo-install)
required: false
default: 'cargo-binstall'
+163 -123
View File
@@ -109,53 +109,57 @@ download_and_extract() {
*.tar.gz | *.tgz)
tar_args+=('xzf')
if ! type -P gzip >/dev/null; then
case "${base_distro}" in
debian | fedora | suse | arch | alpine)
printf '::group::Install packages required for installation (gzip)\n'
sys_install gzip
printf '::endgroup::\n'
;;
esac
if [[ -n "${base_distro}" ]]; then
printf '::group::Install packages required for installation (gzip)\n'
sys_install gzip
printf '::endgroup::\n'
else
warn "this action requires gzip to install ${tool}"
fi
fi
;;
*.gz)
if ! type -P gzip >/dev/null; then
case "${base_distro}" in
debian | fedora | suse | arch | alpine)
printf '::group::Install packages required for installation (gzip)\n'
sys_install gzip
printf '::endgroup::\n'
;;
esac
if [[ -n "${base_distro}" ]]; then
printf '::group::Install packages required for installation (gzip)\n'
sys_install gzip
printf '::endgroup::\n'
else
warn "this action requires gzip to install ${tool}"
fi
fi
;;
*.tar.bz2 | *.tbz2)
tar_args+=('xjf')
if ! type -P bzip2 >/dev/null; then
case "${base_distro}" in
debian | fedora | suse | arch | alpine)
printf '::group::Install packages required for installation (bzip2)\n'
sys_install bzip2
printf '::endgroup::\n'
;;
esac
if [[ -n "${base_distro}" ]]; then
printf '::group::Install packages required for installation (bzip2)\n'
sys_install bzip2
printf '::endgroup::\n'
else
warn "this action requires bzip2 to install ${tool}"
fi
fi
;;
*.tar.xz | *.txz)
tar_args+=('xJf')
if ! type -P xz >/dev/null; then
case "${base_distro}" in
debian)
printf '::group::Install packages required for installation (xz-utils)\n'
sys_install xz-utils
printf '::endgroup::\n'
;;
fedora | suse | arch | alpine)
printf '::group::Install packages required for installation (xz)\n'
sys_install xz
printf '::endgroup::\n'
;;
esac
if [[ -n "${base_distro}" ]]; then
case "${base_distro}" in
debian)
printf '::group::Install packages required for installation (xz-utils)\n'
sys_install xz-utils
printf '::endgroup::\n'
;;
*)
printf '::group::Install packages required for installation (xz)\n'
sys_install xz
printf '::endgroup::\n'
;;
esac
else
warn "this action requires xz to install ${tool}"
fi
fi
;;
*.tar.zst | *.tzst)
@@ -172,24 +176,24 @@ download_and_extract() {
;;
*.zip)
if ! type -P unzip >/dev/null; then
case "${base_distro}" in
debian | fedora | suse | arch | alpine)
printf '::group::Install packages required for installation (unzip)\n'
sys_install unzip
printf '::endgroup::\n'
;;
esac
if [[ -n "${base_distro}" ]]; then
printf '::group::Install packages required for installation (unzip)\n'
sys_install unzip
printf '::endgroup::\n'
else
warn "this action requires unzip to install ${tool}"
fi
fi
;;
*.deb)
if ! type -P dpkg-deb >/dev/null; then
case "${base_distro}" in
debian | fedora | suse | arch | alpine)
printf '::group::Install packages required for installation (dpkg)\n'
sys_install dpkg
printf '::endgroup::\n'
;;
esac
if [[ -n "${base_distro}" ]]; then
printf '::group::Install packages required for installation (dpkg)\n'
sys_install dpkg
printf '::endgroup::\n'
else
warn "this action requires dpkg-deb to install ${tool}"
fi
fi
;;
esac
@@ -325,6 +329,13 @@ read_manifest() {
*) bail "unsupported OS type '${host_os}' for ${tool}" ;;
esac
}
skip_unavailable_tool() {
if [[ "${fallback}" == "skip" ]] && [[ "${download_info}" == "null" ]]; then
info "$1@$2 for '${host_arch}_${host_os}' is not supported (updating install-action might resolve this); skipping because of 'fallback: skip' input option"
return 0
fi
return 1
}
read_download_info() {
local tool="$1"
local version="$2"
@@ -510,16 +521,17 @@ esac
fallback="${INPUT_FALLBACK:-}"
case "${fallback}" in
none | cargo-binstall | cargo-install) ;;
*) bail "'fallback' input option must be 'none', 'cargo-binstall', or 'cargo-install': '${fallback}'" ;;
none | skip | cargo-binstall | cargo-install) ;;
*) bail "'fallback' input option must be 'none', 'skip', 'cargo-binstall', or 'cargo-install': '${fallback}'" ;;
esac
# Unlike gh command, cargo-binstall reads GITHUB_TOKEN first via cli parser, and then reads GH_TOKEN.
# https://github.com/cargo-bins/cargo-binstall/blob/v1.17.9/crates/bin/src/args.rs#L704
token="${GITHUB_TOKEN:-"${GH_TOKEN:-"${DEFAULT_GITHUB_TOKEN:-}"}"}"
# This prevents tokens from being exposed to subprocesses via environment variables.
# Since the tokens remain in memory, setting `fallback: none` (which prevents the tokens from being
# set in the first place) remains the best practice from a security standpoint, as readme says.
# Since the tokens remain in memory, setting `fallback: none`, `fallback: skip`, or
# `fallback: cargo-install` (which prevents the tokens from being set in the first place) remains
# the best practice from a security standpoint, as readme says.
# Note that this does not prevent token leaks via reading `/proc/*/environ` on Linux or
# via `ps -Eww` on macOS. It only reduces the risk of leaks.
unset GITHUB_TOKEN GH_TOKEN DEFAULT_GITHUB_TOKEN
@@ -548,19 +560,25 @@ case "${RUNNER_OS}" in
# /etc/os-release is available on Debian 7+
base_distro=debian
elif [[ -e /etc/os-release ]]; then
if grep -Eq '^ID_LIKE=' /etc/os-release; then
base_distro=$(grep -E '^ID_LIKE=' /etc/os-release | cut -d= -f2)
case "${base_distro}" in
*debian*) base_distro=debian ;;
*fedora*) base_distro=fedora ;;
*suse*) base_distro=suse ;;
*arch*) base_distro=arch ;;
*alpine*) base_distro=alpine ;;
esac
else
base_distro=$(grep -E '^ID=' /etc/os-release | cut -d= -f2)
fi
base_distro="${base_distro//\"/}"
base_distro=$(grep -E '^ID_LIKE=' /etc/os-release || true)
case "${base_distro}" in
*debian*) base_distro=debian ;;
*fedora*) base_distro=fedora ;;
*suse*) base_distro=suse ;;
*arch*) base_distro=arch ;;
*alpine*) base_distro=alpine ;;
*)
base_distro=$(grep -E '^ID=' /etc/os-release)
base_distro="${base_distro#*=}"
base_distro="${base_distro//\"/}"
case "${base_distro}" in
debian | fedora | suse | arch | alpine) ;;
*) base_distro='' ;;
esac
;;
esac
else
base_distro=''
fi
case "${base_distro}" in
fedora)
@@ -681,39 +699,42 @@ manifest_dir="${GITHUB_ACTION_PATH}/manifests"
case "${host_os}" in
linux)
if ! type -P jq >/dev/null || ! type -P curl >/dev/null || ! type -P tar >/dev/null; then
case "${base_distro}" in
debian | fedora | suse | arch | alpine)
printf '::group::Install packages required for installation (jq, curl, and/or tar)\n'
sys_packages=()
if ! type -P curl >/dev/null; then
sys_packages+=(ca-certificates curl)
fi
if ! type -P tar >/dev/null; then
sys_packages+=(tar)
fi
if [[ "${dnf:-}" == "yum" ]]; then
# On RHEL7-based distribution jq requires EPEL
if ! type -P jq >/dev/null; then
sys_packages+=(epel-release)
sys_install "${sys_packages[@]}"
sys_install jq --enablerepo=epel
else
sys_install "${sys_packages[@]}"
fi
if [[ -n "${base_distro}" ]]; then
printf '::group::Install packages required for installation (jq, curl, and/or tar)\n'
sys_packages=()
if ! type -P curl >/dev/null; then
# Note that we do not fallback to wget.
# Common containers do not install GNU Wget by default and BusyBox wget installed in some
# common containers by default lacks necessary security options (--https-only --secure-protocol=TLSv1_2).
sys_packages+=(ca-certificates curl)
fi
if ! type -P tar >/dev/null; then
# TODO: this is not necessary for some tools using unzip.
sys_packages+=(tar)
fi
if [[ "${dnf:-}" == "yum" ]]; then
# On RHEL7-based distribution jq requires EPEL
if ! type -P jq >/dev/null; then
sys_packages+=(epel-release)
sys_install "${sys_packages[@]}"
sys_install jq --enablerepo=epel
else
if ! type -P jq >/dev/null; then
# https://github.com/taiki-e/install-action/issues/521
if [[ "${base_distro}" == "arch" ]]; then
sys_packages+=(glibc)
fi
sys_packages+=(jq)
fi
sys_install "${sys_packages[@]}"
fi
printf '::endgroup::\n'
;;
*) warn "this action requires at least jq and curl on non-Debian/Fedora/SUSE/Arch/Alpine-based Linux" ;;
esac
else
if ! type -P jq >/dev/null; then
# https://github.com/taiki-e/install-action/issues/521
if [[ "${base_distro}" == "arch" ]]; then
sys_packages+=(glibc)
fi
sys_packages+=(jq)
fi
sys_install "${sys_packages[@]}"
fi
printf '::endgroup::\n'
else
warn "this action requires at least jq and curl on non-Debian/Fedora/SUSE/Arch/Alpine-based Linux"
fi
fi
;;
macos)
@@ -741,8 +762,8 @@ case "${host_os}" in
else
printf '::group::Install packages required for installation (jq)\n'
mkdir -p -- "${install_action_dir}/jq/bin"
url='https://github.com/jqlang/jq/releases/download/jq-1.8.1/jq-windows-amd64.exe'
checksum='23cb60a1354eed6bcc8d9b9735e8c7b388cd1fdcb75726b93bc299ef22dd9334'
url='https://github.com/jqlang/jq/releases/download/jq-1.8.2/jq-windows-amd64.exe'
checksum='a6fc67fedaf9128a3309a1e2ebb8b986aeccf70122ee46d2cb4849e423f0c627'
(
cd -- "${install_action_dir}/jq/bin"
download_and_checksum "${url}" "${checksum}"
@@ -790,7 +811,6 @@ for tool in "${tools[@]}"; do
version=stable
fi
info "installing ${tool}@${version}"
export RUSTUP_MAX_RETRIES="${RUSTUP_MAX_RETRIES:-10}"
rustup_args=(--profile minimal)
if [[ -n "${additional}" ]]; then
component=''
@@ -821,7 +841,7 @@ for tool in "${tools[@]}"; do
else
# https://github.com/rust-lang/rustup/tags
# Run tools/rustup-hash.sh to get sha256 hash.
rustup_version=1.29.0
rustup_version=1.29.2
# https://rust-lang.github.io/rustup/installation/other.html#manual-installation
rust_target=''
checksum=''
@@ -831,33 +851,33 @@ for tool in "${tools[@]}"; do
case "${host_arch}" in
x86_64)
case "${host_env}" in
gnu) checksum=4acc9acc76d5079515b46346a485974457b5a79893cfb01112423c89aeb5aa10 ;;
musl) checksum=9cd3fda5fd293890e36ab271af6a786ee22084b5f6c2b83fd8323cec6f0992c1 ;;
gnu) checksum=5be191e8c70a5007074254cb74d78dbfdd25cd5a61c27de7b8e5410122ec24f4 ;;
musl) checksum=2ba97d668c06dc4b1884f2a3fa6f4cf14b9bd0c1db379af7e4f87a705ff19edd ;;
esac
;;
aarch64)
case "${host_env}" in
gnu) checksum=9732d6c5e2a098d3521fca8145d826ae0aaa067ef2385ead08e6feac88fa5792 ;;
musl) checksum=88761caacddb92cd79b0b1f939f3990ba1997d701a38b3e8dd6746a562f2a759 ;;
gnu) checksum=a9c168dbea81a84671c6b7a5c1795cb0eb699020110d107ddfca427bd797e697 ;;
musl) checksum=7fdbb23acf6495efee2e371580c52b365917551b4835090a225c44ac30915235 ;;
esac
;;
powerpc64le)
case "${host_env}" in
gnu) checksum=4bfff85bd3967d988e14567aa9cc6ab0ea386f0ffeff0f9f14d23f0103bf1f97 ;;
musl) checksum=e15d033af90b7a55d170aac2d82cc28ddd96dbfcdda7c6d4eb8cb064a99c4646 ;;
gnu) checksum=96d46b6164ff778288c789e7e94dd09ce55d35777043aabe4e7af1d99b04bd71 ;;
musl) checksum=d0f97151d3ed165ca11c68b460cabf1b828dc605525ce68bb0ef8f62f78ac8b6 ;;
esac
;;
riscv64)
rust_target="${host_arch}gc-unknown-${host_os}-${host_env}"
# riscv64gc-unknown-linux-musl is tier 2 without host tools
case "${host_env}" in
gnu) checksum=7e43f2b2e6307d61da17a4dff61e6bceef408b8189822df64e1094590d2a70f9 ;;
gnu) checksum=1217772975cb864e12a2cad757cd27d7dcdbac3b490a05ad9b86b61ffa6a8b3b ;;
esac
;;
s390x)
# s390x-unknown-linux-musl is tier 3
case "${host_env}" in
gnu) checksum=66c2c132428b6b77803facb02cbdf33b89d20c00bd20da142be8cb651f2e7cd8 ;;
gnu) checksum=c60999321d0363f6e4d75b646f59ba25feb41b20f872ffb3a46b9a9aea6da1fc ;;
esac
;;
esac
@@ -865,15 +885,15 @@ for tool in "${tools[@]}"; do
macos)
rust_target="${host_arch}-apple-darwin"
case "${host_arch}" in
x86_64) checksum=33cf85df9142bc6d29cbc62fa5ca1d4c29622cddb55213a4c1a43c457fb9b2d7 ;;
aarch64) checksum=aeb4105778ca1bd3c6b0e75768f581c656633cd51368fa61289b6a71696ac7e1 ;;
x86_64) checksum=b9610730ddeef52765723847866fd1e3540b2bf7d5ab0c324aa143a5edf25ba0 ;;
aarch64) checksum=f7c7e11eb2e07f006e532a8aaac77b32f4527d305ac386c0c633ca6133d35ca9 ;;
esac
;;
windows)
rust_target="${host_arch}-pc-windows-msvc"
case "${host_arch}" in
x86_64) checksum=86478e53f769379d7f0ebfa7c9aa97cb76ca92233f79aa2cc0dbee2efaac73c7 ;;
aarch64) checksum=3af309e6c3062aa11df0e932954f69d13b734d8a431e593812f3ecd9ff9e6ef6 ;;
x86_64) checksum=00f139da614dced87d3c3d4121c43eebdac3c1bf8a5ee86b9d80dfd71c8d70fd ;;
aarch64) checksum=58005a321c5dcb9c4457c0a13bb5d6a56a5793efaef429004edaa1db33019b59 ;;
esac
;;
esac
@@ -902,8 +922,11 @@ for tool in "${tools[@]}"; do
installed_bin=("rustc${exe}" "cargo${exe}")
;;
protoc)
info "installing ${tool}@${version}"
read_manifest "protoc" "${version}"
if skip_unavailable_tool "${tool}" "${version}"; then
continue
fi
info "installing ${tool}@${version}"
read_download_info "protoc" "${version}"
# Copying files to /usr/local/include requires sudo, so do not use it.
bin_dir="${install_action_dir}/bin"
@@ -913,13 +936,13 @@ for tool in "${tools[@]}"; do
mkdir -p -- "${include_dir}"
fi
if ! type -P unzip >/dev/null; then
case "${base_distro}" in
debian | fedora | suse | arch | alpine)
printf '::group::Install packages required for installation (unzip)\n'
sys_install unzip
printf '::endgroup::\n'
;;
esac
if [[ -n "${base_distro}" ]]; then
printf '::group::Install packages required for installation (unzip)\n'
sys_install unzip
printf '::endgroup::\n'
else
warn "this action requires unzip to install ${tool}"
fi
fi
mkdir -p -- "${tmp_dir}"
(
@@ -932,7 +955,7 @@ for tool in "${tools[@]}"; do
if [[ -z "${PROTOC:-}" ]]; then
_bin_dir=$(canonicalize_windows_path "${bin_dir}")
info "setting PROTOC environment variable to '${_bin_dir}/protoc${exe}'"
printf '%s\n' "PROTOC=${_bin_dir}/protoc${exe}" >>"${GITHUB_ENV}"
printf 'PROTOC=%s\n' "${_bin_dir}/protoc${exe}" >>"${GITHUB_ENV}"
fi
)
rm -rf -- "${tmp_dir}"
@@ -950,7 +973,9 @@ for tool in "${tools[@]}"; do
*) bail "unsupported host OS '${host_os}' for ${tool}" ;;
esac
# libc6-dbg is needed to run Valgrind
apt_install libc6-dbg
case "${base_distro}" in
debian) sys_install libc6-dbg ;;
esac
# Use snap to install the latest Valgrind
# https://snapcraft.io/install/valgrind/ubuntu
snap_install valgrind --classic
@@ -961,6 +986,12 @@ for tool in "${tools[@]}"; do
latest) ;;
*) warn "specifying the version of ${tool} is not supported" ;;
esac
if [[ "${fallback}" == "skip" ]]; then
read_manifest "${tool}" "latest"
if skip_unavailable_tool "${tool}" "latest"; then
continue
fi
fi
install_cargo_binstall
printf '\n'
continue
@@ -976,7 +1007,7 @@ for tool in "${tools[@]}"; do
taplo-cli | typos-cli | wasm-bindgen-cli | wasmtime-cli) tool="${tool%-cli}" ;;
esac
# Use cargo-binstall fallback if tool is not available.
# Use fallback if tool is not available.
if [[ ! -f "${manifest_dir}/${tool}.json" ]]; then
case "${version}" in
latest) unsupported_tools+=("${tool}") ;;
@@ -985,8 +1016,11 @@ for tool in "${tools[@]}"; do
continue
fi
# Use cargo-binstall fallback if tool is available but the specified version not available.
# Use fallback if tool is available but the specified version or platform is not available.
read_manifest "${tool}" "${version}"
if skip_unavailable_tool "${tool}" "${version}"; then
continue
fi
if [[ "${download_info}" == "null" ]]; then
if [[ "${rust_crate}" == "null" ]] || [[ "${fallback}" == "none" ]]; then
bail "${tool} is supported but version ${version} for '${host_arch}_${host_os}' is not supported (updating install-action might resolve this)"
@@ -1015,7 +1049,9 @@ for tool in "${tools[@]}"; do
cyclonedx)
case "${host_os}" in
linux)
apt_install libicu-dev
case "${base_distro}" in
debian) sys_install libicu-dev ;;
esac
;;
esac
;;
@@ -1084,6 +1120,10 @@ if [[ ${#unsupported_tools[@]} -gt 0 ]]; then
IFS=','
case "${fallback}" in
none) bail "install-action does not support ${unsupported_tools[*]} (updating install-action might resolve this); aborting because fallback is disabled by 'fallback: none' input option" ;;
skip)
info "install-action does not support ${unsupported_tools[*]} (updating install-action might resolve this); skipping because of 'fallback: skip' input option"
exit 0
;;
cargo-binstall)
case "${host_arch}" in
x86_64 | aarch64 | riscv64) ;;
+30 -1
View File
@@ -21,7 +21,36 @@
}
},
"latest": {
"version": "0.12.0"
"version": "0.13.0"
},
"0.13": {
"version": "0.13.0"
},
"0.13.0": {
"x86_64_linux_musl": {
"etag": "0x8DF38C509F31796",
"hash": "0e9b2b30f68898177f1cb6f0ecbfa909a82479473a49a0ef66529fd088e3e410"
},
"x86_64_macos": {
"etag": "0x8DF38C5070813E1",
"hash": "4f33e0aac922606522fe5e4a3a23a5ed8083c3af50a05108301315e50b995502"
},
"x86_64_windows": {
"etag": "0x8DF38C5085F5899",
"hash": "74ee42748b969027ce3ab0a1f07c28316e3583f0e2597e0207bdd0f812bf71ad"
},
"aarch64_linux_musl": {
"etag": "0x8DF38C504C8AA07",
"hash": "248e25f5c6a7242b054bd8f705470abb7a5a79b2b7c07df347c5d7049b783452"
},
"aarch64_macos": {
"etag": "0x8DF38C503997128",
"hash": "a4882533f5d423f8397ba431256d1cef45a3e13dbfc359decafee3800ee90e55"
},
"aarch64_windows": {
"etag": "0x8DF38C503BB78FA",
"hash": "105355bb079bd80bb9067a546dbb6f70e7b5df6eed1ef55f100ceaef019ee4c6"
}
},
"0.12": {
"version": "0.12.0"
+2 -2
View File
@@ -2,10 +2,10 @@
"rust_crate": "cargo-hack",
"template": null,
"latest": {
"version": "0.6.45"
"version": "0.6.46"
},
"0.6": {
"version": "0.6.45"
"version": "0.6.46"
},
"0.6.46": {
"x86_64_linux_musl": {
+2 -2
View File
@@ -30,10 +30,10 @@
}
},
"latest": {
"version": "0.1.37"
"version": "0.1.38"
},
"0.1": {
"version": "0.1.37"
"version": "0.1.38"
},
"0.1.38": {
"x86_64_linux_musl": {
+35
View File
@@ -32,6 +32,41 @@
"0.9": {
"version": "0.9.150"
},
"0.9.151": {
"previous_stable_version": "0.9.150",
"x86_64_linux_gnu": {
"etag": "0x8DF393C83EDAE74",
"hash": "1d4ce302b820c41f4b89c5fb9bce45f0f0c94882c1cf08fc360caf08be6e7df4"
},
"x86_64_linux_musl": {
"etag": "0x8DF393CA83D2EE1",
"hash": "6b284d6fde9670dfb6ee10ea9d9abbc85f95643d3f592472d420d82e257b3a6c"
},
"x86_64_macos": {
"etag": "0x8DF393D73B60DC0",
"hash": "d1d7d025d4bfc9fb154cd76aea3949bd78534829a0589abefa6e5dd4edb135dd"
},
"x86_64_windows": {
"etag": "0x8DF393CF2F41F24",
"hash": "e51bdb4b5883df48f335381b287378edb244318fac65ae0adaf6b9e69298246b"
},
"aarch64_linux_gnu": {
"etag": "0x8DF393C8E5D472D",
"hash": "3e35e8f6913af92558ba09d7155f74e35dd1f0024ef3cd891637433ae4eacbdd"
},
"aarch64_linux_musl": {
"etag": "0x8DF393CA1293677",
"hash": "a9ee2d53cf0711d879f068c0ff814b6fe3af3f9be8799f8ab484e47571087160"
},
"aarch64_windows": {
"etag": "0x8DF393D663B9924",
"hash": "f41cd710db6f2e8f787ec11b7d1007aa66fbea2b8a6f59fd5fe453f5c6fe3699"
},
"riscv64_linux_gnu": {
"etag": "0x8DF393C78E4A8FF",
"hash": "f22d45b452f52c9ac50b30d05ab979d5c4f6e2394d1dabe656a4037acc352727"
}
},
"0.9.150": {
"previous_stable_version": "0.9.149",
"x86_64_linux_gnu": {
+26
View File
@@ -23,6 +23,32 @@
"latest": {
"version": "1.2.2"
},
"2.0.0": {
"x86_64_linux_musl": {
"etag": "0x8DF38FCF3DD13D8",
"hash": "6c59665faf1b14d0944391e6f2a1b510195e6be92c63060a9d1770ed00676824"
},
"x86_64_macos": {
"etag": "0x8DF38FCF35490F8",
"hash": "0ab8b29f659d159de78f70376c6ffa7730879f18fcde397567b683796eb5fd73"
},
"x86_64_windows": {
"etag": "0x8DF38FCF3CEB5D7",
"hash": "e4d974025ffb64c8017ab3dfca9b37023e607fb5a720cb65b441b834e269546f"
},
"aarch64_linux_musl": {
"etag": "0x8DF38FCF25652BB",
"hash": "8c5ca4d1d4b6fc66e5175c8a1150e1daa85099080646322058d9083c72986bba"
},
"aarch64_macos": {
"etag": "0x8DF38FCF26A606B",
"hash": "b46139f7d42895c62962450886dd35f4554c17531209ea69b2db053d2a142bcb"
},
"aarch64_windows": {
"etag": "0x8DF38FCF2537DAB",
"hash": "dd6b3135f7949cb3132697b6ae4affcc50b15ca04f566872b576377394bfaccd"
}
},
"1": {
"version": "1.2.2"
},
+8 -2
View File
@@ -3,7 +3,10 @@
"template": {
"x86_64_linux_gnu": {
"url": "https://github.com/rui314/mold/releases/download/v${version}/mold-${version}-x86_64-linux.tar.gz",
"bin": "mold-${version}-x86_64-linux/bin/mold"
"bin": [
"mold-${version}-x86_64-linux/bin/mold",
"mold-${version}-x86_64-linux/bin/ld.mold"
]
},
"x86_64_windows": {
"url": "https://github.com/rui314/mold/releases/download/v${version}/mold-${version}-x86_64-windows.zip",
@@ -11,7 +14,10 @@
},
"aarch64_linux_gnu": {
"url": "https://github.com/rui314/mold/releases/download/v${version}/mold-${version}-aarch64-linux.tar.gz",
"bin": "mold-${version}-aarch64-linux/bin/mold"
"bin": [
"mold-${version}-aarch64-linux/bin/mold",
"mold-${version}-aarch64-linux/bin/ld.mold"
]
}
},
"latest": {
+2 -2
View File
@@ -2,10 +2,10 @@
"rust_crate": "parse-changelog",
"template": null,
"latest": {
"version": "0.6.17"
"version": "0.6.18"
},
"0.6": {
"version": "0.6.17"
"version": "0.6.18"
},
"0.6.18": {
"x86_64_linux_musl": {
+2 -2
View File
@@ -30,10 +30,10 @@
}
},
"latest": {
"version": "0.1.8"
"version": "0.1.9"
},
"0.1": {
"version": "0.1.8"
"version": "0.1.9"
},
"0.1.9": {
"x86_64_linux_musl": {
+24 -2
View File
@@ -21,10 +21,32 @@
}
},
"latest": {
"version": "0.4.2"
"version": "0.4.3"
},
"0.4": {
"version": "0.4.2"
"version": "0.4.3"
},
"0.4.3": {
"x86_64_linux_musl": {
"etag": "0x8DF38C42FA20D71",
"hash": "4a4cfa92ea2abaee02b40daa596a95ca2725816a6a32cb03a8f48ddead287681"
},
"x86_64_windows": {
"etag": "0x8DF38C4B1783498",
"hash": "a8597928a5d9e326b3ebfc4b85ed2016ae9765347bc77f12a07ffd267de13eeb"
},
"aarch64_linux_musl": {
"etag": "0x8DF38C42AEBC2E3",
"hash": "f9968983da816f30ad8423b5ce7ac93e1e305f913bab6c164b88fbeab434d7cb"
},
"aarch64_macos": {
"etag": "0x8DF38C43E9873EF",
"hash": "b2c6e636199c7fa9dae8838fbebb49cb99933908eb7dd67f25ec831bb38e1c52"
},
"aarch64_windows": {
"etag": "0x8DF38C4D37A6A1E",
"hash": "9177fa5651df1dd13f1825d9d051c426348e176b21357bfd308149dabd4321b1"
}
},
"0.4.2": {
"x86_64_linux_musl": {
+34
View File
@@ -40,6 +40,40 @@
"1": {
"version": "1.55.0"
},
"1.56.0": {
"x86_64_linux_musl": {
"etag": "0x8DF3901D6994151",
"hash": "1c2493cfcf52d3367d6cb25780d9190c111c2219c34c820574c43e8bae15c528"
},
"x86_64_macos": {
"etag": "0x8DF3901D6B61EBF",
"hash": "ff37fb20e8d072e193cb659ecb932994ba2add772cbf86909c368fb95a630c50"
},
"x86_64_windows": {
"etag": "0x8DF3901D6B8B3D4",
"hash": "c4cd2846dc0128e29a947bc6f56e1e5ef01707275b0e58590fbe48105198661d"
},
"aarch64_linux_musl": {
"etag": "0x8DF3901D6C59F52",
"hash": "ace61b9397ae28189c674ae332d67a8074dafd71e87724dfb8b22412d8253bb5"
},
"aarch64_macos": {
"etag": "0x8DF3901D6A3BCD7",
"hash": "c19b97a8c175ac7bd8105b8c8240ce740bf078333b12cc62ea49002c1b33e6e0"
},
"aarch64_windows": {
"etag": "0x8DF3901D6998F29",
"hash": "c235b06385f8b588ddc66b20a80117716ba0f8e584d59a7c186a3c6c8491b6fe"
},
"powerpc64le_linux_musl": {
"etag": "0x8DF3901D6B1690C",
"hash": "4f73890254bcb14c3ed082b372be839e27d52c08bfd950f82644c7aaf125c146"
},
"s390x_linux_musl": {
"etag": "0x8DF3901D6AED3ED",
"hash": "9f5a1cc59ecc6fd67cd919bf40d310d01012431c03b304be0ab077d0a8ca4b4d"
}
},
"1.55": {
"version": "1.55.0"
},
+36
View File
@@ -10,6 +10,42 @@
"1.9": {
"version": "1.9.8"
},
"1.9.9": {
"x86_64_linux_musl": {
"url": "https://github.com/tombi-toml/tombi/releases/download/v1.9.9/tombi-cli-1.9.9-x86_64-unknown-linux-musl.tar.gz",
"etag": "0x8DF3945159052DF",
"hash": "f6094fb14fd962c9611ccd7bc73dc7e8b03fe8859fd662e022b8d0a25649b5fc",
"bin": "tombi-cli-1.9.9-x86_64-unknown-linux-musl/tombi"
},
"x86_64_macos": {
"url": "https://github.com/tombi-toml/tombi/releases/download/v1.9.9/tombi-cli-1.9.9-x86_64-apple-darwin.tar.gz",
"etag": "0x8DF394514DE7F9C",
"hash": "6d7d545c4f33fb7e0547b31f6e0b23bffed801f9a58664563fd9e5df10f52802",
"bin": "tombi-cli-1.9.9-x86_64-apple-darwin/tombi"
},
"x86_64_windows": {
"url": "https://github.com/tombi-toml/tombi/releases/download/v1.9.9/tombi-cli-1.9.9-x86_64-pc-windows-msvc.zip",
"etag": "0x8DF39451565549F",
"hash": "fe5ac50c502f40e3f0da3f725c47fea05716afd5785badeca04966043d6b85d2"
},
"aarch64_linux_musl": {
"url": "https://github.com/tombi-toml/tombi/releases/download/v1.9.9/tombi-cli-1.9.9-aarch64-unknown-linux-musl.tar.gz",
"etag": "0x8DF394514D70DF1",
"hash": "a3ce42ce0825c3ff8c054e443dd8ded013ec5a708bba02e7b4a537b287c75734",
"bin": "tombi-cli-1.9.9-aarch64-unknown-linux-musl/tombi"
},
"aarch64_macos": {
"url": "https://github.com/tombi-toml/tombi/releases/download/v1.9.9/tombi-cli-1.9.9-aarch64-apple-darwin.tar.gz",
"etag": "0x8DF394514D92E74",
"hash": "3e156ba88ae4228b93071d9a4548e6dd64ae0e71d476ae09ee106a0d9a6ca070",
"bin": "tombi-cli-1.9.9-aarch64-apple-darwin/tombi"
},
"aarch64_windows": {
"url": "https://github.com/tombi-toml/tombi/releases/download/v1.9.9/tombi-cli-1.9.9-aarch64-pc-windows-msvc.zip",
"etag": "0x8DF394514EE7339",
"hash": "8a618f3268cb63cadf382464118e26a67d399b1b32d2bdf346f25c71b99e61a6"
}
},
"1.9.8": {
"x86_64_linux_musl": {
"url": "https://github.com/tombi-toml/tombi/releases/download/v1.9.8/tombi-cli-1.9.8-x86_64-unknown-linux-musl.tar.gz",
+22
View File
@@ -26,6 +26,28 @@
"1": {
"version": "1.51.1"
},
"1.52.0": {
"x86_64_linux_musl": {
"etag": "0x8DF3923EAFD19EB",
"hash": "6155d4114f9a0f5b8f6d4fda96266c9d5f6add71df80da7f684ee5e72eb14588"
},
"x86_64_macos": {
"etag": "0x8DF3923E133567E",
"hash": "8de057f425909b02c0184892539755d70ecc3244c4b214ae9382cedd691127e0"
},
"x86_64_windows": {
"etag": "0x8DF3923F330E0BB",
"hash": "7da6eb1932ad86921420a7198dbc9e62a10bcd995144704dc19b81d3fb802182"
},
"aarch64_linux_musl": {
"etag": "0x8DF39238B7B1C90",
"hash": "63b7d4478d467a61fe47cdb3162f720c6797856e61a04f7e125d1cdc282488b8"
},
"aarch64_macos": {
"etag": "0x8DF39244F167C0A",
"hash": "90724dd2905cb1ce033343c71ed60e52fe898674f882803e3110cd228e09e1c5"
}
},
"1.51": {
"version": "1.51.1"
},
+38
View File
@@ -73,6 +73,44 @@
"0.13": {
"version": "0.13.6"
},
"0.13.7": {
"x86_64_linux_musl": {
"etag": "0x8DF395476517355",
"hash": "287491da03f2a785c70fa75b13e1f849918c2f2b5415fe84876b8214eeb792f9"
},
"x86_64_macos": {
"etag": "0x8DF39547572E509",
"hash": "20c47e4c1f630b8abaff8c291fa9b9aa300fef92c4fbff95adf198b55287cda7"
},
"x86_64_windows": {
"etag": "0x8DF3954759BC2E1",
"hash": "0cdc5b38fe5a8168ed6a25814f5ba43c21d313dd3187314fccb37b7cec46e021"
},
"aarch64_linux_musl": {
"etag": "0x8DF395472A364DC",
"hash": "2d3ec076a0c4c0e8250bb6418c44080828b544f1a3be0b6e46adf9fb6923de45"
},
"aarch64_macos": {
"etag": "0x8DF39547242BDE0",
"hash": "81b811b57e4624df7ed3aac148e0359100d9962f3d9dce00aec533dc2e086731"
},
"aarch64_windows": {
"etag": "0x8DF395472055D9C",
"hash": "505d9e65e7692bac3ddf98c66754aa26c5050c409c184af30a881a0a72cc85e3"
},
"powerpc64le_linux_gnu": {
"etag": "0x8DF3954749E5A96",
"hash": "e8b65412482f848743e73566808f5bb480e826c9ce25361997891fcf71299080"
},
"riscv64_linux_gnu": {
"etag": "0x8DF395474B43AF9",
"hash": "48aff38af87c7c8255beb9b51b3676598045786ac5197de15fea54ebfe6c72e1"
},
"s390x_linux_gnu": {
"etag": "0x8DF39547532C8AF",
"hash": "2b64a479b905b9cdab99c71105e523a0d7aa79581cbd716d40bce26d7b595428"
}
},
"0.13.6": {
"x86_64_linux_musl": {
"etag": "0x8DF33C3EC34D0E6",
+28 -2
View File
@@ -21,10 +21,36 @@
}
},
"latest": {
"version": "0.36.1"
"version": "0.36.2"
},
"0.36": {
"version": "0.36.1"
"version": "0.36.2"
},
"0.36.2": {
"x86_64_linux_musl": {
"etag": "0x8DF386231B44435",
"hash": "5736f27a806888f7ed89fba6bb8a3a00e5da895f1ad870f699b3018b7c8bcb0d"
},
"x86_64_macos": {
"etag": "0x8DF386230ADB71F",
"hash": "879cbc99179aebfa6c569e5e6672b60ed19647c15a9e948e3a644c97df69625a"
},
"x86_64_windows": {
"etag": "0x8DF386231B09ED0",
"hash": "758578f69b265955e17d5288959b4d96f76c1eb96374841f7627c54b573e0377"
},
"aarch64_linux_musl": {
"etag": "0x8DF386231EF7540",
"hash": "751f3c6b8f1978deda3c1cec47cdafeeb150c29a9970267df8de26289a1c21c8"
},
"aarch64_macos": {
"etag": "0x8DF3862309E85F7",
"hash": "7fb1666195a8fe2075fd4fb4076831f1152ef8257dfe087d343e71f17a389688"
},
"aarch64_windows": {
"etag": "0x8DF386230AA866C",
"hash": "ae55bbfefd06c2be5b35f8732693e3e6604d55a5dc281bd61b47e8bb1d68ffa1"
}
},
"0.36.1": {
"x86_64_linux_musl": {
+22
View File
@@ -23,6 +23,28 @@
"1": {
"version": "1.31.1"
},
"1.32.0": {
"x86_64_linux_gnu": {
"etag": "0x8DF39391A52B456",
"hash": "bb110cc765eca9cd7efb2e284a956be5974c60027b0970f16397d86208a9957b"
},
"x86_64_macos": {
"etag": "0x8DF39391A54ADEB",
"hash": "6983143c719ada6845a69cc4dd2bacc215f971662fecd8bbd2678388e5ce5969"
},
"x86_64_windows": {
"etag": "0x8DF39391A4A0B83",
"hash": "d284a16e09d9df4ce2c000357e7b59bd531be093bea5718a1ce225b449b59d49"
},
"aarch64_linux_gnu": {
"etag": "0x8DF39391A6A8E50",
"hash": "cb152b207f815116d7fa1c1ee4614f61578803351395052908095e79adfd9fd0"
},
"aarch64_macos": {
"etag": "0x8DF39391A51088C",
"hash": "6efed18c4539a663fd3c851a2be9533fd8456c4e646d9416206da059154a0d3c"
}
},
"1.31": {
"version": "1.31.1"
},
+1 -1
View File
@@ -132,7 +132,7 @@ case "$(uname -s)" in
# no zstd in package manager
debian/eol:jessie-slim | ubuntu:14.04 | alpine:3.2) incompat_tools+=(bpf-linker) ;;
# x: error while loading shared libraries: libssl.so.3: cannot open shared object file: No such file or directory
ubuntu:rolling) incompat_tools+=(xbuild) ;;
ubuntu:rolling | fedora:latest) incompat_tools+=(xbuild) ;;
esac
;;
Darwin)
-1
View File
@@ -5,7 +5,6 @@ default-run = "generate-manifest"
[dependencies]
install-action-manifest-schema = { path = "../manifest-schema" }
anyhow = "1"
flate2 = "1"
fs-err = "3"
jiff = { version = "0.2", default-features = false, features = ["std", "serde"] }
+8 -2
View File
@@ -6,7 +6,10 @@
"platform": {
"x86_64_linux_gnu": {
"asset_name": "${package}-${version}-x86_64-linux.tar.gz",
"bin": "${package}-${version}-x86_64-linux/bin/mold"
"bin": [
"${package}-${version}-x86_64-linux/bin/mold",
"${package}-${version}-x86_64-linux/bin/ld.mold"
]
},
"x86_64_windows": {
"asset_name": "${package}-${version}-x86_64-windows.zip",
@@ -14,7 +17,10 @@
},
"aarch64_linux_gnu": {
"asset_name": "${package}-${version}-aarch64-linux.tar.gz",
"bin": "${package}-${version}-aarch64-linux/bin/mold"
"bin": [
"${package}-${version}-aarch64-linux/bin/mold",
"${package}-${version}-aarch64-linux/bin/ld.mold"
]
}
}
}
+23 -28
View File
@@ -14,7 +14,6 @@ use std::{
time::Duration,
};
use anyhow::{Context as _, Result, bail};
use fs_err as fs;
use install_action_internal_codegen::{
BaseManifest, HostPlatform, Manifest, ManifestDownloadInfo, ManifestRef, ManifestTemplate,
@@ -54,8 +53,7 @@ fn main() {
let repo = base_info
.repository
.strip_prefix(GITHUB_START)
.context("repository must start with https://github.com/")
.unwrap();
.expect("repository must start with https://github.com/");
eprintln!("downloading metadata from {GITHUB_API_START}repos/{repo}");
@@ -108,9 +106,7 @@ fn main() {
base_info.rust_crate = base_info
.rust_crate
.as_ref()
.map(|s| replace_vars(s, package, None, None, base_info.rust_crate.as_deref()))
.transpose()
.unwrap();
.map(|s| replace_vars(s, package, None, None, base_info.rust_crate.as_deref()));
if let Some(crate_name) = &base_info.rust_crate {
eprintln!("downloading crate info from https://crates.io/api/v1/crates/{crate_name}");
let info: crates_io::Crate =
@@ -500,8 +496,7 @@ fn main() {
.asset_name
.as_ref()
.or(base_info.asset_name.as_ref())
.with_context(|| format!("asset_name is needed for {package} on {platform:?}"))
.unwrap()
.unwrap_or_else(|| panic!("asset_name is needed for {package} on {platform:?}"))
.as_slice()
.iter()
.map(|asset_name| {
@@ -513,8 +508,7 @@ fn main() {
base_info.rust_crate.as_deref(),
)
})
.collect::<Result<Vec<_>>>()
.unwrap();
.collect::<Vec<_>>();
let (url, digest, asset_name) = match asset_names.iter().find_map(|asset_name| {
release
.assets
@@ -536,7 +530,7 @@ fn main() {
"{version}-{platform:?}-{}",
Path::new(&url).file_name().unwrap().to_str().unwrap()
));
let response = download(&url).unwrap();
let response = download(&url);
let etag =
response.header("etag").expect("binary should have an etag").replace('\"', "");
@@ -608,7 +602,7 @@ fn main() {
eprintln!("already downloaded");
minisign_verify::Signature::from_file(sig_download_cache).unwrap()
} else {
let buf = download(&url).unwrap().into_string().unwrap();
let buf = download(&url).into_string().unwrap();
eprintln!("download complete");
fs::write(sig_download_cache, &buf).unwrap();
minisign_verify::Signature::decode(&buf).unwrap()
@@ -715,7 +709,6 @@ fn main() {
Some(platform),
base_info.rust_crate.as_deref(),
)
.unwrap()
})
}),
),
@@ -779,7 +772,7 @@ fn main() {
// update an existing manifests.json to avoid discarding work done in the event of a fetch error.
if existing_manifest.is_some() && !version_req_given {
write_manifests(manifest_path, &manifests.clone()).unwrap();
write_manifests(manifest_path, &manifests.clone());
eprintln!("wrote {} with incomplete data", manifest_path.display());
}
}
@@ -939,25 +932,26 @@ fn main() {
manifests.rust_crate = base_info.rust_crate;
write_manifests(manifest_path, &manifests).unwrap();
write_manifests(manifest_path, &manifests);
eprintln!("wrote {}", manifest_path.display());
}
fn write_manifests(manifest_path: &Path, manifests: &Manifests) -> Result<()> {
let mut buf = serde_json::to_vec_pretty(&manifests)?;
#[track_caller]
fn write_manifests(manifest_path: &Path, manifests: &Manifests) {
let mut buf = serde_json::to_vec_pretty(&manifests).unwrap();
buf.push(b'\n');
fs::write(manifest_path, buf)?;
Ok(())
fs::write(manifest_path, buf).unwrap();
}
#[allow(clippy::literal_string_with_formatting_args)]
#[track_caller]
fn replace_vars(
s: &str,
package: &str,
version: Option<&str>,
platform: Option<HostPlatform>,
rust_crate: Option<&str>,
) -> Result<String> {
) -> String {
static RUST_SPECIFIC: &[(&str, fn(HostPlatform) -> &'static str)] = &[
("${rust_target}", HostPlatform::rust_target),
("${rust_target_arch}", HostPlatform::rust_target_arch),
@@ -980,14 +974,14 @@ fn replace_vars(
if s.contains('$') {
for &(var, _) in RUST_SPECIFIC {
if s.contains(var) {
bail!(
panic!(
"base manifest for {package} refers {var}, but 'rust_crate' field is not set"
);
}
}
bail!("variable not fully replaced: '{s}'");
panic!("variable not fully replaced: '{s}'");
}
Ok(s)
s
}
struct GitHubTokens {
@@ -1035,7 +1029,8 @@ static GITHUB_TOKENS: LazyLock<GitHubTokens> = LazyLock::new(|| {
}
});
fn download(url: &str) -> Result<ureq::Response> {
#[track_caller]
fn download(url: &str) -> ureq::Response {
let mut token = GITHUB_TOKENS.get(url);
let mut retry = 0;
let mut retry_time = 0;
@@ -1056,7 +1051,7 @@ fn download(url: &str) -> Result<ureq::Response> {
.set("X-GitHub-Api-Version", "2022-11-28");
}
match req.call() {
Ok(res) => return Ok(res),
Ok(res) => return res,
Err(e) => last_error = Some(e),
}
retry_time += 1;
@@ -1073,17 +1068,17 @@ fn download(url: &str) -> Result<ureq::Response> {
eprintln!("download failed; retrying after {}s ({retry}/{max_retry})", retry_time * 2);
std::thread::sleep(Duration::from_secs(retry_time * 2));
}
Err(last_error.unwrap().into())
panic!("{}", last_error.unwrap())
}
#[track_caller]
fn download_to_buf(url: &str, buf: &mut Vec<u8>) {
download(url).unwrap().into_reader().read_to_end(buf).unwrap();
download(url).into_reader().read_to_end(buf).unwrap();
}
#[track_caller]
fn download_json<T: DeserializeOwned>(url: &str) -> T {
download(url).unwrap().into_json().unwrap()
download(url).into_json().unwrap()
}
#[allow(dead_code)]
+4 -5
View File
@@ -2,13 +2,12 @@
use std::{
fmt, format,
io::{Error, Result},
process::{Command, ExitStatus, Output},
str,
string::{String, ToString as _},
};
use anyhow::{Context as _, Error, Result};
macro_rules! cmd {
($program:expr $(, $arg:expr)* $(,)?) => {{
let mut _cmd = std::process::Command::new($program);
@@ -55,8 +54,8 @@ impl ProcessBuilder {
/// Executes a process, waiting for completion, and mapping non-zero exit
/// status to an error.
pub(crate) fn run(&mut self) -> Result<()> {
let status = self.cmd.status().with_context(|| {
process_error(format!("could not execute process {self}"), None, None)
let status = self.cmd.status().map_err(|e| {
process_error(format!("could not execute process {self}: {e}"), None, None)
})?;
if status.success() {
Ok(())
@@ -151,5 +150,5 @@ fn process_error(mut msg: String, status: Option<ExitStatus>, output: Option<&Ou
}
}
Error::msg(msg)
Error::other(msg)
}
+1 -1
View File
@@ -8,7 +8,7 @@ cd -- "$(dirname -- "$0")"/..
# Get sha256 hash of rustup-init binaries
# NB: Synch with main.sh.
rustup_version=1.29.0
rustup_version=1.29.2
targets=(
x86_64-unknown-linux-gnu
x86_64-unknown-linux-musl