Skip to content

Commit

Permalink
Update bazel and various rules and dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
johanbrandhorst committed Jul 1, 2021
1 parent f87ba71 commit 2b36b73
Show file tree
Hide file tree
Showing 11 changed files with 60 additions and 45 deletions.
2 changes: 1 addition & 1 deletion .bazelrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
build --workspace_status_command="echo STABLE_GIT_SHA $(git rev-parse HEAD)"
test --features race
test --@io_bazel_rules_go//go/config:race
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.5.0
4.1.0
8 changes: 4 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ commands:
jobs:
build:
docker:
- image: l.gcr.io/google/bazel:3.5.0
- image: l.gcr.io/google/bazel:4.1.0
steps:
- checkout
- configure_bazel
Expand Down Expand Up @@ -76,7 +76,7 @@ jobs:
- save_bazel_test_cache
gazelle:
docker:
- image: l.gcr.io/google/bazel:3.5.0
- image: l.gcr.io/google/bazel:4.1.0
steps:
- checkout
- configure_bazel
Expand All @@ -86,7 +86,7 @@ jobs:
- run: git diff --exit-code
buildifier:
docker:
- image: l.gcr.io/google/bazel:3.5.0
- image: l.gcr.io/google/bazel:4.1.0
steps:
- checkout
- configure_bazel
Expand Down Expand Up @@ -186,7 +186,7 @@ jobs:
command: buf check breaking --against-input '.git#branch=master'
update-repositoriesbzl:
docker:
- image: l.gcr.io/google/bazel:3.5.0
- image: l.gcr.io/google/bazel:4.1.0
steps:
- checkout
- configure_bazel
Expand Down
31 changes: 15 additions & 16 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,29 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
name = "io_bazel_rules_go",
sha256 = "d1ffd055969c8f8d431e2d439813e42326961d0942bdf734d2c95dc30c369566",
sha256 = "69de5c704a05ff37862f7e0f5534d4f479418afc21806c887db544a316f3cb6b",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.24.5/rules_go-v0.24.5.tar.gz",
"https://github.com/bazelbuild/rules_go/releases/download/v0.24.5/rules_go-v0.24.5.tar.gz",
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.27.0/rules_go-v0.27.0.tar.gz",
"https://github.com/bazelbuild/rules_go/releases/download/v0.27.0/rules_go-v0.27.0.tar.gz",
],
)

load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")

go_rules_dependencies()

go_register_toolchains()

http_archive(
name = "bazel_gazelle",
sha256 = "b85f48fa105c4403326e9525ad2b2cc437babaa6e15a3fc0b1dbab0ab064bc7c",
sha256 = "62ca106be173579c0a167deb23358fdfe71ffa1e4cfdddf5582af26520f1c66f",
urls = [
"https://storage.googleapis.com/bazel-mirror/github.com/bazelbuild/bazel-gazelle/releases/download/v0.22.2/bazel-gazelle-v0.22.2.tar.gz",
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.22.2/bazel-gazelle-v0.22.2.tar.gz",
"https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.23.0/bazel-gazelle-v0.23.0.tar.gz",
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.23.0/bazel-gazelle-v0.23.0.tar.gz",
],
)

load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies")

go_rules_dependencies()

go_register_toolchains(version = "1.16")

gazelle_dependencies()

load("//:repositories.bzl", "go_repositories")
Expand Down Expand Up @@ -65,11 +64,11 @@ _go_image_repos()

http_archive(
name = "rules_proto",
sha256 = "9fc210a34f0f9e7cc31598d109b5d069ef44911a82f507d5a88716db171615a8",
strip_prefix = "rules_proto-f7a30f6f80006b591fa7c437fe5a951eb10bcbcf",
sha256 = "602e7161d9195e50246177e7c55b2f39950a9cf7366f74ed5f22fd45750cd208",
strip_prefix = "rules_proto-97d8af4dc474595af3900dd85cb3a29ad28cc313",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_proto/archive/f7a30f6f80006b591fa7c437fe5a951eb10bcbcf.tar.gz",
"https://github.com/bazelbuild/rules_proto/archive/f7a30f6f80006b591fa7c437fe5a951eb10bcbcf.tar.gz",
"https://mirror.bazel.build/github.com/bazelbuild/rules_proto/archive/97d8af4dc474595af3900dd85cb3a29ad28cc313.tar.gz",
"https://github.com/bazelbuild/rules_proto/archive/97d8af4dc474595af3900dd85cb3a29ad28cc313.tar.gz",
],
)

