Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bazel] bump bazel version to 6.2.1 #34

Merged
merged 2 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.2.0
6.2.1
17 changes: 11 additions & 6 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -34,28 +34,33 @@ crt_register_toolchains(
win64 = True,
)

# Go dependencies.
# gazelle:repository_macro third_party/go/deps.bzl%go_packages_
load("//third_party/go:repos.bzl", "go_repos")
go_repos()
load("//third_party/go:deps.bzl", "go_deps")
go_deps()

# Various linters.
load("//third_party/lint:repos.bzl", "lint_repos")
lint_repos()

# Google dependencies.
# BoringSSL, RE2, GoogleTest, Protobuf Matchers, ABSL, Protobuf, gRPC.
# BoringSSL, RE2, GoogleTest, Protobuf Matchers, ABSL.
load("//third_party/google:repos.bzl", "google_repos")
google_repos()
# Load the deps from the Google repos in the correct order.

# Protobuf rules.
load("//third_party/protobuf:repos.bzl", "protobuf_repos")
protobuf_repos()
# Load the proto deps in the right order
load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
protobuf_deps()
load("@com_github_grpc_grpc//bazel:grpc_deps.bzl", "grpc_deps")
grpc_deps()
load("@com_github_grpc_grpc//bazel:grpc_extra_deps.bzl", "grpc_extra_deps")
grpc_extra_deps()

# Various linters.
load("//third_party/lint:repos.bzl", "lint_repos")
lint_repos()

# Foreign CC and packaging/release rules.
load("//third_party/bazel:repos.bzl", "bazel_repos")
bazel_repos()
Expand Down
2 changes: 1 addition & 1 deletion src/proto/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

# OT Provisioning Protobuf Definitions

load("@rules_proto//proto:defs.bzl", "proto_library")
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
load("@rules_proto//proto:defs.bzl", "proto_library")

package(default_visibility = ["//visibility:public"])

Expand Down
2 changes: 2 additions & 0 deletions third_party/docker/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright lowRISC contributors (OpenTitan project).
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0

package(default_visibility = ["//visibility:public"])
2 changes: 2 additions & 0 deletions third_party/go/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright lowRISC contributors (OpenTitan project).
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0

package(default_visibility = ["//visibility:public"])
12 changes: 6 additions & 6 deletions third_party/go/repos.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

_RULES_GO_VERSION = "0.34.0"
_GAZELLE_VERSION = "0.24.0"

def go_repos():
# Go toolchain
http_archive(
name = "io_bazel_rules_go",
sha256 = "16e9fca53ed6bd4ff4ad76facc9b7b651a89db1689a2877d6fd7b82aa824e366",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.34.0/rules_go-v0.34.0.zip",
"https://github.com/bazelbuild/rules_go/releases/download/v0.34.0/rules_go-v0.34.0.zip",
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v{}/rules_go-v{}.zip".format(_RULES_GO_VERSION, _RULES_GO_VERSION),
"https://github.com/bazelbuild/rules_go/releases/download/v{}/rules_go-v{}.zip".format(_RULES_GO_VERSION, _RULES_GO_VERSION),
],
)

# Gazelle go version management
http_archive(
name = "bazel_gazelle",
sha256 = "de69a09dc70417580aabf20a28619bb3ef60d038470c7cf8442fafcf627c21cb",
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",
],
url = "https://github.com/bazelbuild/bazel-gazelle/releases/download/v{}/bazel-gazelle-v{}.tar.gz".format(_GAZELLE_VERSION, _GAZELLE_VERSION),
)
20 changes: 0 additions & 20 deletions third_party/google/repos.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -49,23 +49,3 @@ def google_repos():
strip_prefix = "abseil-cpp-20230125.0",
sha256 = "3ea49a7d97421b88a8c48a0de16c16048e17725c7ec0f1d3ea2683a2a75adc21",
)

# Protobuf toolchain
http_archive(
name = "com_google_protobuf",
urls = [
"https://github.com/protocolbuffers/protobuf/releases/download/v3.17.3/protobuf-all-3.17.3.tar.gz",
],
strip_prefix = "protobuf-3.17.3",
sha256 = "77ad26d3f65222fd96ccc18b055632b0bfedf295cb748b712a98ba1ac0b704b2",
)

# gRPC
http_archive(
name = "com_github_grpc_grpc",
sha256 = "ec19657a677d49af59aa806ec299c070c882986c9fcc022b1c22c2a3caf01bcd",
strip_prefix = "grpc-1.45.0",
urls = ["https://github.com/grpc/grpc/archive/refs/tags/v1.45.0.tar.gz"],
patches = [Label("//third_party/google:grpc-windows-constraints.patch")],
patch_args = ["-p1"],
)
5 changes: 5 additions & 0 deletions third_party/protobuf/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright lowRISC contributors (OpenTitan project).
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0

package(default_visibility = ["//visibility:public"])
13 changes: 13 additions & 0 deletions third_party/protobuf/grpc-go-toolchain.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/bazel/grpc_extra_deps.bzl b/bazel/grpc_extra_deps.bzl
index 4d8afa3131..514189f9a5 100644
--- a/bazel/grpc_extra_deps.bzl
+++ b/bazel/grpc_extra_deps.bzl
@@ -53,7 +53,7 @@ def grpc_extra_deps(ignore_version_differences = False):
api_dependencies()

go_rules_dependencies()
- go_register_toolchains(version = "1.18")
+ go_register_toolchains()
gazelle_dependencies()

# Pull-in the go 3rd party dependencies for protoc_gen_validate, which is
30 changes: 30 additions & 0 deletions third_party/protobuf/repos.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Copyright lowRISC contributors (OpenTitan project).
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

_PROTOBUF_VERSION = "3.20.1"
_GRPC_VERSION = "1.52.0"

def protobuf_repos():
# Protobuf toolchain
http_archive(
name = "com_google_protobuf",
url = "https://github.com/protocolbuffers/protobuf/releases/download/v{}/protobuf-all-{}.tar.gz".format(_PROTOBUF_VERSION, _PROTOBUF_VERSION),
sha256 = "3a400163728db996e8e8d21c7dfb3c239df54d0813270f086c4030addeae2fad",
strip_prefix = "protobuf-{}".format(_PROTOBUF_VERSION),
)

#gRPC
http_archive(
name = "com_github_grpc_grpc",
sha256 = "df9608a5bd4eb6d6b78df75908bb3390efdbbb9e07eddbee325e98cdfad6acd5",
strip_prefix = "grpc-{}".format(_GRPC_VERSION),
url = "https://github.com/grpc/grpc/archive/refs/tags/v{}.tar.gz".format(_GRPC_VERSION),
patches = [
Label("//third_party/protobuf:grpc-windows-constraints.patch"),
Label("//third_party/protobuf:grpc-go-toolchain.patch"),
],
patch_args = ["-p1"],
)
Loading