Skip to content

fix(ci): retry the Rosetta cross build through toolchain segfaults - #2788

Merged
chaliy merged 1 commit into
mainfrom
eve/clever-mccarthy-n5iz6i
Oct 26, 2026
Merged

chaliy merged 1 commit into
mainfrom
eve/clever-mccarthy-n5iz6i

Conversation

@chaliy

@chaliy chaliy commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

What changed

The x86_64-apple-darwin cross build in js.yml's callback-platforms job
retries up to three times. Only the build is retried; the tests are not.

Why

The lane I added in #2780 is flaky, and since js-check gates on
callback-platforms, a toolchain crash blocks unrelated PRs. It already did:
#2787, a GitHub Actions version bump that touches none of this, is red on
it right now.

Cross-linking to x86_64 on the arm64 runner intermittently dies with:

error: linking with `cc` failed: exit status: 1
clang: error: unable to execute command: Segmentation fault: 11
clang: error: linker command failed due to signal (use -v to see invocation)
error: could not compile `getrandom` (build script) due to 1 previous error

It is the toolchain crashing, not our configuration:

Roughly two runs in five.

Before / After

commit cross build lane
75a810b (#2780) segfault linking libc fail
ea3bd4e (#2780) ok pass
6bf1fc2 (#2780) ok fail (intended — 2s experiment)
b4d9e70 (#2780) ok pass
1dc7911 (main) ok pass
9fcc382c (#2787) segfault linking getrandom fail

After: the first two attempts may crash and the job still succeeds. cargo
keeps whatever already compiled, so a retry resumes rather than rebuilds, and
each retry logs a ::warning:: so the flake stays visible rather than being
silently swallowed.

Risk

  • Low, and it narrows rather than widens what passes. A genuine compile
    error fails all three attempts and still fails the job. The test step is
    outside the loop, so the regression the lane exists to catch — verified in
    fix(js): unblock npm release by sizing the host-callback timeout for Rosetta #2780 by reverting the budget to 2s — still fails it.
  • A retry costs build time only on a run that would otherwise have failed
    outright.
  • If the segfault rate climbs far enough that three attempts stop being
    enough, the lane's cost should be reweighed against its value rather than
    the retry count raised again.

Checklist

  • Tests added or updated — n/a, CI configuration; the lane's own test
    coverage is unchanged
  • Backward compatibility considered

Generated by Claude Code

The x86_64-apple-darwin lane added in #2780 is flaky, and because `js-check`
gates on `callback-platforms` it blocks unrelated PRs: it failed that way on
#2787, a GitHub Actions bump that touches none of this.

Cross-linking to x86_64 on the arm64 runner intermittently dies with

  error: linking with `cc` failed: exit status: 1
  clang: error: unable to execute command: Segmentation fault: 11
  clang: error: linker command failed due to signal

while linking a *build script*. Build scripts are host binaries, so no
cross-compilation flag of ours is involved, and `crates/bashkit-js/.cargo/
config.toml` only sets rustflags for x86_64-pc-windows-msvc. It hit `libc` on
one run and `getrandom` on another, roughly two runs in five, and recurred
after the Rust cache was scoped per target in #2780 and again under a
different `Swatinem/rust-cache` revision on #2787 -- so it is the toolchain
crashing, not our cache or our configuration.

Retry the cross build up to three times. cargo keeps whatever already
compiled, so a retry resumes rather than rebuilds. This only absorbs the
crash: a genuine compile error fails all three attempts and still fails the
job, and the tests themselves are not retried, so the regression the lane was
added to catch still fails it.
chaliy pushed a commit that referenced this pull request Oct 26, 2026
…dates (#2787)

Swatinem/rust-cache and taiki-e/install-action to new v2 revisions,
actions/setup-python v7.0.0 -> v7.1.0, astral-sh/setup-uv v10.3.0 -> v10.3.2,
across 14 workflows. All SHA-pinned, as the repo requires.

Touches no rust-toolchain pin, and check-workflow-parity passes.

All 49 checks green. The Rosetta lane first failed here on the transient
cross-build segfault tracked in #2788, and passed on re-run; that failure was
unrelated to these bumps, which is the point #2788 makes.
@chaliy
chaliy merged commit 9fe5bcc into main Oct 26, 2026
38 checks passed
@chaliy
chaliy deleted the eve/clever-mccarthy-n5iz6i branch October 26, 2026 11:57
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.

1 participant