Expand Down
8 changes: 4 additions & 4 deletions cmd/go-client/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library")
# gazelle:map_kind go_binary go_image @io_bazel_rules_docker//go:image.bzl

go_library(
name = "go_default_library",
name = "go-client",
srcs = ["main.go"],
importpath = "github.com/johanbrandhorst/bazel-mono/cmd/go-client",
visibility = ["//visibility:private"],
Expand All @@ -17,8 +17,8 @@ go_library(
)

go_image(
name = "go-client",
embed = [":go_default_library"],
name = "go-client-image",
embed = [":go-client"],
pure = "on",
static = "on",
visibility = ["//visibility:public"],
Expand All @@ -27,7 +27,7 @@ go_image(
container_push(
name = "publish",
format = "Docker",
image = "go-client",
image = "go-client-image",
registry = "docker.pkg.github.com",
repository = "johanbrandhorst/bazel-mono/go-client",
tag = "{STABLE_GIT_SHA}",
Expand Down
8 changes: 4 additions & 4 deletions cmd/go-server/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library")
# gazelle:map_kind go_binary go_image @io_bazel_rules_docker//go:image.bzl

go_library(
name = "go_default_library",
name = "go-server",
srcs = ["main.go"],
importpath = "github.com/johanbrandhorst/bazel-mono/cmd/go-server",
visibility = ["//visibility:private"],
Expand All @@ -21,8 +21,8 @@ go_library(
)

go_image(
name = "go-server",
embed = [":go_default_library"],
name = "go-server-image",
embed = [":go-server"],
pure = "on",
static = "on",
visibility = ["//visibility:public"],
Expand All @@ -31,7 +31,7 @@ go_image(
container_push(
name = "publish",
format = "Docker",
image = "go-server",
image = "go-server-image",
registry = "docker.pkg.github.com",
repository = "johanbrandhorst/bazel-mono/go-server",
tag = "{STABLE_GIT_SHA}",
Expand Down
3 changes: 1 addition & 2 deletions cmd/go-server/users/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ go_library(
"@com_github_jackc_pgx_v4//stdlib",
"@com_github_masterminds_squirrel//:squirrel",
"@com_github_sirupsen_logrus//:logrus",
"@io_bazel_rules_go//proto/wkt:timestamp_go_proto",
"@org_golang_google_grpc//codes",
"@org_golang_google_grpc//status",
"@org_golang_google_protobuf//types/known/durationpb",
Expand All @@ -33,8 +32,8 @@ go_library(
go_test(
name = "users_test",
srcs = ["users_test.go"],
embed = [":users"],
deps = [
":users",
"//proto/myorg/users/v1:users",
"@com_github_google_go_cmp//cmp",
"@com_github_ory_dockertest_v3//:dockertest",
Expand Down
4 changes: 2 additions & 2 deletions cmd/go-server/users/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (
migrate "github.com/golang-migrate/migrate/v4"
"github.com/golang-migrate/migrate/v4/database/postgres"
bindata "github.com/golang-migrate/migrate/v4/source/go_bindata"
"github.com/golang/protobuf/ptypes/timestamp"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
"google.golang.org/protobuf/types/known/timestamppb"

"github.com/johanbrandhorst/bazel-mono/cmd/go-server/users/migrations"
pbUsers "github.com/johanbrandhorst/bazel-mono/proto/myorg/users/v1"
Expand Down Expand Up @@ -42,7 +42,7 @@ func validateSchema(db *sql.DB) error {

func scanUser(row squirrel.RowScanner) (*pbUsers.User, error) {
var user pbUsers.User
user.CreateTime = new(timestamp.Timestamp)
user.CreateTime = new(timestamppb.Timestamp)
err := row.Scan(
&user.Id,
(*roleWrapper)(&user.Role),
Expand Down
3 changes: 1 addition & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ require (
github.com/Masterminds/squirrel v1.5.0
github.com/fullstorydev/grpcui v1.1.0
github.com/golang-migrate/migrate/v4 v4.14.1
github.com/golang/protobuf v1.5.2
github.com/google/go-cmp v0.5.6
github.com/jackc/pgconn v1.8.1
github.com/jackc/pgtype v1.7.0
Expand All @@ -17,5 +16,5 @@ require (
github.com/soheilhy/cmux v0.1.5
github.com/stretchr/testify v1.6.1 // indirect
google.golang.org/grpc v1.37.1
google.golang.org/protobuf v1.27.0
google.golang.org/protobuf v1.27.1
)
8 changes: 3 additions & 5 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,8 @@ github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvq
github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=
github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
github.com/golang/protobuf v1.5.0 h1:LUVKkCeviFUMKqHa4tXIIij/lbhnMbP7Fn5wKdKkRh4=
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw=
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/golang/snappy v0.0.0-20170215233205-553a64147049/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
Expand Down Expand Up @@ -1033,9 +1032,8 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD
google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4=
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.27.0 h1:KhgSLlr/moiqjv0qUsSnLvdUL7NH7PHW8aZGn7Jpjko=
google.golang.org/protobuf v1.27.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ=
google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
Expand Down
28 changes: 24 additions & 4 deletions repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ def go_repositories():
sum = "h1:UQZhZ2O0vMHr2cI+DC1Mbh0TJxzA3RcLoMsFw+aXw7E=",
version = "v0.0.0-20190924025748-f65c72e2690d",
)
go_repository(
name = "com_github_antihax_optional",
importpath = "github.com/antihax/optional",
sum = "h1:xK2lYat7ZLaVVcIuj82J8kIro4V6kDe0AUDFboUCwcg=",
version = "v1.0.0",
)

go_repository(
name = "com_github_apache_arrow_go_arrow",
Expand Down Expand Up @@ -342,6 +348,13 @@ def go_repositories():
sum = "h1:cqQfy1jclcSy/FwLjemeg3SR1yaINm74aQyupQ0Bl8M=",
version = "v0.0.0-20201120205902-5459f2c99403",
)
go_repository(
name = "com_github_cncf_xds_go",
importpath = "github.com/cncf/xds/go",
sum = "h1:OZmjad4L3H8ncOIR8rnb5MREYqG8ixi5+WbeUsquF0c=",
version = "v0.0.0-20210312221358-fbca930ec8ed",
)

go_repository(
name = "com_github_cockroachdb_apd",
importpath = "github.com/cockroachdb/apd",
Expand Down Expand Up @@ -713,8 +726,8 @@ def go_repositories():
go_repository(
name = "com_github_golang_protobuf",
importpath = "github.com/golang/protobuf",
sum = "h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw=",
version = "v1.5.2",
sum = "h1:LUVKkCeviFUMKqHa4tXIIij/lbhnMbP7Fn5wKdKkRh4=",
version = "v1.5.0",
)
go_repository(
name = "com_github_golang_snappy",
Expand Down Expand Up @@ -2427,6 +2440,13 @@ def go_repositories():
sum = "h1:4r2CANuYhKGmYWP02+5E94rLRcS/YeD+KlxSrOsMxk0=",
version = "v0.1.1",
)
go_repository(
name = "io_opentelemetry_go_proto_otlp",
importpath = "go.opentelemetry.io/proto/otlp",
sum = "h1:rwOQPCuKAKmwGKq2aVNnYIibI6wnV7EvzgfTCzcdGg8=",
version = "v0.7.0",
)

go_repository(
name = "io_rsc_binaryregexp",
importpath = "rsc.io/binaryregexp",
Expand Down Expand Up @@ -2486,8 +2506,8 @@ def go_repositories():
go_repository(
name = "org_golang_google_protobuf",
importpath = "google.golang.org/protobuf",
sum = "h1:KhgSLlr/moiqjv0qUsSnLvdUL7NH7PHW8aZGn7Jpjko=",
version = "v1.27.0",
sum = "h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ=",
version = "v1.27.1",
)
go_repository(
name = "org_golang_x_crypto",
Expand Down

0 comments on commit 2b36b73

Please sign in to comment.