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

Add bazel8 support. #248

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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 @@
6.4.0
8.0.0
29 changes: 27 additions & 2 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.
#
# Supporting infrastructure for implementing and testing PINS.
load("@bazel_gazelle//:def.bzl", "gazelle")
load("@bazel_gazelle//:def.bzl", "gazelle", "gazelle_test")

package(
default_visibility = ["//visibility:public"],
Expand All @@ -22,7 +22,32 @@ package(

exports_files(["LICENSE"])

# gazelle:go_grpc_compilers @io_bazel_rules_go//proto:go_grpc_v2, @io_bazel_rules_go//proto:go_proto
# gazelle:proto_import_prefix github.com/openconfig/gnoi
# gazelle:prefix github.com/openconfig/gnoi
# gazelle:resolve proto go google/rpc/status.proto @org_golang_google_genproto_googleapis_rpc//status
# gazelle:resolve proto google/rpc/status.proto @com_google_googleapis//google/rpc:status_proto
# gazelle:resolve proto go github.com/openconfig/bootz/proto/bootz.proto @openconfig_bootz//proto:bootz_go_proto
# gazelle:resolve proto github.com/openconfig/bootz/proto/bootz.proto @openconfig_bootz//proto:bootz_proto
# gazelle:resolve proto go github.com/openconfig/gnsi/authz/authz.proto @openconfig_gnsi//authz:authz_go_proto
# gazelle:resolve proto github.com/openconfig/gnsi/authz/authz.proto @openconfig_gnsi//authz:authz_proto
# gazelle:resolve proto go github.com/openconfig/gnsi/certz/certz.proto @openconfig_gnsi//certz:certz_go_proto
# gazelle:resolve proto github.com/openconfig/gnsi/certz/certz.proto @openconfig_gnsi//certz:certz_proto
# gazelle:resolve proto go github.com/openconfig/gnsi/pathz/pathz.proto @openconfig_gnsi//pathz:pathz_go_proto
# gazelle:resolve proto github.com/openconfig/gnsi/pathz/pathz.proto @openconfig_gnsi//pathz:pathz_proto
gazelle(name = "gazelle")

# gazelle:exclude **.pb.go
gazelle(
name = "gazelle_update_repos",
args = [
"-from_file=go.mod",
"-to_macro=gnoi_go_deps.bzl%gnoi_go_deps",
"-prune",
],
command = "update-repos",
)

gazelle_test(
name = "gazelle_test",
workspace = "//:BUILD.bazel",
)
42 changes: 36 additions & 6 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,36 @@
###############################################################################
# Bazel now uses Bzlmod by default to manage external dependencies.
# Please consider migrating your external dependencies from WORKSPACE to MODULE.bazel.
#
# For more details, please check https://github.com/bazelbuild/bazel/issues/18958
###############################################################################
module(
name = "openconfig_gnoi",
)

bazel_dep(name = "gazelle", version = "0.41.0", repo_name = "bazel_gazelle")
bazel_dep(name = "googleapis", version = "0.0.0-20240819-fe8ba054a", repo_name = "com_google_googleapis")
bazel_dep(name = "grpc", version = "1.69.0", repo_name = "com_github_grpc_grpc")
bazel_dep(name = "protobuf", version = "29.3", repo_name = "com_google_protobuf")
bazel_dep(name = "rules_go", version = "0.51.0", repo_name = "io_bazel_rules_go")
bazel_dep(name = "openconfig_bootz", version = "0.0.0")
bazel_dep(name = "openconfig_gnsi", version = "0.0.0")

go_sdk = use_extension("@io_bazel_rules_go//go:extensions.bzl", "go_sdk")
go_sdk.download(version = "1.23.4")

go_deps = use_extension("@bazel_gazelle//:extensions.bzl", "go_deps")
go_deps.from_file(go_mod = "//:go.mod")
use_repo(go_deps, "com_github_golang_protobuf", "org_golang_google_genproto_googleapis_rpc", "org_golang_google_grpc", "org_golang_google_grpc_cmd_protoc_gen_go_grpc", "org_golang_google_protobuf")

git_override(
module_name = "openconfig_gnsi",
commit = "57ecb02511c1541195a212b571ddde05bc635a0a",
remote = "https://github.com/bstoll/gnsi",
)

git_override(
module_name = "openconfig_bootz",
commit = "145e9a838f6ae8ab3210848a0043e78fceda29a3",
remote = "https://github.com/bstoll/bootz",
)

git_override(
module_name = "openconfig_gnmi",
commit = "66ccc5027ea9b69376978a6eeb079ba5907249b7",
remote = "https://github.com/bstoll/gnmi",
)
Loading
Loading