From 2af65aca75b80d4fe79073d4ec03ea06d72e075f Mon Sep 17 00:00:00 2001 From: Victor Farazdagi Date: Tue, 27 Jan 2026 19:40:29 +0300 Subject: [PATCH] fix: bazel build failure on macOS (hashtree patch) (#16281) **What type of PR is this?** Bug fix **What does this PR do? Why is it needed?** It appears that #16216 introduced hashtree integration but broke builds on macOS Intel (darwin_amd64). ``` Error: Undefined symbols for architecture x86_64: "_github.com/OffchainLabs/hashtree.HashtreeHash" ``` The Bazel patch for hashtree was missing `wrapper_darwin_amd64.s`. So, `//go:noescape` in `bindings.go` assumes that symbols are available elsewhere, and while on other platforms optimized version is used, on Darwin we have stub (symbol still must be available), which needs to be referenced -- hence, this PR. **Other notes for review** I've re-checked using `bazel clean && bazel build //cmd/beacon-chain` -- it was failing before, works now. cc @potuz as original patch author **Acknowledgements** - [x] I have read [CONTRIBUTING.md](https://github.com/prysmaticlabs/prysm/blob/develop/CONTRIBUTING.md). - [x] I have included a uniquely named [changelog fragment file](https://github.com/prysmaticlabs/prysm/blob/develop/CONTRIBUTING.md#maintaining-changelogmd). - [x] I have added a description with sufficient context for reviewers to understand this PR. - [x] I have tested that my changes work as expected and I added a testing plan to the PR description (if applicable). Co-authored-by: Potuz --- changelog/farazdagi_fix-hashtree-darwin-amd64.md | 3 +++ third_party/com_github_offchainlabs_hashtree.patch | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 changelog/farazdagi_fix-hashtree-darwin-amd64.md diff --git a/changelog/farazdagi_fix-hashtree-darwin-amd64.md b/changelog/farazdagi_fix-hashtree-darwin-amd64.md new file mode 100644 index 0000000000..43cef9f993 --- /dev/null +++ b/changelog/farazdagi_fix-hashtree-darwin-amd64.md @@ -0,0 +1,3 @@ +### Fixed + +- Fix Bazel build failure on macOS x86_64 (darwin_amd64) (adds missing assembly stub to hashtree patch). diff --git a/third_party/com_github_offchainlabs_hashtree.patch b/third_party/com_github_offchainlabs_hashtree.patch index c313a1c821..78c024d1a0 100644 --- a/third_party/com_github_offchainlabs_hashtree.patch +++ b/third_party/com_github_offchainlabs_hashtree.patch @@ -1,7 +1,7 @@ diff -urN a/BUILD.bazel b/BUILD.bazel --- a/BUILD.bazel 1969-12-31 18:00:00.000000000 -0600 +++ b/BUILD.bazel 2025-01-05 12:00:00.000000000 -0600 -@@ -0,0 +1,89 @@ +@@ -0,0 +1,90 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( @@ -32,6 +32,7 @@ diff -urN a/BUILD.bazel b/BUILD.bazel + ], + "@io_bazel_rules_go//go/platform:darwin_amd64": [ + "bindings_darwin_amd64.go", ++ "wrapper_darwin_amd64.s", + ], + "//conditions:default": [], + }),