Skip to content

fix: use llvm-objdump-20 for Mach-O re-signing in version injection#21953

Merged
ludamad merged 1 commit into
merge-train/barretenbergfrom
fix/macos-codesign-llvm-objdump
Mar 24, 2026
Merged

fix: use llvm-objdump-20 for Mach-O re-signing in version injection#21953
ludamad merged 1 commit into
merge-train/barretenbergfrom
fix/macos-codesign-llvm-objdump

Conversation

@ludamad

@ludamad ludamad commented Mar 24, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • macOS release binaries were broken (SIGKILL/exit 137) because inject_version in bootstrap.sh used llvm-objdump (unversioned) to detect Mach-O binaries for re-signing, but the CI environment only has llvm-objdump-20
  • The detection silently failed (&>/dev/null), skipping ldid -S re-signing after version injection, leaving binaries with an invalidated linker-signed code signature
  • Fix: llvm-objdumpllvm-objdump-20

@ludamad ludamad added the ci-barretenberg Run all barretenberg/cpp checks. label Mar 24, 2026
@ludamad ludamad force-pushed the fix/macos-codesign-llvm-objdump branch from f342953 to e0238d1 Compare March 24, 2026 14:39
The inject_version function modifies binaries to embed a version string,
invalidating any existing code signature. On Linux CI, re-signing of
cross-compiled macOS binaries was skipped because the Mach-O detection
used llvm-objdump (unversioned) which doesn't exist — only llvm-objdump-20
does. This left macOS binaries with an invalidated linker-signed signature,
causing macOS to kill them on launch (SIGKILL/exit 137).

Fix: detect Mach-O via magic bytes (CFFAEDFE/CEFAEDFE) instead of
llvm-objdump, which also incorrectly returns 0 for ELF binaries.
@ludamad ludamad force-pushed the fix/macos-codesign-llvm-objdump branch from e0238d1 to d4e74bb Compare March 24, 2026 14:41
@ludamad ludamad merged commit 0587d3c into merge-train/barretenberg Mar 24, 2026
11 checks passed
@ludamad ludamad deleted the fix/macos-codesign-llvm-objdump branch March 24, 2026 15:14
github-merge-queue Bot pushed a commit that referenced this pull request Mar 24, 2026
BEGIN_COMMIT_OVERRIDE
fix: use llvm-objdump-20 for Mach-O re-signing in version injection
(#21953)
chore: Fix nightly debug vk check (#21957)
feat: SRS point compression - download 50% less CRS data (#21112)
END_COMMIT_OVERRIDE
github-merge-queue Bot pushed a commit that referenced this pull request Mar 30, 2026
…from amd64 (#22120)

## Summary

The nightly Docker image build has been failing since March 25 because
the ARM64 release instance tries to run `ldid` (an x86_64 Linux binary)
to re-sign cross-compiled Mach-O binaries after version injection.

This was exposed by PR #21953 which fixed `llvm-objdump` →
`llvm-objdump-20`, making Mach-O detection actually work — before that,
the detection silently failed so `ldid` was never called.

## Fix

Gate the `ldid` call behind `$(arch) == amd64` in `inject_version`. The
ARM64 instance doesn't need to sign Mach-O binaries because all macOS
release artifacts are published exclusively from the amd64 instance:

- **GitHub releases** (tarballs): packaged by `build_release_dir`, runs
on amd64 only
- **bb.js npm packages**: `copy_cross.sh` already guards ldid with `[[
"$(arch)" == "amd64" ]]`
- **Docker images**: Linux binaries only, no Mach-O signing needed

The ARM64 instance builds cross targets (macOS, Windows, iOS, Android)
to populate the shared build cache, but never publishes them.

## Impact

Unblocks the nightly release pipeline → unblocks Deploy Next Net
(failing 6 days).

## Changed file

`barretenberg/cpp/bootstrap.sh` — one-line change in `inject_version`"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-barretenberg Run all barretenberg/cpp checks.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants