Skip to content

plain cargo build/run fails on macOS/arm64: build.warnings denies linker eh_frame warning #5895

Description

@bug-ops

Description

PR #5891 (commit 2616f7b, closes #5873) migrated the CI lint-warning gate from RUSTFLAGS="-D warnings" to Cargo's native build.warnings = "deny", committed repo-wide via .cargo/config.toml. Because .cargo/config.toml applies to every cargo invocation (CI and local alike) unless explicitly overridden per-invocation, this now also denies linker-level warnings surfaced via #[warn(linker_messages)], not just rustc/clippy/rustdoc lints.

On macOS/arm64 (Darwin 25.5.0, macOS 26.5.1), a completely plain cargo build --features full (and by extension cargo run --features full, the documented live-testing entry point in .claude/rules/continuous-improvement.md) now unconditionally fails, because Apple's ld linker emits an __eh_frame section too large warning. This is a linker artifact of the zeph binary's size on macOS's compact-unwind-table format — not a code defect, not fixable by editing source, and not caused by any individual commit's changes. It reproduced deterministically across two consecutive builds.

Sibling issue #5894 (filed CI-1280, same root cause) documents a narrower symptom: the rustdoc pre-commit gate command failing on 37 pre-existing rustdoc warnings. This finding is distinct and more severe: it blocks the single most basic operation in the project — cargo build/cargo run with no special flags — on a real developer/CI-tester platform, with no documented workaround. CI itself is unaffected (Linux runners don't hit this linker warning), and only the coverage/rustdoc CI jobs carry a CARGO_BUILD_WARNINGS=allow override — the build/test/clippy jobs do not, so this class of platform-specific linker warning is currently invisible to CI entirely (no macOS runner in the matrix).

The workaround CARGO_BUILD_WARNINGS=allow cargo build ... (mirroring CI's own override pattern) unblocks the build but is undocumented for local/live-testing use.

Reproduction Steps

  1. On main (HEAD 2616f7b or later, .cargo/config.toml present) on macOS/arm64, run:
    cargo build --features full
    
  2. Observe the build fail (reproduced twice consecutively):
    warning: linker stderr: ld: __eh_frame section too large (max 16MB) to encode dwarf unwind offsets in compact unwind table, performance of exception handling might be affected
      |
      = note: `#[warn(linker_messages)]` on by default
    
    error: `zeph` (bin "zeph") generated 1 warning
    error: warnings are denied by `build.warnings` configuration
    
  3. Confirm the workaround unblocks it: CARGO_BUILD_WARNINGS=allow cargo build --features full succeeds.

Expected Behavior

A plain cargo build/cargo run should succeed without an undocumented environment variable override, on any platform CI or contributors actually use — either by scoping build.warnings = "deny" to CI invocations only (mirroring how coverage/rustdoc jobs already opt OUT), by using category-level granularity if Cargo 1.97 supports it (linker warnings allowed, rustc/clippy/rustdoc still denied), or by eliminating the eh_frame overflow itself (e.g. split-debuginfo / unwind-table strategy tuning).

Actual Behavior

cargo build --features full and cargo run --features full fail unconditionally on macOS/arm64 with error: warnings are denied by build.warnings configuration, blocking all local development and live testing on this platform until a developer independently discovers CARGO_BUILD_WARNINGS=allow.

Environment

Related

Spec

.local/specs/051-cargo-build-warnings-linker-eh-frame/spec.md

Metadata

Metadata

Assignees

Labels

P1High ROI, low complexity — do next sprintbugSomething isn't workingciCI/CD configurationtech-debtTechnical debt

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions