Refactor dependencies, make Prysm "go gettable" (#6053)

* Fix a few deps to work with go.mod, check in generated files

* Update Gossipsub to 1.1 (#5998)

* update libs

* add new validators

* add new deps

* new set of deps

* tls

* further fix gossip update

* get everything to build

* clean up

* gaz

* fix build

* fix all tests

* add deps to images

* imports

Co-authored-by: rauljordan <raul@prysmaticlabs.com>

* Beacon chain builds with go build

* fix bazel

* fix dep

* lint

* Add github action for testing go

* on PR for any branch

* fix libp2p test failure

* Fix TestProcessBlock_PassesProcessingConditions by updating the proposer index in test

* Revert "Fix TestProcessBlock_PassesProcessingConditions by updating the proposer index in test"

This reverts commit 43676894ab.

* Compute and set proposer index instead of hard code

* Add back go mod/sum, fix deps

* go build ./...

* Temporarily skip two tests

* Fix kafka confluent patch

* Fix kafka confluent patch

* fix kafka build

* fix kafka

* Add info in DEPENDENCIES. Added a stub link for Why Bazel? until https://github.com/prysmaticlabs/documentation/issues/138

* Update fuzz ssz files as well

* Update fuzz ssz files as well

* getting closer

* rollback rules_go and gazelle

* fix gogo protobuf

* install librdkafka-dev as part of github actions

* Update kafka to a recent version where librkafkfa is not required for go modules

* clarify comment

* fix kafka build

* disable go tests

* comment

* Fix geth dependencies for end to end

* rename word

* lint

* fix docker

Co-authored-by: Nishant Das <nishdas93@gmail.com>
Co-authored-by: rauljordan <raul@prysmaticlabs.com>
Co-authored-by: terence tsao <terence@prysmaticlabs.com>
This commit is contained in:
Preston Van Loon
2020-05-30 23:44:34 -07:00
committed by GitHub
parent d35531cb17
commit 49a0d3caf0
143 changed files with 24188 additions and 1762 deletions

View File

@@ -1,10 +1,60 @@
diff --git a/kafka/BUILD.bazel b/kafka/BUILD.bazel
index bc46110..367c9f6 100644
--- a/kafka/BUILD.bazel
+++ b/kafka/BUILD.bazel
@@ -23,6 +23,7 @@
"producer.go",
@@ -29,19 +29,20 @@ go_library(
"testhelpers.go",
"time.go",
],
+ cdeps = ["@prysm//third_party/kafka:librdkafka"],
+ cdeps = ["//kafka/librdkafka:precompiled"],
cgo = True,
importpath = "gopkg.in/confluentinc/confluent-kafka-go.v1/kafka",
clinkopts = select({
"@io_bazel_rules_go//go/platform:android": [
- "kafka/librdkafka/librdkafka_glibc_linux.a -lm -ldl -lpthread -lrt",
+ "-lm -ldl -lpthread -lrt",
],
"@io_bazel_rules_go//go/platform:darwin": [
- "kafka/librdkafka/librdkafka_darwin.a -lm -lsasl2 -lz -ldl -lpthread",
+ "-lm -lsasl2 -lz -ldl -lpthread",
],
"@io_bazel_rules_go//go/platform:ios": [
- "kafka/librdkafka/librdkafka_darwin.a -lm -lsasl2 -lz -ldl -lpthread",
+ "-lm -lsasl2 -lz -ldl -lpthread",
],
"@io_bazel_rules_go//go/platform:linux": [
- "kafka/librdkafka/librdkafka_glibc_linux.a -lm -ldl -lpthread -lrt",
+ "-lm -ldl -lpthread -lrt",
],
"//conditions:default": [],
}),
diff --git a/kafka/librdkafka/BUILD.bazel b/kafka/librdkafka/BUILD.bazel
index 2ced242..9c06d83 100644
--- a/kafka/librdkafka/BUILD.bazel
+++ b/kafka/librdkafka/BUILD.bazel
@@ -8,4 +8,26 @@ go_library(
],
importpath = "gopkg.in/confluentinc/confluent-kafka-go.v1/kafka/librdkafka",
visibility = ["//visibility:public"],
+ cgo = True,
+ cdeps = [":precompiled"],
+)
+
+cc_library(
+ name = "precompiled",
+ srcs = select({
+ "@io_bazel_rules_go//go/platform:android": [
+ "librdkafka_glibc_linux.a",
+ ],
+ "@io_bazel_rules_go//go/platform:darwin": [
+ "librdkafka_darwin.a",
+ ],
+ "@io_bazel_rules_go//go/platform:ios": [
+ "librdkafka_darwin.a",
+ ],
+ "@io_bazel_rules_go//go/platform:linux": [
+ "librdkafka_glibc_linux.a",
+ ],
+ }),
+ visibility = ["//visibility:public"],
+ hdrs = ["rdkafka.h"],
)

View File

@@ -1,21 +1,24 @@
load("@rules_foreign_cc//tools/build_defs:cmake.bzl", "cmake_external")
cmake_external(
name = "librdkafka",
cache_entries = {
"RDKAFKA_BUILD_STATIC": "ON",
"WITH_ZSTD": "OFF",
"WITH_SSL": "OFF",
"WITH_SASL": "OFF",
"ENABLE_LZ4_EXT": "OFF",
"WITH_LIBDL": "OFF",
"WITH_ZLIB": "OFF",
},
lib_source = "@librdkafka//:all",
static_libraries = [
"librdkafka++.a",
"librdkafka.a",
],
tags = ["no-remote-exec"],
visibility = ["//visibility:public"],
)
#cmake_external(
# name = "librdkafka",
# cache_entries = {
# "RDKAFKA_BUILD_STATIC": "ON",
# "WITH_ZSTD": "OFF",
# "WITH_SSL": "OFF",
# "WITH_SASL": "OFF",
# "ENABLE_LZ4_EXT": "OFF",
# "WITH_LIBDL": "OFF",
# "WITH_ZLIB": "OFF",
# },
# lib_source = "@librdkafka//:all",
# static_libraries = [
# "librdkafka++.a",
# "librdkafka.a",
# ],
# tags = [
# "manual",
# "no-remote-exec",
# ],
# visibility = ["//visibility:public"],
#)

16
third_party/libp2p_tls.patch vendored Normal file
View File

@@ -0,0 +1,16 @@
diff --git a/crypto.go b/crypto.go
index e6d6d5f..f9eb389 100644
--- a/crypto.go
+++ b/crypto.go
@@ -217,10 +217,7 @@ func preferServerCipherSuites() bool {
var (
hasGCMAsmAMD64 = cpu.X86.HasAES && cpu.X86.HasPCLMULQDQ
hasGCMAsmARM64 = cpu.ARM64.HasAES && cpu.ARM64.HasPMULL
- // Keep in sync with crypto/aes/cipher_s390x.go.
- hasGCMAsmS390X = cpu.S390X.HasAES && cpu.S390X.HasAESCBC && cpu.S390X.HasAESCTR && (cpu.S390X.HasGHASH || cpu.S390X.HasAESGCM)
-
- hasGCMAsm = hasGCMAsmAMD64 || hasGCMAsmARM64 || hasGCMAsmS390X
+ hasGCMAsm = hasGCMAsmAMD64 || hasGCMAsmARM64
)
return !hasGCMAsm
}