Skip to content

fix(ci): portable RUSTFLAGS in publish.yml (stop rustc SIGILL)#102

Merged
zvndev merged 1 commit into
mainfrom
fix/publish-rustflags-portable
Jun 17, 2026
Merged

fix(ci): portable RUSTFLAGS in publish.yml (stop rustc SIGILL)#102
zvndev merged 1 commit into
mainfrom
fix/publish-rustflags-portable

Conversation

@zvndev

@zvndev zvndev commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator

Problem

The v0.5.1 crates.io publish (publish.yml) failed twice on its cargo test --workspace pre-publish gate with:

error: rustc interrupted by SIGILL, printing backtrace
... rustc ... -C target-cpu=native ... (signal: 4, SIGILL: illegal instruction)

rustc itself crashes — not a test failure. The crate source is fine (it built clean in PR #101 CI on macOS + Ubuntu, in release.yml's binary builds, and in a publish.yml dry-run minutes earlier).

Root cause

.cargo/config.toml sets rustflags = ["-C", "target-cpu=native"] for local M1 development. Its own comment says CI overrides this for portability — and indeed ci.yml, release.yml, and bench.yml all set RUSTFLAGS: "-C target-cpu=x86-64-v2".

publish.yml was the only workflow missing that override. It therefore inherited target-cpu=native, and on GitHub's heterogeneous shared-runner fleet that makes rustc emit instructions the underlying (often live-migrated) silicon can't execute → SIGILL. The dry-run passed only because it happened to land on a compatible runner.

Fix

Add the same RUSTFLAGS: "-C target-cpu=x86-64-v2" override the other three workflows use, to the publish job env.

No effect on published artifacts — cargo publish packages crate source, not the verification binary — but it makes the publish gate reproducible and unblocks the 0.5.1 crates.io release.

🤖 Generated with Claude Code


View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.

publish.yml ran `cargo test --workspace` (its pre-publish gate) with no
RUSTFLAGS override, so it inherited `target-cpu=native` from the committed
.cargo/config.toml. On GitHub's heterogeneous shared-runner fleet that
makes rustc itself crash with SIGILL (illegal instruction) on runners
whose advertised CPU features exceed what the live-migrated silicon can
actually execute. Two v0.5.1 publish attempts died this way; a third
(dry-run) passed only because it landed on a compatible runner.

ci.yml, release.yml, and bench.yml all already override this with
`-C target-cpu=x86-64-v2` for portability. publish.yml was the only one
missing it. Add the same override so the publish gate is reproducible.

No effect on published crates (cargo publish packages source, not the
verification binary), but it unblocks the crates.io publish.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@zvndev zvndev merged commit b84778b into main Jun 17, 2026
9 checks passed
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