Skip to content

Commit 92bbe53

Browse files
committed
Restore WORKSPACE support without strip_import_prefix (Bazel 6-7)
Like bazel-workspace-support, but with the workspace root at proto/ and no strip_import_prefix. This makes the repo consumable via http_archive with strip_prefix=".../proto" without any path conflicts. Signed-off-by: Steffen Smolka <steffen.smolka@gmail.com>
1 parent cf148d2 commit 92bbe53

8 files changed

Lines changed: 20 additions & 133 deletions

File tree

BUILD.bazel

Lines changed: 0 additions & 74 deletions
This file was deleted.
File renamed without changes.
File renamed without changes.

proto/BUILD.bazel

Lines changed: 19 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -11,103 +11,68 @@ license(
1111
license_text = "LICENSE",
1212
)
1313

14-
exports_files(["LICENSE"])
14+
exports_files(["LICENSE", "p4runtime_deps.bzl"])
1515

1616
# -- Aliases for backward compatibility --------------------------------------
1717
# TODO(https://github.com/p4lang/p4runtime/issues/576): Remove in 2.0.
1818

1919
alias(
2020
name = "p4types_proto",
21-
actual = "//proto/p4/config/v1:p4types_proto",
22-
deprecation = "Please use @p4runtime//proto/p4/config/v1:p4types_proto instead.",
21+
actual = "//p4/config/v1:p4types_proto",
22+
deprecation = "Please use @p4runtime//p4/config/v1:p4types_proto instead.",
2323
)
2424

2525
alias(
2626
name = "p4info_proto",
27-
actual = "//proto/p4/config/v1:p4info_proto",
28-
deprecation = "Please use @p4runtime//proto/p4/config/v1:p4info_proto instead.",
27+
actual = "//p4/config/v1:p4info_proto",
28+
deprecation = "Please use @p4runtime//p4/config/v1:p4info_proto instead.",
2929
)
3030

3131
alias(
3232
name = "p4data_proto",
33-
actual = "//proto/p4/v1:p4data_proto",
34-
deprecation = "Please use @p4runtime//proto/p4/v1:p4data_proto instead.",
33+
actual = "//p4/v1:p4data_proto",
34+
deprecation = "Please use @p4runtime//p4/v1:p4data_proto instead.",
3535
)
3636

3737
alias(
3838
name = "p4runtime_proto",
39-
actual = "//proto/p4/v1:p4runtime_proto",
40-
deprecation = "Please use @p4runtime//proto/p4/v1:p4runtime_proto instead.",
39+
actual = "//p4/v1:p4runtime_proto",
40+
deprecation = "Please use @p4runtime//p4/v1:p4runtime_proto instead.",
4141
)
4242

4343
alias(
4444
name = "p4types_cc_proto",
45-
actual = "//proto/p4/config/v1:p4types_cc_proto",
46-
deprecation = "Please use @p4runtime//proto/p4/config/v1:p4types_cc_proto instead.",
45+
actual = "//p4/config/v1:p4types_cc_proto",
46+
deprecation = "Please use @p4runtime//p4/config/v1:p4types_cc_proto instead.",
4747
)
4848

4949
alias(
5050
name = "p4info_cc_proto",
51-
actual = "//proto/p4/config/v1:p4info_cc_proto",
52-
deprecation = "Please use @p4runtime//proto/p4/config/v1:p4info_cc_proto instead.",
51+
actual = "//p4/config/v1:p4info_cc_proto",
52+
deprecation = "Please use @p4runtime//p4/config/v1:p4info_cc_proto instead.",
5353
)
5454

5555
alias(
5656
name = "p4data_cc_proto",
57-
actual = "//proto/p4/v1:p4data_cc_proto",
58-
deprecation = "Please use @p4runtime//proto/p4/v1:p4data_cc_proto instead.",
57+
actual = "//p4/v1:p4data_cc_proto",
58+
deprecation = "Please use @p4runtime//p4/v1:p4data_cc_proto instead.",
5959
)
6060

