From 1c844c58cfd23c3bd83086a14d0c7f8ee8896340 Mon Sep 17 00:00:00 2001 From: jwinterm Date: Tue, 19 May 2026 11:11:14 -0400 Subject: [PATCH] CI: pre-install Rust + iOS targets to fix rustup-during-podbuild race MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Build was failing with: component download failed for rust-std-aarch64-apple-ios-sim: could not rename downloaded file from '.../9362b66...partial' to '.../9362b66...': No such file or directory One of the iOS pods (likely reown_walletkit's yttrium FFI or similar) invokes rustup mid-build to fetch iOS targets. When the pod build runs multiple targets in parallel, multiple rustup processes race on the same .partial download file — one finishes/renames, the next looks for the .partial that's no longer there. Fix: add a workflow step that runs before pod install + flutter build: - Install rustup if missing (idempotent — self-hosted runner persists). - Wipe any stale *.partial files (debris from previous racing). - rustup target add the three iOS triples serially. That way the pod's mid-build rustup invocation finds everything already installed and just no-ops. --- .github/workflows/build-ios-sim.yml | 18 ++++++++++++++++++ .github/workflows/build-ios-testflight.yml | 13 +++++++++++++ 2 files changed, 31 insertions(+) diff --git a/.github/workflows/build-ios-sim.yml b/.github/workflows/build-ios-sim.yml index 959ddee6..ea60e50b 100644 --- a/.github/workflows/build-ios-sim.yml +++ b/.github/workflows/build-ios-sim.yml @@ -75,6 +75,24 @@ jobs: fi pod --version + - name: Install Rust + iOS targets (if missing) + run: | + if ! command -v rustup >/dev/null; then + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable --no-modify-path + echo "$HOME/.cargo/bin" >> "$GITHUB_PATH" + export PATH="$HOME/.cargo/bin:$PATH" + fi + # Clean any partial downloads from a previously crashed install — those + # are the source of the 'could not rename .partial → final: No such + # file or directory' race that breaks parallel pod builds. + rm -rf "$HOME/.rustup/downloads"/*.partial 2>/dev/null || true + # Pre-install iOS targets serially so the pod build doesn't try to + # do it under concurrency. + rustup target add aarch64-apple-ios + rustup target add aarch64-apple-ios-sim + rustup target add x86_64-apple-ios + rustup show + - name: Install Go + gomobile (if missing) run: | if ! command -v go >/dev/null; then diff --git a/.github/workflows/build-ios-testflight.yml b/.github/workflows/build-ios-testflight.yml index 81431621..f7be36a5 100644 --- a/.github/workflows/build-ios-testflight.yml +++ b/.github/workflows/build-ios-testflight.yml @@ -79,6 +79,19 @@ jobs: fi pod --version + - name: Install Rust + iOS targets (if missing) + run: | + if ! command -v rustup >/dev/null; then + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable --no-modify-path + echo "$HOME/.cargo/bin" >> "$GITHUB_PATH" + export PATH="$HOME/.cargo/bin:$PATH" + fi + rm -rf "$HOME/.rustup/downloads"/*.partial 2>/dev/null || true + rustup target add aarch64-apple-ios + rustup target add aarch64-apple-ios-sim + rustup target add x86_64-apple-ios + rustup show + - name: Install Go + gomobile (if missing) run: | if ! command -v go >/dev/null; then -- 2.50.1 (Apple Git-155)