Skip to content

ci: a cargo tool that GitHub's release host does not serve is built from crates.io (#1585) - #1586

Merged
DrunkOnJava merged 4 commits into
mainfrom
ci/1585-cargo-tool-fallback
Nov 9, 2026
Merged

DrunkOnJava merged 4 commits into
mainfrom
ci/1585-cargo-tool-fallback

Conversation

@DrunkOnJava

@DrunkOnJava DrunkOnJava commented Nov 9, 2026 •

Copy link
Copy Markdown
Owner

Summary

ci.yml installs cargo-nextest, cargo-semver-checks, cargo-public-api, cargo-deny and cargo-audit through a new composite action, .github/actions/install-cargo-tool. It runs taiki-e/install-action and, if that step fails, builds the same pinned version from crates.io with cargo install --locked --force, so a long 504 from GitHub's release host cannot fail the job (#1585). A version that does not exist, or a crate that does not build, still fails it.

Closes #1585.

Motivation

On 2026-11-09 GitHub's release host (release-assets.githubusercontent.com) answered HTTP 504 for hours. It failed the sccache download on Windows five times in a row (#1572, #1573), then the actionlint download (#1574, #1577), and then Install cargo-nextest in full / build + real files / macos-26 / stable: taiki-e/install-action retried 11 times from 07:47:08Z to 07:48:04Z, got 504 each time, and failed the job (run 42581131725 on #1581's head 5b06054, and again on its next head). Nothing was tested, so the red said nothing about the change. The action's own fallback, cargo-binstall, fetches from the same host, so it fails together with the download. crates.io's download host is a different one.

Changes

  • .github/actions/install-cargo-tool/action.yml (new): inputs crate and version. Step one runs taiki-e/install-action (pinned as ci.yml pinned it, v2.90.2) with continue-on-error. Step two runs only if step one failed: it prints a warning naming CI: cargo tools fail the job when GitHub's release host returns 504 (cargo-nextest on macOS, run 42581131725) #1585 and runs cargo install --locked --force "$CRATE" --version "$VERSION". --force because a binary may already be in ~/.cargo/bin without cargo's record of it (Swatinem/rust-cache restores one that install-action put there on an earlier run), which cargo install refuses to overwrite. The inputs reach the script through env, not through the expression.
  • .github/workflows/ci.yml: cargo-nextest in the test matrix, the i686 job and the corpus job, cargo-semver-checks and cargo-public-api (two steps now, one per tool), cargo-deny and cargo-audit use it, at the versions they had.
  • Not changed: shellcheck (not a cargo tool, and ci: the actionlint download falls back to the Go module proxy when GitHub's release host fails (#1574) #1577 gave env config lint its own actionlint fallback), the wasm-tools action, and scheduled-checks.yml, fuzz.yml and release-binaries.yml, which still use install-action alone.

Testing

Unit tests: N/A. The check is a CI run with the download forced to fail.

  • python3 -c 'import yaml; yaml.safe_load(...)' on ci.yml and the action; actionlint with the repository's config on every workflow exits 0; tools/ci/check-workflows.py passes (74 uses of this repository's own actions, each input declared); zizmor reports only the pre-existing dependabot-cooldown warnings.
  • On a runner, with the download forced to fail by a temporary commit (892db01, the action asked install-action for version 0.9.1469 instead of 0.9.146, which does not exist; reverted in the last commit, so this pull request changes ci.yml and the action alone). The first forced run (42582243207) found a defect: the i686 and corpus jobs failed on error: binary 'cargo-nextest' already exists in destination, the restored binary above, and --force fixed it. The second (42582521323, head 3507a58) passed full / CI passed with every cargo tool built from crates.io after install-action failed: cargo-nextest on ubuntu, windows and macos-26 and in the i686 and corpus jobs, cargo-deny, cargo-audit, and cargo-semver-checks and cargo-public-api. The job log of cargo deny shows install-action's cargo-binstall fatal error, then the warning GitHub's release host did not serve cargo-deny 0.20.2 (#1585); building it from crates.io, then the job passing. The jobs took longer by the build: semver checks 6m56s against 2m33s and macos-26 12m25s against 6m26s on feat(ifc): Revit 2017 to 2023 steel beams are drawn as their type's I section (#1190) (RE-365) #1518's head; the build runs only when the download fails.
  • The normal path (the download works, nothing is built) is this pull request's own full / CI passed on its final head.

Audit-honesty checklist

  • A wrong version, or a crate that does not build, still fails the job: the second step's exit status is the action's.
  • The fallback builds the version ci.yml pins, --locked to the lockfile its authors released; the binary is not checked against a hash of its own, which a source build cannot offer. The download's own checksum check stays on the normal path.
  • No emojis, private paths or PII.

Legal and contribution hygiene

  • Apache-2.0. No Autodesk source, internals or NDA material.

Breaking changes

None.

…rom crates.io (#1585)

taiki-e/install-action retries a download for about a minute and its own
fallback fetches from the same host, so a long 504 from that host failed
cargo-nextest on macos-26 with nothing tested. install-cargo-tool tries the
action and, if it fails, runs cargo install --locked at the same pinned
version. ci.yml's cargo-nextest, cargo-semver-checks, cargo-public-api,
cargo-deny and cargo-audit steps use it.
…1585)

The forced-failure run found it: a cargo-nextest in ~/.cargo/bin that
install-action put there on an earlier run, and rust-cache restored, made
cargo install refuse (binary already exists in destination).
…es.io fallback runs (#1585); reverted in the next commit"

This reverts commit 892db01.
@DrunkOnJava
DrunkOnJava merged commit 26f9986 into main Nov 9, 2026
43 of 44 checks passed
@DrunkOnJava
DrunkOnJava deleted the ci/1585-cargo-tool-fallback branch November 9, 2026 08:29
DrunkOnJava added a commit that referenced this pull request Nov 9, 2026
…n a release-host outage, and the installs it does not cover (#1585) (#1588)

## Summary

`docs/maintaining.md` gets a section on the cargo tools CI installs:
`.github/actions/install-cargo-tool` (merged in #1586), what it does
when GitHub's release host does not serve a tool's binary, how to add a
tool, and the installs it does not cover (shellcheck,
`scheduled-checks.yml`, `fuzz.yml`, `release-binaries.yml`, the
`wasm-tools` action), where a long outage fails the job and the job is
rerun with `gh run rerun --failed`.

## Testing

Documentation only; `tools/ci/api-doc-ids.py` passes.

## Audit-honesty checklist

- [x] The text states only what #1586 does and measured (run
42582521323), and names what it leaves as it was.
- [x] No emojis, private paths or PII.

## Legal and contribution hygiene

- [x] Apache-2.0. No Autodesk source, internals or NDA material.

## Breaking changes

None.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CI: cargo tools fail the job when GitHub's release host returns 504 (cargo-nextest on macOS, run 42581131725)

1 participant