Skip to content

Commit b8a91a3

Browse files
authored
Add googleapis 0.0.0-20251111-659ea6e9 (#6488)
1 parent 1601689 commit b8a91a3

File tree

12 files changed

+332
-1
lines changed

12 files changed

+332
-1
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
module(
2+
name = "googleapis",
3+
version = "0.0.0-20251111-659ea6e9",
4+
repo_name = "com_google_googleapis",
5+
bazel_compatibility = [">=7.2.1"],
6+
)
7+
8+
# Only needed for well-known protos.
9+
bazel_dep(name = "protobuf", version = "21.7", repo_name = "com_google_protobuf")
10+
11+
# Only needed for proto_library.
12+
bazel_dep(name = "rules_proto", version = "5.3.0-21.7")
13+
14+
bazel_dep(name = "googleapis-rules-registry", version = "1.0.0")
15+
16+
rules_registry = use_extension("@googleapis-rules-registry//private/extensions:rules_registry.bzl", "rules_registry")
17+
use_repo(
18+
rules_registry,
19+
"com_google_googleapis_imports",
20+
"io_bazel_rules_go",
21+
)
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
module(
2+
name = "googleapis",
3+
version = "0.0.0-20251111-659ea6e9",
4+
repo_name = "com_google_googleapis",
5+
bazel_compatibility = [">=7.2.1"],
6+
)
7+
8+
# Only needed for well-known protos.
9+
bazel_dep(name = "protobuf", version = "21.7", repo_name = "com_google_protobuf")
10+
11+
# Only needed for proto_library.
12+
bazel_dep(name = "rules_proto", version = "5.3.0-21.7")
13+
14+
bazel_dep(name = "googleapis-rules-registry", version = "1.0.0")
15+
16+
rules_registry = use_extension("@googleapis-rules-registry//private/extensions:rules_registry.bzl", "rules_registry")
17+
use_repo(
18+
rules_registry,
19+
"com_google_googleapis_imports",
20+
"io_bazel_rules_go",
21+
)
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
"""
2+
Extends the bazel module with the ability to enable and disable groups of build rules
3+
"""
4+
5+
_use_languages_tag = tag_class(
6+
attrs = {
7+
"cc": attr.bool(default = False),
8+
"upb_c": attr.bool(default = False),
9+
"csharp": attr.bool(default = False),
10+
"gapic": attr.bool(default = False),
11+
"go": attr.bool(default = False),
12+
"go_test": attr.bool(default = False),
13+
"grpc": attr.bool(default = False),
14+
"java": attr.bool(default = False),
15+
"nodejs": attr.bool(default = False),
16+
"php": attr.bool(default = False),
17+
"python": attr.bool(default = False),
18+
"ruby": attr.bool(default = False),
19+
},
20+
)
21+
22+
def _switched_rules_impl(_ctx):
23+
# This extension is no longer used, but provided for compatibility.
24+
# Since only googleapis used to 'use_repo' a repository from this extension,
25+
# it is no longer being evaluated except possibly by 'bazel mod'. For this
26+
# reason, showing an error or warning here is pointless.
27+
pass
28+
29+
switched_rules = module_extension(
30+
implementation = _switched_rules_impl,
31+
tag_classes = {
32+
"use_languages": _use_languages_tag,
33+
},
34+
)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
common --java_runtime_version=remotejdk_11
2+
3+
# Disable warnings for external dependencies.
4+
common --per_file_copt=external/.*@-w
5+
common --host_per_file_copt=external/.*@-w
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
load(":failure_test.bzl", "php_proto_library_fails_with_message_test")
2+
3+
alias(
4+
name = "bytestream_proto",
5+
actual = "@googleapis//google/bytestream:bytestream_proto",
6+
)
7+
8+
alias(
9+
name = "bytestream_cc_proto",
10+
actual = "@googleapis//google/bytestream:bytestream_cc_proto",
11+
)
12+
13+
alias(
14+
name = "bytestream_go_proto",
15+
actual = "@googleapis//google/bytestream:bytestream_go_proto",
16+
)
17+
18+
alias(
19+
name = "bytestream_java_proto",
20+
actual = "@googleapis//google/bytestream:bytestream_java_proto",
21+
)
22+
23+
alias(
24+
name = "date_py_proto",
25+
actual = "@googleapis//google/type:date_py_proto",
26+
)
27+
28+
alias(
29+
name = "spanner_cc_grpc",
30+
actual = "@googleapis//google/spanner/v1:spanner_cc_grpc",
31+
)
32+
33+
alias(
34+
name = "spanner_java_grpc",
35+
actual = "@googleapis//google/spanner/v1:spanner_java_grpc",
36+
)
37+
38+
php_proto_library_fails_with_message_test(
39+
name = "php_proto_library_fails_with_message_test",
40+
target_under_test = "@googleapis//google/bytestream:bytestream_php_proto",
41+
)
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
bazel_dep(name = "bazel_skylib", version = "1.7.1")
2+
bazel_dep(name = "googleapis")
3+
bazel_dep(name = "googleapis-cc", version = "1.0.0")
4+
bazel_dep(name = "googleapis-go", version = "1.0.0")
5+
bazel_dep(name = "googleapis-java", version = "1.0.0")
6+
bazel_dep(name = "googleapis-python", version = "1.0.0")
7+
bazel_dep(name = "googleapis-grpc-cc", version = "1.0.0")
8+
bazel_dep(name = "googleapis-grpc-java", version = "1.0.0")
9+
10+
local_path_override(
11+
module_name = "googleapis",
12+
path = "../..",
13+
)
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
"""
2+
Confirms php proto libraries are not supported by bzlmod
3+
"""
4+
5+
load("@bazel_skylib//lib:unittest.bzl", "analysistest", "asserts")
6+
7+
def _php_proto_library_fails_with_message_test_impl(ctx):
8+
env = analysistest.begin(ctx)
9+
asserts.expect_failure(env, """php_proto_library targets in googleapis are not supported with Bzlmod. If you need them, please file an issue at https://github.com/bazelbuild/bazel-central-registry.""")
10+
return analysistest.end(env)
11+
12+
php_proto_library_fails_with_message_test = analysistest.make(
13+
_php_proto_library_fails_with_message_test_impl,
14+
expect_failure = True,
15+
)
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
--- MODULE.bazel
2+
+++ MODULE.bazel
3+
@@ -0,0 +1,21 @@
4+
+module(
5+
+ name = "googleapis",
6+
+ version = "0.0.0-20251111-659ea6e9",
7+
+ repo_name = "com_google_googleapis",
8+
+ bazel_compatibility = [">=7.2.1"],
9+
+)
10+
+
11+
+# Only needed for well-known protos.
12+
+bazel_dep(name = "protobuf", version = "21.7", repo_name = "com_google_protobuf")
13+
+
14+
+# Only needed for proto_library.
15+
+bazel_dep(name = "rules_proto", version = "5.3.0-21.7")
16+
+
17+
+bazel_dep(name = "googleapis-rules-registry", version = "1.0.0")
18+
+
19+
+rules_registry = use_extension("@googleapis-rules-registry//private/extensions:rules_registry.bzl", "rules_registry")
20+
+use_repo(
21+
+ rules_registry,
22+
+ "com_google_googleapis_imports",
23+
+ "io_bazel_rules_go",
24+
+)
Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
diff --git google/api/expr/v1alpha1/BUILD.bazel google/api/expr/v1alpha1/BUILD.bazel
2+
index 9bed46809..197e5249c 100644
3+
--- google/api/expr/v1alpha1/BUILD.bazel
4+
+++ google/api/expr/v1alpha1/BUILD.bazel
5+
@@ -233,32 +233,32 @@ cc_proto_library(
6+
##############################################################################
7+
# upb
8+
##############################################################################
9+
-load(
10+
- "@com_google_googleapis_imports//:imports.bzl",
11+
- "upb_c_proto_library",
12+
-)
13+
-
14+
-upb_c_proto_library(
15+
- name = "checked_upb_proto",
16+
- deps = [":checked_proto"],
17+
-)
18+
-
19+
-upb_c_proto_library(
20+
- name = "eval_upb_proto",
21+
- deps = [":eval_proto"],
22+
-)
23+
-
24+
-upb_c_proto_library(
25+
- name = "explain_upb_proto",
26+
- deps = [":explain_proto"],
27+
-)
28+
-
29+
-upb_c_proto_library(
30+
- name = "syntax_upb_proto",
31+
- deps = [":syntax_proto"],
32+
-)
33+
-
34+
-upb_c_proto_library(
35+
- name = "value_upb_proto",
36+
- deps = [":value_proto"],
37+
-)
38+
+#load(
39+
+ #"@com_google_googleapis_imports//:imports.bzl",
40+
+ #"upb_c_proto_library",
41+
+#)
42+
+#
43+
+#upb_c_proto_library(
44+
+ #name = "checked_upb_proto",
45+
+ #deps = [":checked_proto"],
46+
+#)
47+
+#
48+
+#upb_c_proto_library(
49+
+ #name = "eval_upb_proto",
50+
+ #deps = [":eval_proto"],
51+
+#)
52+
+#
53+
+#upb_c_proto_library(
54+
+ #name = "explain_upb_proto",
55+
+ #deps = [":explain_proto"],
56+
+#)
57+
+#
58+
+#upb_c_proto_library(
59+
+ #name = "syntax_upb_proto",
60+
+ #deps = [":syntax_proto"],
61+
+#)
62+
+#
63+
+#upb_c_proto_library(
64+
+ #name = "value_upb_proto",
65+
+ #deps = [":value_proto"],
66+
+#)
67+
diff --git google/rpc/BUILD.bazel google/rpc/BUILD.bazel
68+
index 31fd6457d..c38f00c46 100644
69+
--- google/rpc/BUILD.bazel
70+
+++ google/rpc/BUILD.bazel
71+
@@ -11,7 +11,7 @@ load(
72+
"php_proto_library",
73+
"py_gapic_assembly_pkg",
74+
"py_proto_library",
75+
- "upb_c_proto_library",
76+
+ #"upb_c_proto_library",
77+
)
78+
load("@rules_proto//proto:defs.bzl", "proto_library")
79+
80+
@@ -104,15 +104,15 @@ cc_proto_library(
81+
deps = [":status_proto"],
82+
)
83+
84+
-upb_c_proto_library(
85+
- name = "code_upb_proto",
86+
- deps = [":code_proto"],
87+
-)
88+
+#upb_c_proto_library(
89+
+ #name = "code_upb_proto",
90+
+ #deps = [":code_proto"],
91+
+#)
92+
93+
-upb_c_proto_library(
94+
- name = "status_upb_proto",
95+
- deps = [":status_proto"],
96+
-)
97+
+#upb_c_proto_library(
98+
+ #name = "status_upb_proto",
99+
+ #deps = [":status_proto"],
100+
+#)
101+
102+
py_proto_library(
103+
name = "code_py_proto",
104+
diff --git repository_rules.bzl repository_rules.bzl
105+
index 2f87ad682..2ab3bd054 100644
106+
--- repository_rules.bzl
107+
+++ repository_rules.bzl
108+
@@ -224,11 +224,11 @@ def switched_rules_by_language(
109+
#
110+
# upb
111+
#
112+
- rules["upb_c_proto_library"] = _switch(
113+
- upb,
114+
- "@com_google_protobuf//bazel:upb_c_proto_library.bzl",
115+
- "upb_c_proto_library",
116+
- )
117+
+ #rules["upb_c_proto_library"] = _switch(
118+
+ # upb,
119+
+ # "@com_google_protobuf//bazel:upb_c_proto_library.bzl",
120+
+ # "upb_c_proto_library",
121+
+ #)
122+
123+
#
124+
# PHP
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
bcr_test_module:
2+
module_path: "tests/bcr"
3+
matrix:
4+
platform: ["debian10", "macos", "ubuntu2004", "windows"]
5+
bazel: ["7.x", "8.x"]
6+
tasks:
7+
run_tests:
8+
name: "Run test module"
9+
bazel: ${{ bazel }}
10+
platform: ${{ platform }}
11+
build_targets:
12+
- "//..."
13+
test_targets:
14+
- "//..."

0 commit comments

Comments
 (0)