From e2af70f692de8ee360fd2df246cad3a1d1af563d Mon Sep 17 00:00:00 2001 From: Preston Van Loon Date: Thu, 5 Mar 2020 20:42:27 -0800 Subject: [PATCH] Run buildifer, remove duplicated WORKSPACE entries (#5018) * Buildifier, add release config * Merge branch 'master' into bazel-stuff * Merge refs/heads/master into bazel-stuff * Merge refs/heads/master into bazel-stuff * revert gnostic * Set kafka for CI tests only * add bazel.sh script * set home --- .bazelrc | 3 +++ .buildkite-bazelrc | 4 +-- WORKSPACE | 37 +++------------------------ bazel.sh | 6 +++++ beacon-chain/core/helpers/BUILD.bazel | 2 +- proto/slashing/BUILD.bazel | 2 +- third_party/kafka/BUILD.bazel | 2 +- 7 files changed, 16 insertions(+), 40 deletions(-) create mode 100755 bazel.sh diff --git a/.bazelrc b/.bazelrc index b4075b996..e0c9bf169 100644 --- a/.bazelrc +++ b/.bazelrc @@ -30,6 +30,9 @@ build --define kafka_enabled=false test --define kafka_enabled=false run --define kafka_enabled=false +# Release flags +build:release --workspace_status_command=./scripts/workspace_status.sh +build:release --stamp # multi-arch cross-compiling toolchain configs: ----------------------------------------------- diff --git a/.buildkite-bazelrc b/.buildkite-bazelrc index 85815f3cc..2981e4f71 100644 --- a/.buildkite-bazelrc +++ b/.buildkite-bazelrc @@ -46,7 +46,5 @@ test --local_test_jobs=2 # Disabled race detection due to unstable test results under constrained environment build kite # build --features=race -# Enable kafka for CI and docker images -build --define kafka_enabled=true +# Enable kafka for CI tests only. test --define kafka_enabled=true -run --define kafka_enabled=true diff --git a/WORKSPACE b/WORKSPACE index 5730f884e..71af2130e 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -114,15 +114,8 @@ load( _go_image_repos = "repositories", ) -_go_image_repos() - # Golang images # This is using gcr.io/distroless/base -load( - "@io_bazel_rules_docker//go:image.bzl", - _go_image_repos = "repositories", -) - _go_image_repos() # CC images @@ -1215,12 +1208,6 @@ go_repository( importpath = "golang.org/x/time", ) -go_repository( - name = "in_gopkg_natefinch_npipe_v2", - commit = "c1b8fa8bdccecb0b8db834ee0b92fdbcfa606dd6", - importpath = "gopkg.in/natefinch/npipe.v2", -) - go_repository( name = "com_github_googleapis_gnostic", commit = "896953e6749863beec38e27029c804e88c3144b8", # v0.4.1 @@ -1277,12 +1264,6 @@ go_repository( importpath = "k8s.io/utils", ) -go_repository( - name = "com_github_googleapis_gnostic", - commit = "25d8b0b6698593f520d9d8dc5a88e6b16ca9ecc0", - importpath = "github.com/googleapis/gnostic", -) - go_repository( name = "com_github_patrickmn_go_cache", commit = "46f407853014144407b6c2ec7ccc76bf67958d93", @@ -1453,9 +1434,9 @@ go_repository( ) go_repository( - name = "com_github_emicklei_dot", - commit = "f4a04130244d60cef56086d2f649b4b55e9624aa", - importpath = "github.com/emicklei/dot", + name = "com_github_googleapis_gnostic", + commit = "25d8b0b6698593f520d9d8dc5a88e6b16ca9ecc0", + importpath = "github.com/googleapis/gnostic", ) go_repository( @@ -1498,18 +1479,6 @@ go_repository( version = "v0.0.1", ) -go_repository( - name = "com_github_dgraph_io_ristretto", - commit = "99d1bbbf28e64530eb246be0568fc7709a35ebdd", - importpath = "github.com/dgraph-io/ristretto", -) - -go_repository( - name = "com_github_cespare_xxhash", - commit = "d7df74196a9e781ede915320c11c378c1b2f3a1f", - importpath = "github.com/cespare/xxhash", -) - go_repository( name = "com_github_kevinms_leakybucket_go", importpath = "github.com/kevinms/leakybucket-go", diff --git a/bazel.sh b/bazel.sh new file mode 100755 index 000000000..07f30840f --- /dev/null +++ b/bazel.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +env -i \ + PATH=/usr/bin:/bin \ + HOME=$HOME \ + bazel "$@" diff --git a/beacon-chain/core/helpers/BUILD.bazel b/beacon-chain/core/helpers/BUILD.bazel index 20b8f5088..ff4df28b3 100644 --- a/beacon-chain/core/helpers/BUILD.bazel +++ b/beacon-chain/core/helpers/BUILD.bazel @@ -15,8 +15,8 @@ go_library( importpath = "github.com/prysmaticlabs/prysm/beacon-chain/core/helpers", visibility = [ "//beacon-chain:__subpackages__", - "//shared/testutil:__pkg__", "//shared/benchutil/benchmark_files:__subpackages__", + "//shared/testutil:__pkg__", "//slasher:__subpackages__", "//tools:__subpackages__", "//validator:__subpackages__", diff --git a/proto/slashing/BUILD.bazel b/proto/slashing/BUILD.bazel index 482a34cfe..b3d3f5420 100644 --- a/proto/slashing/BUILD.bazel +++ b/proto/slashing/BUILD.bazel @@ -22,9 +22,9 @@ go_proto_library( proto = ":ethereum_slashing_proto", visibility = ["//visibility:public"], deps = [ + "@com_github_gogo_protobuf//gogoproto:go_default_library", "@com_github_prysmaticlabs_ethereumapis//eth/v1alpha1:go_default_library", "@com_github_prysmaticlabs_go_bitfield//:go_default_library", - "@com_github_gogo_protobuf//gogoproto:go_default_library", ], ) diff --git a/third_party/kafka/BUILD.bazel b/third_party/kafka/BUILD.bazel index 5305e46e8..37393eb9a 100644 --- a/third_party/kafka/BUILD.bazel +++ b/third_party/kafka/BUILD.bazel @@ -16,6 +16,6 @@ cmake_external( "librdkafka++.a", "librdkafka.a", ], - visibility = ["//visibility:public"], tags = ["no-remote-exec"], + visibility = ["//visibility:public"], )