From 4723088f08cbe560846e71bd238e2a0d30a84e89 Mon Sep 17 00:00:00 2001 From: Griffin Long <151978260+DrunkOnJava@users.noreply.github.com> Date: Thu, 5 Nov 2026 18:50:30 -0500 Subject: [PATCH 1/2] ci: the Rust install is tried three times, so a failed download does not turn a job red (#1457) --- .github/actions/setup-rust/action.yml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/actions/setup-rust/action.yml b/.github/actions/setup-rust/action.yml index fa4268e3c..6c1f093ae 100644 --- a/.github/actions/setup-rust/action.yml +++ b/.github/actions/setup-rust/action.yml @@ -14,6 +14,11 @@ description: >- # job that must keep another toolchain as the default says so (`make-default`). # Moving a toolchain or an environment variable here moves every key and # discards every cache. +# +# rustup retries a download within seconds, and a download that failed for longer +# turned a job red with nothing wrong in the code (macos-26 on #1483). So the +# install is tried three times, 20 s and 40 s apart. A toolchain that really +# cannot be installed still fails the job, a minute later. inputs: toolchain: description: A rustup toolchain, such as stable, 1.87, nightly-2026-10-01 or nightly @@ -49,7 +54,16 @@ runs: if [ -n "$TARGET" ]; then args+=(--target "$TARGET") fi - rustup toolchain install "$TOOLCHAIN" "${args[@]}" + attempt=1 + until rustup toolchain install "$TOOLCHAIN" "${args[@]}"; do + if [ "$attempt" -ge 3 ]; then + echo "::error::rustup could not install $TOOLCHAIN in 3 attempts" + exit 1 + fi + echo "::warning::rustup could not install $TOOLCHAIN (attempt $attempt of 3); trying again in $((attempt * 20)) s" + sleep "$((attempt * 20))" + attempt=$((attempt + 1)) + done if [ "$MAKE_DEFAULT" = true ]; then rustup default "$TOOLCHAIN" fi From cc1b1f924deb07c2f83eaadb2f9d5afd298bf78c Mon Sep 17 00:00:00 2001 From: Griffin Long <151978260+DrunkOnJava@users.noreply.github.com> Date: Thu, 5 Nov 2026 18:58:56 -0500 Subject: [PATCH 2/2] ci: the IfcOpenShell job's rustfmt comes with its toolchain, through the same retry (#1457) --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 399b073e1..34ca059ab 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -762,6 +762,8 @@ jobs: python-version: "3.12" - name: Install Rust stable uses: $/.github/actions/setup-rust + with: + component: rustfmt - uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3 with: save-if: false @@ -779,7 +781,6 @@ jobs: # schema; the committed file must be the generator's output. - name: The IFC4 property set table is the generator's output run: | - rustup component add rustfmt python tools/ci/gen_standard_property_sets.py > /tmp/standard_property_sets_table.rs rustfmt --edition 2024 /tmp/standard_property_sets_table.rs diff -u src/ifc/standard_property_sets/table.rs /tmp/standard_property_sets_table.rs