Skip to content

Commit

Permalink
bazel: fix "missing strict dependencies" build issue (#72)
Browse files Browse the repository at this point in the history
Signed-off-by: Sergii Tkachenko <sergiitk@google.com>
  • Loading branch information
sergiitk authored Nov 9, 2023
1 parent 8bd2eac commit 523115e
Show file tree
Hide file tree
Showing 37 changed files with 120 additions and 231 deletions.
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.2.2
6.3.2
59 changes: 52 additions & 7 deletions bazel/dependency_imports.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_depe
load("@com_envoyproxy_protoc_gen_validate//bazel:repositories.bzl", "pgv_dependencies")

# go version for rules_go
GO_VERSION = "1.16.6"
GO_VERSION = "1.20.2"

def xds_dependency_imports(go_version = GO_VERSION):
protobuf_deps()
Expand All @@ -24,27 +24,71 @@ def xds_dependency_imports(go_version = GO_VERSION):
},
)

# These dependencies, like most of the Go in this repository, exist only for the API.
# These repos also have transient dependencies - `build_external` allows them to use them.
# TODO(phlax): remove `build_external` and pin all transients
go_repository(
name = "com_github_iancoleman_strcase",
importpath = "github.com/iancoleman/strcase",
sum = "h1:ux/56T2xqZO/3cP1I2F86qpeoYPCOzk+KF/UH/Ar+lk=",
version = "v0.0.0-20180726023541-3605ed457bf7",
build_external = "external",
# project_url = "https://pkg.go.dev/github.com/iancoleman/strcase",
# last_update = "2020-11-22"
# use_category = ["api"],
# source = "https://github.com/bufbuild/protoc-gen-validate/blob/v0.6.1/dependencies.bzl#L23-L28"
)
go_repository(
name = "org_golang_x_net",
importpath = "golang.org/x/net",
sum = "h1:0mm1VjtFUOIlE1SbDlwjYaDxZVDP2S5ou6y0gSgXHu8=",
version = "v0.0.0-20200226121028-0de0cce0169b",
build_external = "external",
# project_url = "https://pkg.go.dev/golang.org/x/net",
# last_update = "2020-02-26"
# use_category = ["api"],
# source = "https://github.com/bufbuild/protoc-gen-validate/blob/v0.6.1/dependencies.bzl#L129-L134"
)
go_repository(
name = "org_golang_x_text",
importpath = "golang.org/x/text",
sum = "h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k=",
version = "v0.3.3",
build_external = "external",
# project_url = "https://pkg.go.dev/golang.org/x/text",
# last_update = "2021-06-16"
# use_category = ["api"],
# source = "https://github.com/bufbuild/protoc-gen-validate/blob/v0.6.1/dependencies.bzl#L148-L153"
)

go_repository(
name = "com_github_spf13_afero",
importpath = "github.com/spf13/afero",
sum = "h1:8q6vk3hthlpb2SouZcnBVKboxWQWMDNF38bwholZrJc=",
version = "v1.3.4",
build_external = "external",
# project_url = "https://pkg.go.dev/github.com/spf13/afero",
# last_update = "2021-03-20"
# use_category = ["api"],
# source = "https://github.com/bufbuild/protoc-gen-validate/blob/v0.6.1/dependencies.bzl#L60-L65"
)

go_repository(
name = "com_github_lyft_protoc_gen_star",
importpath = "github.com/lyft/protoc-gen-star",
sum = "h1:sImehRT+p7lW9n6R7MQc5hVgzWGEkDVZU4AsBQ4Isu8=",
version = "v0.5.1",
importpath = "github.com/lyft/protoc-gen-star/v2",
sum = "h1:keaAo8hRuAT0O3DfJ/wM3rufbAjGeJ1lAtWZHDjKGB0=",
version = "v2.0.1",
build_external = "external",
# project_url = "https://pkg.go.dev/github.com/lyft/protoc-gen-star",
# last_update = "2023-01-06"
# use_category = ["api"],
# source = "https://github.com/bufbuild/protoc-gen-validate/blob/v0.10.1/dependencies.bzl#L35-L40"
)
go_repository(
name = "org_golang_google_protobuf",
importpath = "google.golang.org/protobuf",
sum = "h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w=",
version = "v1.28.1",
build_external = "external",
)

go_repository(
name = "org_golang_google_grpc",
build_file_proto_mode = "disable",
Expand All @@ -53,6 +97,7 @@ def xds_dependency_imports(go_version = GO_VERSION):
version = "v1.40.0",
)


# Old name for backward compatibility.
# TODO(roth): Remove this once callers are migrated to the new name.
def udpa_dependency_imports(go_version = GO_VERSION):
Expand Down
11 changes: 7 additions & 4 deletions bazel/repository_locations.bzl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
REPOSITORY_LOCATIONS = dict(
bazel_gazelle = dict(
sha256 = "62ca106be173579c0a167deb23358fdfe71ffa1e4cfdddf5582af26520f1c66f",
urls = ["https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.23.0/bazel-gazelle-v0.23.0.tar.gz"],
sha256 = "b8b6d75de6e4bf7c41b7737b183523085f56283f6db929b86c5e7e1f09cf59c9",
urls = ["https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.31.1/bazel-gazelle-v0.31.1.tar.gz"],
),
bazel_skylib = dict(
sha256 = "1c531376ac7e5a180e0237938a2536de0c54d93f5c278634818e0efc952dd56c",
Expand Down Expand Up @@ -29,7 +29,10 @@ REPOSITORY_LOCATIONS = dict(
urls = ["https://github.com/protocolbuffers/protobuf/releases/download/v3.18.0/protobuf-all-3.18.0.tar.gz"],
),
io_bazel_rules_go = dict(
sha256 = "69de5c704a05ff37862f7e0f5534d4f479418afc21806c887db544a316f3cb6b",
urls = ["https://github.com/bazelbuild/rules_go/releases/download/v0.27.0/rules_go-v0.27.0.tar.gz"],
sha256 = "6dc2da7ab4cf5d7bfc7c949776b1b7c733f05e56edc4bcd9022bb249d2e2a996",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.39.1/rules_go-v0.39.1.zip",
"https://github.com/bazelbuild/rules_go/releases/download/v0.39.1/rules_go-v0.39.1.zip",
],
),
)
7 changes: 1 addition & 6 deletions go/udpa/annotations/migrate.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 1 addition & 6 deletions go/udpa/annotations/security.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 1 addition & 6 deletions go/udpa/annotations/sensitive.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 1 addition & 6 deletions go/udpa/annotations/status.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 1 addition & 6 deletions go/udpa/annotations/versioning.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 1 addition & 6 deletions go/udpa/data/orca/v1/orca_load_report.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 1 addition & 6 deletions go/udpa/service/orca/v1/orca.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 1 addition & 6 deletions go/udpa/type/v1/typed_struct.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 1 addition & 6 deletions go/xds/annotations/v3/migrate.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 1 addition & 6 deletions go/xds/annotations/v3/security.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 523115e

Please sign in to comment.