6161
alias(
6262
name = "p4runtime_cc_proto",
63-
actual = "//proto/p4/v1:p4runtime_cc_proto",
64-
deprecation = "Please use @p4runtime//proto/p4/v1:p4runtime_cc_proto instead.",
63+
actual = "//p4/v1:p4runtime_cc_proto",
64+
deprecation = "Please use @p4runtime//p4/v1:p4runtime_cc_proto instead.",
6565
)
6666

6767
alias(
6868
name = "p4runtime_cc_grpc",
69-
actual = "//proto/p4/v1:p4runtime_cc_grpc",
70-
deprecation = "Please use @p4runtime//proto/p4/v1:p4runtime_cc_grpc instead.",
69+
actual = "//p4/v1:p4runtime_cc_grpc",
70+
deprecation = "Please use @p4runtime//p4/v1:p4runtime_cc_grpc instead.",
7171
)
7272

73-
alias(
74-
name = "p4types_py_proto",
75-
actual = "//proto/p4/config/v1:p4types_py_proto",
76-
deprecation = "Please use @p4runtime//proto/p4/config/v1:p4types_py_proto instead.",
77-
)
7873

79-
alias(
80-
name = "p4info_py_proto",
81-
actual = "//proto/p4/config/v1:p4info_py_proto",
82-
deprecation = "Please use @p4runtime//proto/p4/config/v1:p4info_py_proto instead.",
83-
)
8474

85-
alias(
86-
name = "p4data_py_proto",
87-
actual = "//proto/p4/v1:p4data_py_proto",
88-
deprecation = "Please use @p4runtime//proto/p4/v1:p4data_py_proto instead.",
89-
)
9075

91-
alias(
92-
name = "p4runtime_py_proto",
93-
actual = "//proto/p4/v1:p4runtime_py_proto",
94-
deprecation = "Please use @p4runtime//proto/p4/v1:p4runtime_py_proto instead.",
95-
)
9676

97-
alias(
98-
name = "p4runtime_py_grpc",
99-
actual = "//proto/p4/v1:p4runtime_py_grpc",
100-
deprecation = "Please use @p4runtime//proto/p4/v1:p4runtime_py_grpc instead.",
101-
)
10277

103-
alias(
104-
name = "p4info_go_proto",
105-
actual = "//proto/p4/config/v1:p4info_go_proto",
106-
deprecation = "Please use @p4runtime//proto/p4/config/v1:p4info_go_proto instead.",
107-
)
10878

109-
alias(
110-
name = "p4runtime_go_proto",
111-
actual = "//proto/p4/v1:p4runtime_go_proto",
112-
deprecation = "Please use @p4runtime//proto/p4/v1:p4runtime_go_proto instead.",
113-
)
File renamed without changes.

proto/p4/config/v1/BUILD.bazel

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,11 @@ package(
88
proto_library(
99
name = "p4types_proto",
1010
srcs = ["p4types.proto"],
11-
strip_import_prefix = "/proto",
1211
)
1312

1413
proto_library(
1514
name = "p4info_proto",
1615
srcs = ["p4info.proto"],
17-
strip_import_prefix = "/proto",
1816
deps = [
1917
":p4types_proto",
2018
"@com_google_protobuf//:any_proto",

proto/p4/v1/BUILD.bazel

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,14 @@ package(
99
proto_library(
1010
name = "p4data_proto",
1111
srcs = ["p4data.proto"],
12-
strip_import_prefix = "/proto",
1312
)
1413

1514
proto_library(
1615
name = "p4runtime_proto",
1716
srcs = ["p4runtime.proto"],
18-
strip_import_prefix = "/proto",
1917
deps = [
2018
":p4data_proto",
21-
"//proto/p4/config/v1:p4info_proto",
19+
"//p4/config/v1:p4info_proto",
2220
"@com_google_googleapis//google/rpc:status_proto",
2321
"@com_google_protobuf//:any_proto",
2422
],

0 commit comments

Comments
 (0)