Skip to content

Commit 5eae0eb

Browse files
Move Bazel workspace root to project root
Moved MODULE.bazel, WORKSPACE.bazel, .bazelrc, WORKSPACE.bzlmod, and p4runtime_deps.bzl from proto/ to the repository root. Added strip_import_prefix = "/proto" to proto_library targets in proto/BUILD.bazel to maintain correct import paths. Updated bazel/example/using-workspace and bazel/example/using-bzlmod to depend on //proto:p4info_cc_proto and point to the repository root instead of proto/. Created a root BUILD.bazel file exporting LICENSE and p4runtime_deps.bzl. Fixes #571.
1 parent b607cab commit 5eae0eb

File tree

11 files changed

+11
-18
lines changed

11 files changed

+11
-18
lines changed
File renamed without changes.

BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
exports_files(["LICENSE", "p4runtime_deps.bzl"])
File renamed without changes.
File renamed without changes.
File renamed without changes.

bazel/example/using-bzlmod/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ cc_binary(
22
name = "hello_p4runtime",
33
srcs = ["hello_p4runtime.cc"],
44
deps = [
5-
"@com_github_p4lang_p4runtime//:p4info_cc_proto",
5+
"@com_github_p4lang_p4runtime//proto:p4info_cc_proto",
66
"@com_google_protobuf//:protobuf",
77
]
88
)

bazel/example/using-bzlmod/MODULE.bazel

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ bazel_dep(
77
# of `local_repository` to load p4runtime.
88
local_path_override(
99
module_name = "p4runtime",
10-
path = "../../../proto",
10+
path = "../../..",
1111
)
1212

1313
# git_override(
1414
# module_name = "p4runtime",
15-
# strip_prefix = "p4runtime-1.4.1/proto",
15+
# strip_prefix = "p4runtime-1.4.1",
1616
# urls = ["https://github.com/p4lang/p4runtime/archive/v1.4.1.tar.gz"],
1717
# # sha256 = "<insert hash value here>",
1818
# )

bazel/example/using-workspace/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ cc_binary(
22
name = "hello_p4runtime",
33
srcs = ["hello_p4runtime.cc"],
44
deps = [
5-
"@com_github_p4lang_p4runtime//:p4info_cc_proto",
5+
"@com_github_p4lang_p4runtime//proto:p4info_cc_proto",
66
"@com_google_protobuf//:protobuf",
77
]
88
)

bazel/example/using-workspace/WORKSPACE.bazel

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
55
# of `local_repository` to load p4runtime.
66
local_repository(
77
name = "com_github_p4lang_p4runtime",
8-
path = "../../../proto",
8+
path = "../../..",
99
)
1010
# http_archive(
1111
# name = "com_github_p4lang_p4runtime",
1212
# urls = ["https://github.com/p4lang/p4runtime/archive/v1.4.1.tar.gz"],
13-
# strip_prefix = "p4runtime-1.4.1/proto",
13+
# strip_prefix = "p4runtime-1.4.1",
1414
# # sha256 = "<insert hash value here>",
1515
# )
1616

0 commit comments

Comments
 (0)