Skip to content

Commit c7172cb

Browse files
authored
fix: skip ldid signing on ARM64 — macOS artifacts are only published 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`"
2 parents 694f604 + 7845da5 commit c7172cb

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

barretenberg/cpp/bootstrap.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,11 @@ function inject_version {
3737
printf "$version\0" | dd of="$binary" bs=1 seek=$version_offset conv=notrunc 2>/dev/null
3838

3939
# Re-sign after modifying the binary.
40+
# On macOS, use codesign. On Linux amd64, use ldid for Mach-O cross-compiled binaries.
41+
# ARM64 Linux instances don't need ldid — all macOS release artifacts are published from amd64.
4042
if [[ "$(os)" == "macos" ]]; then
4143
codesign -s - -f "$binary" 2>/dev/null || true
42-
elif llvm-objdump-20 --macho --private-header "$binary" 2>/dev/null | grep -q "Mach header"; then
44+
elif [[ "$(arch)" == "amd64" ]] && llvm-objdump-20 --macho --private-header "$binary" 2>/dev/null | grep -q "Mach header"; then
4345
ldid -S "$binary"
4446
fi
4547
}

0 commit comments

Comments
 (0)