From 7a3df7642b00933869319b42657146f1f908cbcb Mon Sep 17 00:00:00 2001 From: Raul Jordan Date: Thu, 28 Apr 2022 17:07:29 +0000 Subject: [PATCH] Update Prysm to Go 1.18 (#10576) * update go * Update rules_go patch * Update gazelle * begin building * qtls * gaz Co-authored-by: prestonvanloon --- WORKSPACE | 14 +++++++------- deps.bzl | 8 +++++++- go.mod | 2 +- nogo_config.json | 6 +++++- third_party/io_bazel_rules_go_test.patch | 12 ++++++------ 5 files changed, 26 insertions(+), 16 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index b8eeba90f..a72bc1843 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -60,10 +60,10 @@ bazel_skylib_workspace() http_archive( name = "bazel_gazelle", - sha256 = "de69a09dc70417580aabf20a28619bb3ef60d038470c7cf8442fafcf627c21cb", + sha256 = "5982e5463f171da99e3bdaeff8c0f48283a7a5f396ec5282910b9e8a49c0dd7e", urls = [ - "https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.24.0/bazel-gazelle-v0.24.0.tar.gz", - "https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.24.0/bazel-gazelle-v0.24.0.tar.gz", + "https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.25.0/bazel-gazelle-v0.25.0.tar.gz", + "https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.25.0/bazel-gazelle-v0.25.0.tar.gz", ], ) @@ -88,10 +88,10 @@ http_archive( # Expose internals of go_test for custom build transitions. "//third_party:io_bazel_rules_go_test.patch", ], - sha256 = "2b1641428dff9018f9e85c0384f03ec6c10660d935b750e3fa1492a281a53b0f", + sha256 = "f2dcd210c7095febe54b804bb1cd3a58fe8435a909db2ec04e31542631cf715c", urls = [ - "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.29.0/rules_go-v0.29.0.zip", - "https://github.com/bazelbuild/rules_go/releases/download/v0.29.0/rules_go-v0.29.0.zip", + "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.31.0/rules_go-v0.31.0.zip", + "https://github.com/bazelbuild/rules_go/releases/download/v0.31.0/rules_go-v0.31.0.zip", ], ) @@ -176,7 +176,7 @@ load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_depe go_rules_dependencies() go_register_toolchains( - go_version = "1.17.9", + go_version = "1.18.1", nogo = "@//:nogo", ) diff --git a/deps.bzl b/deps.bzl index 4739b5f4e..18e3f2cd8 100644 --- a/deps.bzl +++ b/deps.bzl @@ -1244,6 +1244,13 @@ def prysm_deps(): version = "v1.1.0", ) + go_repository( + name = "com_github_gogo_protobuf", + importpath = "github.com/gogo/protobuf", + commit = "b03c65ea87cdc3521ede29f62fe3ce239267c1bc", + version = "v1.3.2", + ) + go_repository( name = "com_github_golang_freetype", importpath = "github.com/golang/freetype", @@ -2462,7 +2469,6 @@ def prysm_deps(): ) go_repository( name = "com_github_lucas_clemente_quic_go", - build_directives = ["gazelle:exclude internal/qtls/go118.go"], # Remove this after go1.18 or later is supported in WORKSPACE. importpath = "github.com/lucas-clemente/quic-go", sum = "h1:ALBQXr9UJ8A1LyzvceX4jd9QFsHvlI0RR6BkV16o00A=", version = "v0.26.0", diff --git a/go.mod b/go.mod index 5a47d4621..eca775c37 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/prysmaticlabs/prysm -go 1.17 +go 1.18 require ( contrib.go.opencensus.io/exporter/jaeger v0.2.1 diff --git a/nogo_config.json b/nogo_config.json index 1e0e0e8f2..fad268f3d 100644 --- a/nogo_config.json +++ b/nogo_config.json @@ -41,7 +41,9 @@ }, "composites": { "exclude_files": { - "external/.*": "Third party code" + "external/.*": "Third party code", + "validator/accounts/.*": "Fuzz", + "validator/accounts/wallet_recover_fuzz_test.go": "Fuzz code" } }, "cgocall": { @@ -75,6 +77,7 @@ "shared/mock/.*\\.go": "Mocks are OK", ".*/.*mock\\.go": "Mocks are OK", ".*/testmain\\.go": "Test runner generated code", + "validator/accounts/wallet_recover_fuzz_test.go": "Fuzz code", "proto/.*": "Generated protobuf related code", "tools/analyzers/properpermissions/testdata/.*": "Analyzer breaks rules" } @@ -100,6 +103,7 @@ }, "exclude_files": { ".*/.*_test\\.go": "Tests are OK to use weak crypto", + "external/.*": "Third party code", "crypto/rand/rand\\.go": "Abstracts CSPRNGs for common use", "shared/aggregation/testing/bitlistutils.go": "Test-only package" } diff --git a/third_party/io_bazel_rules_go_test.patch b/third_party/io_bazel_rules_go_test.patch index d94d6f496..632f21a97 100644 --- a/third_party/io_bazel_rules_go_test.patch +++ b/third_party/io_bazel_rules_go_test.patch @@ -1,18 +1,18 @@ diff --git a/go/private/rules/test.bzl b/go/private/rules/test.bzl -index a7936ca9..cbfc996a 100644 +index a88ebcc9..f23b0dfb 100644 --- a/go/private/rules/test.bzl +++ b/go/private/rules/test.bzl -@@ -176,7 +176,7 @@ def _go_test_impl(ctx): - ), +@@ -185,7 +185,7 @@ def _go_test_impl(ctx): + testing.TestEnvironment(env), ] -_go_test_kwargs = { +go_test_kwargs = { "implementation": _go_test_impl, "attrs": { - "data": attr.label_list(allow_files = True), -@@ -213,8 +213,8 @@ _go_test_kwargs = { - "toolchains": ["@io_bazel_rules_go//go:toolchain"], + "data": attr.label_list( +@@ -439,8 +439,8 @@ _go_test_kwargs = { + """, } -go_test = rule(**_go_test_kwargs)