From 150640305a33cc431090f4ad23e1876f097b195f Mon Sep 17 00:00:00 2001 From: Nishant Das Date: Sun, 19 Sep 2021 01:56:05 +0800 Subject: [PATCH] Support Go Builds For Darwin Arm64 (#9600) * add changes * tidy * stranded dep * fixed commit * use real commit Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com> --- crypto/bls/blst/aliases.go | 2 +- crypto/bls/blst/bls_benchmark_test.go | 2 +- crypto/bls/blst/init.go | 2 +- crypto/bls/blst/public_key.go | 2 +- crypto/bls/blst/public_key_test.go | 2 +- crypto/bls/blst/secret_key.go | 2 +- crypto/bls/blst/secret_key_test.go | 2 +- crypto/bls/blst/signature.go | 2 +- crypto/bls/blst/signature_test.go | 2 +- deps.bzl | 4 ++-- go.mod | 2 +- go.sum | 3 ++- third_party/herumi/bls_eth_go_binary.BUILD | 1 + third_party/herumi/herumi.bzl | 18 +++++++++--------- third_party/herumi/mcl.BUILD | 1 + 15 files changed, 25 insertions(+), 22 deletions(-) diff --git a/crypto/bls/blst/aliases.go b/crypto/bls/blst/aliases.go index ce47bcfc4..48f664ab6 100644 --- a/crypto/bls/blst/aliases.go +++ b/crypto/bls/blst/aliases.go @@ -1,4 +1,4 @@ -// +build linux,amd64 linux,arm64 darwin,amd64 windows,amd64 +// +build linux,amd64 linux,arm64 darwin,amd64 darwin,arm64 windows,amd64 // +build !blst_disabled package blst diff --git a/crypto/bls/blst/bls_benchmark_test.go b/crypto/bls/blst/bls_benchmark_test.go index d710c6c15..a07f79ef9 100644 --- a/crypto/bls/blst/bls_benchmark_test.go +++ b/crypto/bls/blst/bls_benchmark_test.go @@ -1,4 +1,4 @@ -// +build linux,amd64 linux,arm64 darwin,amd64 windows,amd64 +// +build linux,amd64 linux,arm64 darwin,amd64 darwin,arm64 windows,amd64 // +build !blst_disabled package blst_test diff --git a/crypto/bls/blst/init.go b/crypto/bls/blst/init.go index 5461565b7..b283647ac 100644 --- a/crypto/bls/blst/init.go +++ b/crypto/bls/blst/init.go @@ -1,4 +1,4 @@ -// +build linux,amd64 linux,arm64 darwin,amd64 windows,amd64 +// +build linux,amd64 linux,arm64 darwin,amd64 darwin,arm64 windows,amd64 // +build !blst_disabled package blst diff --git a/crypto/bls/blst/public_key.go b/crypto/bls/blst/public_key.go index d77e9801b..936b51a4b 100644 --- a/crypto/bls/blst/public_key.go +++ b/crypto/bls/blst/public_key.go @@ -1,4 +1,4 @@ -// +build linux,amd64 linux,arm64 darwin,amd64 windows,amd64 +// +build linux,amd64 linux,arm64 darwin,amd64 darwin,arm64 windows,amd64 // +build !blst_disabled package blst diff --git a/crypto/bls/blst/public_key_test.go b/crypto/bls/blst/public_key_test.go index 7aaba2895..574381219 100644 --- a/crypto/bls/blst/public_key_test.go +++ b/crypto/bls/blst/public_key_test.go @@ -1,4 +1,4 @@ -// +build linux,amd64 linux,arm64 darwin,amd64 windows,amd64 +// +build linux,amd64 linux,arm64 darwin,amd64 darwin,arm64 windows,amd64 // +build !blst_disabled package blst_test diff --git a/crypto/bls/blst/secret_key.go b/crypto/bls/blst/secret_key.go index a9ab9973d..f8d2b3906 100644 --- a/crypto/bls/blst/secret_key.go +++ b/crypto/bls/blst/secret_key.go @@ -1,4 +1,4 @@ -// +build linux,amd64 linux,arm64 darwin,amd64 windows,amd64 +// +build linux,amd64 linux,arm64 darwin,amd64 darwin,arm64 windows,amd64 // +build !blst_disabled package blst diff --git a/crypto/bls/blst/secret_key_test.go b/crypto/bls/blst/secret_key_test.go index 312baa5ca..e9b8d0f25 100644 --- a/crypto/bls/blst/secret_key_test.go +++ b/crypto/bls/blst/secret_key_test.go @@ -1,4 +1,4 @@ -// +build linux,amd64 linux,arm64 darwin,amd64 windows,amd64 +// +build linux,amd64 linux,arm64 darwin,amd64 darwin,arm64 windows,amd64 // +build !blst_disabled package blst_test diff --git a/crypto/bls/blst/signature.go b/crypto/bls/blst/signature.go index 47bfe14af..d4a04253a 100644 --- a/crypto/bls/blst/signature.go +++ b/crypto/bls/blst/signature.go @@ -1,4 +1,4 @@ -// +build linux,amd64 linux,arm64 darwin,amd64 windows,amd64 +// +build linux,amd64 linux,arm64 darwin,amd64 darwin,arm64 windows,amd64 // +build !blst_disabled package blst diff --git a/crypto/bls/blst/signature_test.go b/crypto/bls/blst/signature_test.go index 968a3b993..ed521cd9a 100644 --- a/crypto/bls/blst/signature_test.go +++ b/crypto/bls/blst/signature_test.go @@ -1,4 +1,4 @@ -// +build linux,amd64 linux,arm64 darwin,amd64 windows,amd64 +// +build linux,amd64 linux,arm64 darwin,amd64 darwin,arm64 windows,amd64 // +build !blst_disabled package blst diff --git a/deps.bzl b/deps.bzl index 67028f1d1..96f68f77a 100644 --- a/deps.bzl +++ b/deps.bzl @@ -1433,8 +1433,8 @@ def prysm_deps(): go_repository( name = "com_github_herumi_bls_eth_go_binary", importpath = "github.com/herumi/bls-eth-go-binary", - sum = "h1:LEw2KkKciJEr3eKDLzdZ/rjzSR6Y+BS6xKxdA78Bq6s=", - version = "v0.0.0-20210130185500-57372fb27371", + sum = "h1:wCMygKUQhmcQAjlk2Gquzq6dLmyMv2kF+llRspoRgrk=", + version = "v0.0.0-20210917013441-d37c07cfda4e", ) go_repository( diff --git a/go.mod b/go.mod index e68c32ada..998555a67 100644 --- a/go.mod +++ b/go.mod @@ -41,7 +41,7 @@ require ( github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 github.com/grpc-ecosystem/grpc-gateway/v2 v2.0.1 github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d - github.com/herumi/bls-eth-go-binary v0.0.0-20210130185500-57372fb27371 + github.com/herumi/bls-eth-go-binary v0.0.0-20210917013441-d37c07cfda4e github.com/huin/goupnp v1.0.2 // indirect github.com/ianlancetaylor/cgosymbolizer v0.0.0-20200424224625-be1b05b0b279 github.com/ipfs/go-ipfs-addr v0.0.1 diff --git a/go.sum b/go.sum index c404ecffb..5944152d4 100644 --- a/go.sum +++ b/go.sum @@ -496,8 +496,9 @@ github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= -github.com/herumi/bls-eth-go-binary v0.0.0-20210130185500-57372fb27371 h1:LEw2KkKciJEr3eKDLzdZ/rjzSR6Y+BS6xKxdA78Bq6s= github.com/herumi/bls-eth-go-binary v0.0.0-20210130185500-57372fb27371/go.mod h1:luAnRm3OsMQeokhGzpYmc0ZKwawY7o87PUEP11Z7r7U= +github.com/herumi/bls-eth-go-binary v0.0.0-20210917013441-d37c07cfda4e h1:wCMygKUQhmcQAjlk2Gquzq6dLmyMv2kF+llRspoRgrk= +github.com/herumi/bls-eth-go-binary v0.0.0-20210917013441-d37c07cfda4e/go.mod h1:luAnRm3OsMQeokhGzpYmc0ZKwawY7o87PUEP11Z7r7U= github.com/holiman/bloomfilter/v2 v2.0.3 h1:73e0e/V0tCydx14a0SCYS/EWCxgwLZ18CZcZKVu0fao= github.com/holiman/bloomfilter/v2 v2.0.3/go.mod h1:zpoh+gs7qcpqrHr3dB55AMiJwo0iURXE7ZOP9L9hSkA= github.com/holiman/uint256 v1.2.0 h1:gpSYcPLWGv4sG43I2mVLiDZCNDh/EpGjSk8tmtxitHM= diff --git a/third_party/herumi/bls_eth_go_binary.BUILD b/third_party/herumi/bls_eth_go_binary.BUILD index 14647ec6c..0936af163 100644 --- a/third_party/herumi/bls_eth_go_binary.BUILD +++ b/third_party/herumi/bls_eth_go_binary.BUILD @@ -137,6 +137,7 @@ go_library( importpath = "github.com/herumi/bls-eth-go-binary/bls", srcs = [ "bls/bls.go", + "bls/eth.go", "bls/callback.go", "bls/cast.go", "bls/mcl.go", diff --git a/third_party/herumi/herumi.bzl b/third_party/herumi/herumi.bzl index 10805063f..c4bbd42e5 100644 --- a/third_party/herumi/herumi.bzl +++ b/third_party/herumi/herumi.bzl @@ -11,31 +11,31 @@ def bls_dependencies(): _maybe( http_archive, name = "herumi_bls_eth_go_binary", - strip_prefix = "bls-eth-go-binary-e81c3e745d31cfee089456774aa707bc98c76523", + strip_prefix = "bls-eth-go-binary-d37c07cfda4e5369f269368f92c42209400e0742", urls = [ - "https://github.com/herumi/bls-eth-go-binary/archive/e81c3e745d31cfee089456774aa707bc98c76523.tar.gz", + "https://github.com/herumi/bls-eth-go-binary/archive/d37c07cfda4e5369f269368f92c42209400e0742.tar.gz", ], - sha256 = "9d794d0856bfab78953798b5f446148ed5413c5e5695857c34e2282a80439f2c", + sha256 = "9d811ed2a4a9fd06d9549c392aefc6ac1ffb6685d15f940b4d14976cfcfd26fa", build_file = "@prysm//third_party/herumi:bls_eth_go_binary.BUILD", ) _maybe( http_archive, name = "herumi_mcl", - strip_prefix = "mcl-c08437c973004cf64895da197eb7076d44354aff", + strip_prefix = "mcl-0c31ab9648e81f54177325e55ea96dd8e9c8ba6b", urls = [ - "https://github.com/herumi/mcl/archive/c08437c973004cf64895da197eb7076d44354aff.tar.gz", + "https://github.com/herumi/mcl/archive/0c31ab9648e81f54177325e55ea96dd8e9c8ba6b.tar.gz", ], - sha256 = "4118dfdcf86d98cdc78349cf9e51a0b58f4ecfea4b974a3d2df9ea11dd2cb6ad", + sha256 = "0be6f61660ad85ab1fdead420f75d59e3ecbf84da7fa1752daf5157c810727c8", build_file = "@prysm//third_party/herumi:mcl.BUILD", ) _maybe( http_archive, name = "herumi_bls", - strip_prefix = "bls-4ae022a6bb71dc518d81f22141d71d2a1f767ab3", + strip_prefix = "bls-02060e20d81c2714e481922b182b43e8e26d1fee", urls = [ - "https://github.com/herumi/bls/archive/4ae022a6bb71dc518d81f22141d71d2a1f767ab3.tar.gz", + "https://github.com/herumi/bls/archive/02060e20d81c2714e481922b182b43e8e26d1fee.tar.gz", ], - sha256 = "9f07c0ce33502e3bd2a3018814ed509093a0865ce16fa16cefff7ba11fb4537e", + sha256 = "60b405c934514816f5559538dccf95fbdfdcd86ed08bf1fb95daae45f1cabbfd", build_file = "@prysm//third_party/herumi:bls.BUILD", ) diff --git a/third_party/herumi/mcl.BUILD b/third_party/herumi/mcl.BUILD index 6e1549055..62524b780 100644 --- a/third_party/herumi/mcl.BUILD +++ b/third_party/herumi/mcl.BUILD @@ -36,6 +36,7 @@ cc_library( "include/mcl/vint.hpp", "include/mcl/randgen.hpp", "include/mcl/array.hpp", + "include/mcl/config.hpp", "include/mcl/util.hpp", "include/mcl/fp_tower.hpp", "include/mcl/fp.hpp",