From cbb10c2b901b6f8d12c4f301120764bbb0a2f289 Mon Sep 17 00:00:00 2001 From: Sam Valladares Date: Mon, 29 Jun 2026 16:37:02 -0500 Subject: [PATCH] ci: fix persistent macOS clang_rt.osx linker failure (stale target cache) The real cause was not a flaky runner image: the macOS Test job restored a cached `target/` built against a previous runner Xcode, and that stale build dir carried a clang compiler-rt search path (.../clang//lib/darwin) that no longer exists on the current image, so the linker failed with 'ld: library clang_rt.osx not found' on every commit. Fix: stop caching `target/` on the test job (cache only the download-heavy registry/git dirs) and bump the cache key to v2 to discard the poisoned caches. Also deleted the existing poisoned macOS caches. Reverted the macos-14 pin (it didn't help and that image is deprecating) back to macos-latest, which is fine now that target/ is always built clean. Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/workflows/ci.yml | 24 ++++++++++++++++-------- .github/workflows/release.yml | 4 ++-- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d7d2917..de626c8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,10 +18,15 @@ jobs: fail-fast: false matrix: # Pin macOS to macos-14 (Sonoma): the rolling `macos-latest` image - # intermittently ships a broken compiler-rt path ("ld: library - # 'clang_rt.osx' not found"), which fails the Rust link step on an - # otherwise-green commit. macos-14 has a stable Xcode/clang toolchain. - os: [macos-14, ubuntu-latest] + # The "ld: library 'clang_rt.osx' not found" failure is NOT a flaky + # image. It is the linker resolving a clang compiler-rt search path + # (Xcode .../clang//lib/darwin) that no longer exists on the runner, + # because a STALE `target/` was restored from the cache after the + # runner image's default Xcode moved. The real fix is the cache change + # below (we no longer cache `target/`, and the key is bumped to v2 to + # discard the poisoned caches), so the runner choice is no longer + # load-bearing. macos-latest is fine again with a clean target dir. + os: [macos-latest, ubuntu-latest] steps: - uses: actions/checkout@v4 @@ -30,17 +35,20 @@ jobs: with: components: clippy - - name: Cache cargo + - name: Cache cargo (registry only) uses: actions/cache@v4 with: + # Deliberately NOT caching `target/`: a `target/` built against a + # different Xcode carries a stale clang compiler-rt search path that + # breaks the linker ("clang_rt.osx not found"). Cache only the + # download-heavy registry/git dirs; recompiling is cheap and correct. path: | ~/.cargo/bin/ ~/.cargo/registry/index/ ~/.cargo/registry/cache/ ~/.cargo/git/db/ - target/ - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - restore-keys: ${{ runner.os }}-cargo- + key: ${{ runner.os }}-cargo-v2-${{ hashFiles('**/Cargo.lock') }} + restore-keys: ${{ runner.os }}-cargo-v2- - name: Check run: cargo check --workspace diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3741d29..d789b12 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -39,11 +39,11 @@ jobs: # consumers must `brew install onnxruntime` before running — see # INSTALL-INTEL-MAC.md bundled in the tarball. - target: x86_64-apple-darwin - os: macos-14 + os: macos-latest archive: tar.gz cargo_flags: "--no-default-features --features ort-dynamic,vector-search" - target: aarch64-apple-darwin - os: macos-14 + os: macos-latest archive: tar.gz cargo_flags: ""