Skip to content

fix(ci): set linker=platform-default for native cross-builds#260

Merged
zackees merged 1 commit into
mainfrom
fix/native-build-linker
May 23, 2026
Merged

fix(ci): set linker=platform-default for native cross-builds#260
zackees merged 1 commit into
mainfrom
fix/native-build-linker

Conversation

@zackees
Copy link
Copy Markdown
Member

@zackees zackees commented May 23, 2026

Why

The v2.2.4 release-auto run failed at the aarch64-unknown-linux-musl native build:

/usr/bin/ld: <sysroot>/.../aarch64-unknown-linux-musl/lib/self-contained/crt1.o:
    error adding symbols: file in wrong format
clang: error: linker command failed with exit code 1

clang fell back to host /usr/bin/ld (x86_64) instead of zig's cross-linker, so the aarch64 cross-objects couldn't be linked.

Root cause

setup-soldr's linker: input defaults to "", which auto-injects fast (mold-or-rust-lld on Linux) via SOLDR_LINKER. That clobbers the per-target linker that cargo zigbuild relies on for cross-compilation.

setup-soldr documents linker: platform-default as the explicit opt-out that keeps whatever cargo config / rust-toolchain.toml specifies.

Fix

Set linker: platform-default only on template_native_build.yml (release native binaries). All host-native build workflows (check-*, fmt, msrv, docs, board builds, bench-205, acceptance-205) continue to use the fast default — it's a clear win there.

Test plan

  • CI on this PR passes (this template only fires from release-auto.yml / build.yml workflow_call — won't run inline on PR)
  • After merge, manually trigger release-auto.yml via workflow_dispatch — no tag yet for v2.2.4, so prepare will fire the full build + publish + pypi pipeline
  • All 4 native builds succeed, including aarch64 musl

🤖 Generated with Claude Code

setup-soldr's `linker:` input defaults to `""` which auto-injects `fast`
(mold-or-rust-lld on Linux) via SOLDR_LINKER. That clobbers the
per-target linker that `cargo zigbuild` needs for the
aarch64-unknown-linux-musl cross-compile:

    /usr/bin/ld: <sysroot>/lib/rustlib/aarch64-unknown-linux-musl/lib/self-contained/crt1.o:
        error adding symbols: file in wrong format
    clang: error: linker command failed with exit code 1

(clang fell back to host /usr/bin/ld instead of zig's cross-linker.)
The v2.2.4 release-auto run failed at the aarch64 musl native build for
this reason — see run 26341521326.

setup-soldr documents `linker: platform-default` as the explicit opt-out
that keeps whatever cargo config / rust-toolchain.toml specifies. Add it
to the native build template.

The fix applies only to template_native_build.yml (release native
binaries). All other workflows (check-*, fmt, msrv, docs, board builds,
bench-205, acceptance-205) continue to use the `fast` default — they're
host-native builds where it's a clear win.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 23, 2026

Warning

Review limit reached

@zackees, we couldn't start this review because you've used your available PR reviews for now.

Your plan currently allows 1 review/hour. Refill in 13 minutes and 12 seconds.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more review capacity refills, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than trial, open-source, and free plans. In all cases, review capacity refills continuously over time.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: b9b78e23-8284-41d6-b7da-e63240a3073c

📥 Commits

Reviewing files that changed from the base of the PR and between 282e583 and aecbc7f.

📒 Files selected for processing (1)
  • .github/workflows/template_native_build.yml
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/native-build-linker

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@zackees zackees merged commit 2c526d7 into main May 23, 2026
82 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