From 2706086cb87d7796a5cdc7e90b658f52b8522ee3 Mon Sep 17 00:00:00 2001 From: Fabian Meumertzheim Date: Sat, 21 Dec 2024 00:42:12 +0100 Subject: [PATCH 01/11] Add googleapis 0.0.0-20241220-5e258e33 --- modules/googleapis-cc/0.1.0/MODULE.bazel | 14 +++ .../googleapis-cc/0.1.0/overlay/MODULE.bazel | 1 + modules/googleapis-cc/0.1.0/presubmit.yml | 0 modules/googleapis-cc/0.1.0/source.json | 7 ++ modules/googleapis-cc/metadata.json | 16 +++ modules/googleapis-go/0.1.0/MODULE.bazel | 14 +++ .../googleapis-go/0.1.0/overlay/MODULE.bazel | 1 + modules/googleapis-go/0.1.0/presubmit.yml | 0 modules/googleapis-go/0.1.0/source.json | 7 ++ modules/googleapis-go/metadata.json | 16 +++ modules/googleapis-java/0.1.0/MODULE.bazel | 14 +++ .../0.1.0/overlay/MODULE.bazel | 1 + modules/googleapis-java/0.1.0/presubmit.yml | 0 modules/googleapis-java/0.1.0/source.json | 7 ++ modules/googleapis-java/metadata.json | 16 +++ modules/googleapis-python/0.1.0/MODULE.bazel | 14 +++ .../0.1.0/overlay/MODULE.bazel | 1 + modules/googleapis-python/0.1.0/presubmit.yml | 0 modules/googleapis-python/0.1.0/source.json | 7 ++ modules/googleapis-python/metadata.json | 16 +++ .../0.0.0-20241220-5e258e33/MODULE.bazel | 11 ++ .../overlay/MODULE.bazel | 1 + .../overlay/extensions.bzl | 30 +++++ .../overlay/private/extensions/BUILD.bazel | 0 .../overlay/private/extensions/constants.bzl | 44 +++++++ .../overlay/private/extensions/fail_macro.bzl | 12 ++ .../private/extensions/switched_rules.bzl | 107 ++++++++++++++++++ .../overlay/tests/bcr/.bazelrc | 1 + .../overlay/tests/bcr/BUILD.bazel | 21 ++++ .../overlay/tests/bcr/MODULE.bazel | 10 ++ .../overlay/tests/bcr/failure_test.bzl | 11 ++ .../0.0.0-20241220-5e258e33/presubmit.yml | 12 ++ .../0.0.0-20241220-5e258e33/source.json | 17 +++ modules/googleapis/metadata.json | 3 +- 34 files changed, 431 insertions(+), 1 deletion(-) create mode 100644 modules/googleapis-cc/0.1.0/MODULE.bazel create mode 120000 modules/googleapis-cc/0.1.0/overlay/MODULE.bazel create mode 100644 modules/googleapis-cc/0.1.0/presubmit.yml create mode 100644 modules/googleapis-cc/0.1.0/source.json create mode 100644 modules/googleapis-cc/metadata.json create mode 100644 modules/googleapis-go/0.1.0/MODULE.bazel create mode 120000 modules/googleapis-go/0.1.0/overlay/MODULE.bazel create mode 100644 modules/googleapis-go/0.1.0/presubmit.yml create mode 100644 modules/googleapis-go/0.1.0/source.json create mode 100644 modules/googleapis-go/metadata.json create mode 100644 modules/googleapis-java/0.1.0/MODULE.bazel create mode 120000 modules/googleapis-java/0.1.0/overlay/MODULE.bazel create mode 100644 modules/googleapis-java/0.1.0/presubmit.yml create mode 100644 modules/googleapis-java/0.1.0/source.json create mode 100644 modules/googleapis-java/metadata.json create mode 100644 modules/googleapis-python/0.1.0/MODULE.bazel create mode 120000 modules/googleapis-python/0.1.0/overlay/MODULE.bazel create mode 100644 modules/googleapis-python/0.1.0/presubmit.yml create mode 100644 modules/googleapis-python/0.1.0/source.json create mode 100644 modules/googleapis-python/metadata.json create mode 100644 modules/googleapis/0.0.0-20241220-5e258e33/MODULE.bazel create mode 120000 modules/googleapis/0.0.0-20241220-5e258e33/overlay/MODULE.bazel create mode 100644 modules/googleapis/0.0.0-20241220-5e258e33/overlay/extensions.bzl create mode 100644 modules/googleapis/0.0.0-20241220-5e258e33/overlay/private/extensions/BUILD.bazel create mode 100644 modules/googleapis/0.0.0-20241220-5e258e33/overlay/private/extensions/constants.bzl create mode 100644 modules/googleapis/0.0.0-20241220-5e258e33/overlay/private/extensions/fail_macro.bzl create mode 100644 modules/googleapis/0.0.0-20241220-5e258e33/overlay/private/extensions/switched_rules.bzl create mode 100644 modules/googleapis/0.0.0-20241220-5e258e33/overlay/tests/bcr/.bazelrc create mode 100644 modules/googleapis/0.0.0-20241220-5e258e33/overlay/tests/bcr/BUILD.bazel create mode 100644 modules/googleapis/0.0.0-20241220-5e258e33/overlay/tests/bcr/MODULE.bazel create mode 100644 modules/googleapis/0.0.0-20241220-5e258e33/overlay/tests/bcr/failure_test.bzl create mode 100644 modules/googleapis/0.0.0-20241220-5e258e33/presubmit.yml create mode 100644 modules/googleapis/0.0.0-20241220-5e258e33/source.json diff --git a/modules/googleapis-cc/0.1.0/MODULE.bazel b/modules/googleapis-cc/0.1.0/MODULE.bazel new file mode 100644 index 00000000000..92d0cc953c3 --- /dev/null +++ b/modules/googleapis-cc/0.1.0/MODULE.bazel @@ -0,0 +1,14 @@ +module( + name = "googleapis-cc", + version = "0.1.0", + bazel_compatibility = [">=7.2.1"], +) + +bazel_dep(name = "googleapis", version = "0.0.0-20241220-5e258e33") +bazel_dep(name = "protobuf", version = "27.0") + +switched_rules = use_extension("@googleapis//private/extensions:switched_rules.bzl", "switched_rules") +switched_rules.register( + name = "cc_proto_library", + file = "@protobuf//bazel:cc_proto_library.bzl", +) \ No newline at end of file diff --git a/modules/googleapis-cc/0.1.0/overlay/MODULE.bazel b/modules/googleapis-cc/0.1.0/overlay/MODULE.bazel new file mode 120000 index 00000000000..9b599e3ad9c --- /dev/null +++ b/modules/googleapis-cc/0.1.0/overlay/MODULE.bazel @@ -0,0 +1 @@ +../MODULE.bazel \ No newline at end of file diff --git a/modules/googleapis-cc/0.1.0/presubmit.yml b/modules/googleapis-cc/0.1.0/presubmit.yml new file mode 100644 index 00000000000..e69de29bb2d diff --git a/modules/googleapis-cc/0.1.0/source.json b/modules/googleapis-cc/0.1.0/source.json new file mode 100644 index 00000000000..5e70383c24c --- /dev/null +++ b/modules/googleapis-cc/0.1.0/source.json @@ -0,0 +1,7 @@ +{ + "integrity": "sha256-hznHbmgfkAkjuQDJ3w73XPQh05yrtUZQxLmtGbanbYU=", + "url": "https://github.com/fmeum/bazel-central-registry/releases/download/v1.0.0/empty.zip", + "overlay": { + "MODULE.bazel": "sha256-4GPXxlFen3Atai6EyboC87iGAPuNSpfBBmwnMQbayqc=" + } +} diff --git a/modules/googleapis-cc/metadata.json b/modules/googleapis-cc/metadata.json new file mode 100644 index 00000000000..ed2c966d2e4 --- /dev/null +++ b/modules/googleapis-cc/metadata.json @@ -0,0 +1,16 @@ +{ + "homepage": "https://github.com/googleapis/googleapis", + "maintainers": [ + { + "email": "bcr-maintainers@bazel.build", + "name": "No Maintainer Specified" + } + ], + "repository": [ + "github:googleapis/googleapis" + ], + "versions": [ + "0.1.0" + ], + "yanked_versions": {} +} diff --git a/modules/googleapis-go/0.1.0/MODULE.bazel b/modules/googleapis-go/0.1.0/MODULE.bazel new file mode 100644 index 00000000000..b8988bf0ae7 --- /dev/null +++ b/modules/googleapis-go/0.1.0/MODULE.bazel @@ -0,0 +1,14 @@ +module( + name = "googleapis-go", + version = "0.1.0", + bazel_compatibility = [">=7.2.1"], +) + +bazel_dep(name = "googleapis", version = "0.0.0-20241220-5e258e33") +bazel_dep(name = "rules_go", version = "0.50.1") + +switched_rules = use_extension("@googleapis//private/extensions:switched_rules.bzl", "switched_rules") +switched_rules.register( + name = "go_proto_library", + file = "@rules_go//proto:def.bzl", +) \ No newline at end of file diff --git a/modules/googleapis-go/0.1.0/overlay/MODULE.bazel b/modules/googleapis-go/0.1.0/overlay/MODULE.bazel new file mode 120000 index 00000000000..9b599e3ad9c --- /dev/null +++ b/modules/googleapis-go/0.1.0/overlay/MODULE.bazel @@ -0,0 +1 @@ +../MODULE.bazel \ No newline at end of file diff --git a/modules/googleapis-go/0.1.0/presubmit.yml b/modules/googleapis-go/0.1.0/presubmit.yml new file mode 100644 index 00000000000..e69de29bb2d diff --git a/modules/googleapis-go/0.1.0/source.json b/modules/googleapis-go/0.1.0/source.json new file mode 100644 index 00000000000..44d8e89b4c9 --- /dev/null +++ b/modules/googleapis-go/0.1.0/source.json @@ -0,0 +1,7 @@ +{ + "integrity": "sha256-hznHbmgfkAkjuQDJ3w73XPQh05yrtUZQxLmtGbanbYU=", + "url": "https://github.com/fmeum/bazel-central-registry/releases/download/v1.0.0/empty.zip", + "overlay": { + "MODULE.bazel": "sha256-GUjZBV62PY/o9joplOGrL6pIIASpyqWnhns27+JUCts=" + } +} diff --git a/modules/googleapis-go/metadata.json b/modules/googleapis-go/metadata.json new file mode 100644 index 00000000000..ed2c966d2e4 --- /dev/null +++ b/modules/googleapis-go/metadata.json @@ -0,0 +1,16 @@ +{ + "homepage": "https://github.com/googleapis/googleapis", + "maintainers": [ + { + "email": "bcr-maintainers@bazel.build", + "name": "No Maintainer Specified" + } + ], + "repository": [ + "github:googleapis/googleapis" + ], + "versions": [ + "0.1.0" + ], + "yanked_versions": {} +} diff --git a/modules/googleapis-java/0.1.0/MODULE.bazel b/modules/googleapis-java/0.1.0/MODULE.bazel new file mode 100644 index 00000000000..fc2ed3e3f91 --- /dev/null +++ b/modules/googleapis-java/0.1.0/MODULE.bazel @@ -0,0 +1,14 @@ +module( + name = "googleapis-java", + version = "0.1.0", + bazel_compatibility = [">=7.2.1"], +) + +bazel_dep(name = "googleapis", version = "0.0.0-20241220-5e258e33") +bazel_dep(name = "protobuf", version = "27.0") + +switched_rules = use_extension("@googleapis//private/extensions:switched_rules.bzl", "switched_rules") +switched_rules.register( + name = "java_proto_library", + file = "@protobuf//bazel:java_proto_library.bzl", +) \ No newline at end of file diff --git a/modules/googleapis-java/0.1.0/overlay/MODULE.bazel b/modules/googleapis-java/0.1.0/overlay/MODULE.bazel new file mode 120000 index 00000000000..9b599e3ad9c --- /dev/null +++ b/modules/googleapis-java/0.1.0/overlay/MODULE.bazel @@ -0,0 +1 @@ +../MODULE.bazel \ No newline at end of file diff --git a/modules/googleapis-java/0.1.0/presubmit.yml b/modules/googleapis-java/0.1.0/presubmit.yml new file mode 100644 index 00000000000..e69de29bb2d diff --git a/modules/googleapis-java/0.1.0/source.json b/modules/googleapis-java/0.1.0/source.json new file mode 100644 index 00000000000..5708b3223e4 --- /dev/null +++ b/modules/googleapis-java/0.1.0/source.json @@ -0,0 +1,7 @@ +{ + "integrity": "sha256-hznHbmgfkAkjuQDJ3w73XPQh05yrtUZQxLmtGbanbYU=", + "url": "https://github.com/fmeum/bazel-central-registry/releases/download/v1.0.0/empty.zip", + "overlay": { + "MODULE.bazel": "sha256-eU1okw/B5a/szrR9RY4J489YrHyiYkbZ3uSsxa7/i+4=" + } +} diff --git a/modules/googleapis-java/metadata.json b/modules/googleapis-java/metadata.json new file mode 100644 index 00000000000..ed2c966d2e4 --- /dev/null +++ b/modules/googleapis-java/metadata.json @@ -0,0 +1,16 @@ +{ + "homepage": "https://github.com/googleapis/googleapis", + "maintainers": [ + { + "email": "bcr-maintainers@bazel.build", + "name": "No Maintainer Specified" + } + ], + "repository": [ + "github:googleapis/googleapis" + ], + "versions": [ + "0.1.0" + ], + "yanked_versions": {} +} diff --git a/modules/googleapis-python/0.1.0/MODULE.bazel b/modules/googleapis-python/0.1.0/MODULE.bazel new file mode 100644 index 00000000000..5c67504f174 --- /dev/null +++ b/modules/googleapis-python/0.1.0/MODULE.bazel @@ -0,0 +1,14 @@ +module( + name = "googleapis-python", + version = "0.1.0", + bazel_compatibility = [">=7.2.1"], +) + +bazel_dep(name = "googleapis", version = "0.0.0-20241220-5e258e33") +bazel_dep(name = "protobuf", version = "27.0") + +switched_rules = use_extension("@googleapis//private/extensions:switched_rules.bzl", "switched_rules") +switched_rules.register( + name = "py_proto_library", + file = "@protobuf//bazel:py_proto_library.bzl", +) \ No newline at end of file diff --git a/modules/googleapis-python/0.1.0/overlay/MODULE.bazel b/modules/googleapis-python/0.1.0/overlay/MODULE.bazel new file mode 120000 index 00000000000..9b599e3ad9c --- /dev/null +++ b/modules/googleapis-python/0.1.0/overlay/MODULE.bazel @@ -0,0 +1 @@ +../MODULE.bazel \ No newline at end of file diff --git a/modules/googleapis-python/0.1.0/presubmit.yml b/modules/googleapis-python/0.1.0/presubmit.yml new file mode 100644 index 00000000000..e69de29bb2d diff --git a/modules/googleapis-python/0.1.0/source.json b/modules/googleapis-python/0.1.0/source.json new file mode 100644 index 00000000000..d22b767b3f1 --- /dev/null +++ b/modules/googleapis-python/0.1.0/source.json @@ -0,0 +1,7 @@ +{ + "integrity": "sha256-hznHbmgfkAkjuQDJ3w73XPQh05yrtUZQxLmtGbanbYU=", + "url": "https://github.com/fmeum/bazel-central-registry/releases/download/v1.0.0/empty.zip", + "overlay": { + "MODULE.bazel": "sha256-4Hlx29KheHuWdfrllIzz7aio1bHr7a2oe+VxNFPFoxM=" + } +} diff --git a/modules/googleapis-python/metadata.json b/modules/googleapis-python/metadata.json new file mode 100644 index 00000000000..ed2c966d2e4 --- /dev/null +++ b/modules/googleapis-python/metadata.json @@ -0,0 +1,16 @@ +{ + "homepage": "https://github.com/googleapis/googleapis", + "maintainers": [ + { + "email": "bcr-maintainers@bazel.build", + "name": "No Maintainer Specified" + } + ], + "repository": [ + "github:googleapis/googleapis" + ], + "versions": [ + "0.1.0" + ], + "yanked_versions": {} +} diff --git a/modules/googleapis/0.0.0-20241220-5e258e33/MODULE.bazel b/modules/googleapis/0.0.0-20241220-5e258e33/MODULE.bazel new file mode 100644 index 00000000000..86d00498605 --- /dev/null +++ b/modules/googleapis/0.0.0-20241220-5e258e33/MODULE.bazel @@ -0,0 +1,11 @@ +module( + name = "googleapis", + version = "0.0.0-20241220-5e258e33", + repo_name = "com_google_googleapis", + bazel_compatibility = [">=7.2.1"], +) + +bazel_dep(name = "rules_proto", version = "5.3.0-21.7") + +switched_rules = use_extension("//private/extensions:switched_rules.bzl", "switched_rules") +use_repo(switched_rules, "com_google_googleapis_imports") diff --git a/modules/googleapis/0.0.0-20241220-5e258e33/overlay/MODULE.bazel b/modules/googleapis/0.0.0-20241220-5e258e33/overlay/MODULE.bazel new file mode 120000 index 00000000000..9b599e3ad9c --- /dev/null +++ b/modules/googleapis/0.0.0-20241220-5e258e33/overlay/MODULE.bazel @@ -0,0 +1 @@ +../MODULE.bazel \ No newline at end of file diff --git a/modules/googleapis/0.0.0-20241220-5e258e33/overlay/extensions.bzl b/modules/googleapis/0.0.0-20241220-5e258e33/overlay/extensions.bzl new file mode 100644 index 00000000000..8097cc59058 --- /dev/null +++ b/modules/googleapis/0.0.0-20241220-5e258e33/overlay/extensions.bzl @@ -0,0 +1,30 @@ +_use_languages_tag = tag_class( + attrs = { + "cc": attr.bool(default = False), + "csharp": attr.bool(default = False), + "gapic": attr.bool(default = False), + "go": attr.bool(default = False), + "go_test": attr.bool(default = False), + "grpc": attr.bool(default = False), + "java": attr.bool(default = False), + "nodejs": attr.bool(default = False), + "php": attr.bool(default = False), + "python": attr.bool(default = False), + "ruby": attr.bool(default = False), + }, +) + +def _switched_rules_impl(_ctx): + fail(""" +The 'switched_rules' extension is no longer supported due to problems inherent to its design. +Instead, add 'bazel_dep(name = "googleapis-", version = "0.1.0")' to your MODULE.bazel file to use '_proto_library' targets in 'googleapis'. +To see error messages with the exact 'bazel_dep's to add, remove the 'switched_rules' usage and build your project. +The available individual modules can be found at https://registry.bazel.build/search?q=googleapis. +""") + +switched_rules = module_extension( + implementation = _switched_rules_impl, + tag_classes = { + "use_languages": _use_languages_tag, + }, +) diff --git a/modules/googleapis/0.0.0-20241220-5e258e33/overlay/private/extensions/BUILD.bazel b/modules/googleapis/0.0.0-20241220-5e258e33/overlay/private/extensions/BUILD.bazel new file mode 100644 index 00000000000..e69de29bb2d diff --git a/modules/googleapis/0.0.0-20241220-5e258e33/overlay/private/extensions/constants.bzl b/modules/googleapis/0.0.0-20241220-5e258e33/overlay/private/extensions/constants.bzl new file mode 100644 index 00000000000..649b8d65579 --- /dev/null +++ b/modules/googleapis/0.0.0-20241220-5e258e33/overlay/private/extensions/constants.bzl @@ -0,0 +1,44 @@ +# Maps rules used by googleapis to if the rule is registered by the googleapis- +# module or to None if the rule is not supported yet. +RULE_TO_FLAVOR = { + "cc_gapic_library": None, + "cc_grpc_library": None, + "cc_proto_library": "cc", + "csharp_gapic_assembly_pkg": None, + "csharp_gapic_library": None, + "csharp_grpc_library": None, + "csharp_proto_library": None, + "go_gapic_assembly_pkg": None, + "go_gapic_library": None, + "go_grpc_library": None, + "go_library": None, + "go_proto_library": "go", + "go_test": None, + "java_gapic_assembly_gradle_pkg": None, + "java_gapic_library": None, + "java_gapic_test": None, + "java_grpc_library": None, + "java_proto_library": "java", + "moved_proto_library": None, + "nodejs_gapic_assembly_pkg": None, + "nodejs_gapic_library": None, + "php_gapic_assembly_pkg": None, + "php_gapic_library": None, + "php_grpc_library": None, + "php_proto_library": None, + "proto_library_with_info": None, + "py_gapic_assembly_pkg": None, + "py_gapic_library": None, + "py_grpc_library": None, + "py_import": None, + "py_proto_library": "python", + "py_test": None, + "ruby_ads_gapic_library": None, + "ruby_cloud_gapic_library": None, + "ruby_gapic_assembly_pkg": None, + "ruby_grpc_library": None, + "ruby_proto_library": None, +} + +# The version of the googleapis- modules to recommend to users. +FLAVOR_VERSION = "0.1.0" diff --git a/modules/googleapis/0.0.0-20241220-5e258e33/overlay/private/extensions/fail_macro.bzl b/modules/googleapis/0.0.0-20241220-5e258e33/overlay/private/extensions/fail_macro.bzl new file mode 100644 index 00000000000..a09b18db1a7 --- /dev/null +++ b/modules/googleapis/0.0.0-20241220-5e258e33/overlay/private/extensions/fail_macro.bzl @@ -0,0 +1,12 @@ +def _fail_rule_impl(ctx): + fail(ctx.attr.message) + +_fail_rule = rule( + implementation = _fail_rule_impl, + attrs = { + "message": attr.string(), + }, +) + +def make_fail_macro(message): + return lambda name, **kwargs: _fail_rule(name = name, message = message) diff --git a/modules/googleapis/0.0.0-20241220-5e258e33/overlay/private/extensions/switched_rules.bzl b/modules/googleapis/0.0.0-20241220-5e258e33/overlay/private/extensions/switched_rules.bzl new file mode 100644 index 00000000000..2b287649506 --- /dev/null +++ b/modules/googleapis/0.0.0-20241220-5e258e33/overlay/private/extensions/switched_rules.bzl @@ -0,0 +1,107 @@ +load(":constants.bzl", "FLAVOR_VERSION", "RULE_TO_FLAVOR") + +def _imports_impl(repo_ctx): + loads = [ + """load("@com_google_googleapis//private/extensions:fail_macro.bzl", "make_fail_macro")""", + ] + assignments = [] + + for name, file in repo_ctx.attr.rules.items(): + if file: + loads.append("""load("{file}", _{name} = "{name}")""".format( + file = file, + name = name, + )) + assignments.append("""{name} = _{name}""".format( + name = name, + )) + else: + flavor = RULE_TO_FLAVOR[name] + if flavor: + message = """Add 'bazel_dep(name = "googleapis-{flavor}", version = "{flavor_version}")' to your MODULE.bazel file to use '{name}' targets in 'googleapis'.""".format( + flavor = flavor, + flavor_version = FLAVOR_VERSION, + name = name, + ) + else: + message = """'{name} targets in googleapis are not supported with Bzlmod. If you need them, please file an issue at https://github.com/bazelbuild/bazel-central-registry.""".format( + name = name, + ) + assignments.append("""{name} = make_fail_macro({message})""".format( + name = name, + message = repr(message), + )) + imports_content = "\n".join(loads + assignments) + + repo_ctx.file("BUILD.bazel") + repo_ctx.file("imports.bzl", imports_content) + +_imports = repository_rule( + implementation = _imports_impl, + attrs = { + # Maps a name to a file label in unambiguous form. + "rules": attr.string_dict(), + }, +) + +def _io_bazel_rules_go_grpc_forwarder_impl(repo_ctx): + content = "" + if repo_ctx.attr.go_grpc_label: + content = """\ +alias( + name = "go_grpc", + actual = "{go_grpc_label}", + visibility = ["//visibility:public"], +) +""".format(go_grpc_label = repo_ctx.attr.go_grpc_label) + repo_ctx.file("proto/BUILD.bazel", content) + +_io_bazel_rules_go_grpc_forwarder = repository_rule( + implementation = _io_bazel_rules_go_grpc_forwarder_impl, + attrs = { + "go_grpc_label": attr.string(), + } +) + +def _switched_rules_impl(module_ctx): + rules = {name: "" for name in RULE_TO_FLAVOR.keys()} + + for module in module_ctx.modules: + if module.name != "googleapis" and not module.name.startswith("googleapis-"): + fail("This extension is internal to googleapis and cannot be accessed from " + module.name) + for rule in module.tags.register: + if rule.name not in rules: + fail("Unknown rule: %s" % rule.name) + if rules[rule.name]: + fail("Rule %s already registered" % rule.name) + rules[rule.name] = str(rule.file) + + _imports( + name = "com_google_googleapis_imports", + rules = rules, + ) + + go_grpc_label = "" + go_proto_library_file = rules.get("go_proto_library") + if go_proto_library_file: + go_grpc_label = "@@{}//proto:go_grpc".format(Label(go_proto_library_file).workspace_name) + _io_bazel_rules_go_grpc_forwarder( + name = "io_bazel_rules_go", + go_grpc_label = go_grpc_label, + ) + + return module_ctx.extension_metadata(reproducible = True) + +_register = tag_class( + attrs = { + "name": attr.string(), + "file": attr.label(), + }, +) + +switched_rules = module_extension( + implementation = _switched_rules_impl, + tag_classes = { + "register": _register, + }, +) diff --git a/modules/googleapis/0.0.0-20241220-5e258e33/overlay/tests/bcr/.bazelrc b/modules/googleapis/0.0.0-20241220-5e258e33/overlay/tests/bcr/.bazelrc new file mode 100644 index 00000000000..e0b28aa3c76 --- /dev/null +++ b/modules/googleapis/0.0.0-20241220-5e258e33/overlay/tests/bcr/.bazelrc @@ -0,0 +1 @@ +common --java_runtime_version=remotejdk_11 diff --git a/modules/googleapis/0.0.0-20241220-5e258e33/overlay/tests/bcr/BUILD.bazel b/modules/googleapis/0.0.0-20241220-5e258e33/overlay/tests/bcr/BUILD.bazel new file mode 100644 index 00000000000..1d873e0737d --- /dev/null +++ b/modules/googleapis/0.0.0-20241220-5e258e33/overlay/tests/bcr/BUILD.bazel @@ -0,0 +1,21 @@ +load(":failure_test.bzl", "cc_proto_library_fails_with_message_test") + +alias( + name = "bytestream_proto", + actual = "@googleapis//google/bytestream:bytestream_proto", +) + +alias( + name = "bytestream_java_proto", + actual = "@googleapis//google/bytestream:bytestream_java_proto", +) + +alias( + name = "bytestream_go_proto", + actual = "@googleapis//google/bytestream:bytestream_go_proto", +) + +cc_proto_library_fails_with_message_test( + name = "bytestream_cc_proto_library_fails_with_message_test", + target_under_test = "@googleapis//google/bytestream:bytestream_cc_proto", +) diff --git a/modules/googleapis/0.0.0-20241220-5e258e33/overlay/tests/bcr/MODULE.bazel b/modules/googleapis/0.0.0-20241220-5e258e33/overlay/tests/bcr/MODULE.bazel new file mode 100644 index 00000000000..f6a3837d76e --- /dev/null +++ b/modules/googleapis/0.0.0-20241220-5e258e33/overlay/tests/bcr/MODULE.bazel @@ -0,0 +1,10 @@ +bazel_dep(name = "bazel_skylib", version = "1.7.1") +bazel_dep(name = "googleapis") +bazel_dep(name = "googleapis-go", version = "0.1.0") +bazel_dep(name = "googleapis-java", version = "0.1.0") +# Intentionally missing a dependency on googleapis-cc. + +local_path_override( + module_name = "googleapis", + path = "../..", +) diff --git a/modules/googleapis/0.0.0-20241220-5e258e33/overlay/tests/bcr/failure_test.bzl b/modules/googleapis/0.0.0-20241220-5e258e33/overlay/tests/bcr/failure_test.bzl new file mode 100644 index 00000000000..e7d91d35626 --- /dev/null +++ b/modules/googleapis/0.0.0-20241220-5e258e33/overlay/tests/bcr/failure_test.bzl @@ -0,0 +1,11 @@ +load("@bazel_skylib//lib:unittest.bzl", "analysistest", "asserts") + +def _cc_proto_library_fails_with_message_test_impl(ctx): + env = analysistest.begin(ctx) + asserts.expect_failure(env, """Add 'bazel_dep(name = "googleapis-cc", version = "0.1.0")' to your MODULE.bazel file to use 'cc_proto_library' targets in 'googleapis'.""") + return analysistest.end(env) + +cc_proto_library_fails_with_message_test = analysistest.make( + _cc_proto_library_fails_with_message_test_impl, + expect_failure = True, +) diff --git a/modules/googleapis/0.0.0-20241220-5e258e33/presubmit.yml b/modules/googleapis/0.0.0-20241220-5e258e33/presubmit.yml new file mode 100644 index 00000000000..1e90c1ebe53 --- /dev/null +++ b/modules/googleapis/0.0.0-20241220-5e258e33/presubmit.yml @@ -0,0 +1,12 @@ +bcr_test_module: + module_path: "tests/bcr" + matrix: + platform: ["debian10", "macos", "ubuntu2004", "windows"] + bazel: ["7.x", "8.x"] + tasks: + run_tests: + name: "Run test module" + bazel: ${{ bazel }} + platform: ${{ platform }} + test_targets: + - "//..." diff --git a/modules/googleapis/0.0.0-20241220-5e258e33/source.json b/modules/googleapis/0.0.0-20241220-5e258e33/source.json new file mode 100644 index 00000000000..5f6da3fbbde --- /dev/null +++ b/modules/googleapis/0.0.0-20241220-5e258e33/source.json @@ -0,0 +1,17 @@ +{ + "integrity": "sha256-ftfNAEA+XKYX5I+kRRNhXnnfyBert9Rgq1WQ6sJ0Pvk=", + "strip_prefix": "googleapis-5e258e334154da04dcd0a567a61ac21518cac81b", + "url": "https://github.com/googleapis/googleapis/archive/5e258e334154da04dcd0a567a61ac21518cac81b.tar.gz", + "overlay": { + "MODULE.bazel": "sha256-lVzD4D39NIo4T7No2TD/yFHIStnkbUxH7375B3q7yi4=", + "extensions.bzl": "sha256-jj4EKrYrYsALa4wi11LYl7yULEWhIDr3HyKNnL6LFUE=", + "private/extensions/BUILD.bazel": "sha256-47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=", + "private/extensions/constants.bzl": "sha256-wuxGDkdWcFNlRfcneliNMs8cArVs/Q3vvsxtwRdYBZA=", + "private/extensions/fail_macro.bzl": "sha256-Ux6k9i7qKn7Y0gT1LFnHZiTGuPid7m1p3PncsnK8/iU=", + "private/extensions/switched_rules.bzl": "sha256-LkAQ/CEVSLYhHb0k1Ym4uBRC0yf6NQugxPZjPZteXMg=", + "tests/bcr/.bazelrc": "sha256-R5NStkDbLtIGl0LFZ+A1deot1NjLK5J5sQS33rzcicc=", + "tests/bcr/BUILD.bazel": "sha256-OaYTbQXOcLHwR0Am3goLnjCwu3mK7fkfCQlZQvySh24=", + "tests/bcr/MODULE.bazel": "sha256-PvqkV0oO2SHSkDNVsvcFawocQcrwsVrjL/QiAZ6h+gM=", + "tests/bcr/failure_test.bzl": "sha256-QV38fwhaAPQStLQr06YGR1NDE/lsgnTs4cDjR/oDpl8=" + } +} diff --git a/modules/googleapis/metadata.json b/modules/googleapis/metadata.json index 49396c3abc7..073ab146c34 100644 --- a/modules/googleapis/metadata.json +++ b/modules/googleapis/metadata.json @@ -11,7 +11,8 @@ ], "versions": [ "0.0.0-20240326-1c8d509c5", - "0.0.0-20240819-fe8ba054a" + "0.0.0-20240819-fe8ba054a", + "0.0.0-20241220-5e258e33" ], "yanked_versions": {} } From b462bdad873af907f70b7930b7e897342b79cf02 Mon Sep 17 00:00:00 2001 From: Fabian Meumertzheim Date: Sat, 21 Dec 2024 13:42:28 +0100 Subject: [PATCH 02/11] Fix presubmit --- modules/googleapis-cc/0.1.0/presubmit.yml | 9 +++++++++ modules/googleapis-go/0.1.0/presubmit.yml | 9 +++++++++ modules/googleapis-java/0.1.0/presubmit.yml | 9 +++++++++ modules/googleapis-python/0.1.0/presubmit.yml | 9 +++++++++ modules/googleapis/0.0.0-20241220-5e258e33/MODULE.bazel | 2 +- modules/googleapis/0.0.0-20241220-5e258e33/presubmit.yml | 2 ++ modules/googleapis/0.0.0-20241220-5e258e33/source.json | 2 +- 7 files changed, 40 insertions(+), 2 deletions(-) diff --git a/modules/googleapis-cc/0.1.0/presubmit.yml b/modules/googleapis-cc/0.1.0/presubmit.yml index e69de29bb2d..fd9c465d89e 100644 --- a/modules/googleapis-cc/0.1.0/presubmit.yml +++ b/modules/googleapis-cc/0.1.0/presubmit.yml @@ -0,0 +1,9 @@ +tasks: + verify_targets: + name: Empty test + platform: ubuntu2404 + bazel: 8.x + build_flags: + - "--nobuild" + build_targets: + - "//..." diff --git a/modules/googleapis-go/0.1.0/presubmit.yml b/modules/googleapis-go/0.1.0/presubmit.yml index e69de29bb2d..fd9c465d89e 100644 --- a/modules/googleapis-go/0.1.0/presubmit.yml +++ b/modules/googleapis-go/0.1.0/presubmit.yml @@ -0,0 +1,9 @@ +tasks: + verify_targets: + name: Empty test + platform: ubuntu2404 + bazel: 8.x + build_flags: + - "--nobuild" + build_targets: + - "//..." diff --git a/modules/googleapis-java/0.1.0/presubmit.yml b/modules/googleapis-java/0.1.0/presubmit.yml index e69de29bb2d..fd9c465d89e 100644 --- a/modules/googleapis-java/0.1.0/presubmit.yml +++ b/modules/googleapis-java/0.1.0/presubmit.yml @@ -0,0 +1,9 @@ +tasks: + verify_targets: + name: Empty test + platform: ubuntu2404 + bazel: 8.x + build_flags: + - "--nobuild" + build_targets: + - "//..." diff --git a/modules/googleapis-python/0.1.0/presubmit.yml b/modules/googleapis-python/0.1.0/presubmit.yml index e69de29bb2d..fd9c465d89e 100644 --- a/modules/googleapis-python/0.1.0/presubmit.yml +++ b/modules/googleapis-python/0.1.0/presubmit.yml @@ -0,0 +1,9 @@ +tasks: + verify_targets: + name: Empty test + platform: ubuntu2404 + bazel: 8.x + build_flags: + - "--nobuild" + build_targets: + - "//..." diff --git a/modules/googleapis/0.0.0-20241220-5e258e33/MODULE.bazel b/modules/googleapis/0.0.0-20241220-5e258e33/MODULE.bazel index 86d00498605..5e962541753 100644 --- a/modules/googleapis/0.0.0-20241220-5e258e33/MODULE.bazel +++ b/modules/googleapis/0.0.0-20241220-5e258e33/MODULE.bazel @@ -8,4 +8,4 @@ module( bazel_dep(name = "rules_proto", version = "5.3.0-21.7") switched_rules = use_extension("//private/extensions:switched_rules.bzl", "switched_rules") -use_repo(switched_rules, "com_google_googleapis_imports") +use_repo(switched_rules, "com_google_googleapis_imports", "io_bazel_rules_go") diff --git a/modules/googleapis/0.0.0-20241220-5e258e33/presubmit.yml b/modules/googleapis/0.0.0-20241220-5e258e33/presubmit.yml index 1e90c1ebe53..4627dc581ad 100644 --- a/modules/googleapis/0.0.0-20241220-5e258e33/presubmit.yml +++ b/modules/googleapis/0.0.0-20241220-5e258e33/presubmit.yml @@ -8,5 +8,7 @@ bcr_test_module: name: "Run test module" bazel: ${{ bazel }} platform: ${{ platform }} + build_targets: + - "//..." test_targets: - "//..." diff --git a/modules/googleapis/0.0.0-20241220-5e258e33/source.json b/modules/googleapis/0.0.0-20241220-5e258e33/source.json index 5f6da3fbbde..d37e10a8dac 100644 --- a/modules/googleapis/0.0.0-20241220-5e258e33/source.json +++ b/modules/googleapis/0.0.0-20241220-5e258e33/source.json @@ -3,7 +3,7 @@ "strip_prefix": "googleapis-5e258e334154da04dcd0a567a61ac21518cac81b", "url": "https://github.com/googleapis/googleapis/archive/5e258e334154da04dcd0a567a61ac21518cac81b.tar.gz", "overlay": { - "MODULE.bazel": "sha256-lVzD4D39NIo4T7No2TD/yFHIStnkbUxH7375B3q7yi4=", + "MODULE.bazel": "sha256-MlXxZ/4UxwoscsQihmhKKGw1Cb6P0wAVqvQG56+1n1w=", "extensions.bzl": "sha256-jj4EKrYrYsALa4wi11LYl7yULEWhIDr3HyKNnL6LFUE=", "private/extensions/BUILD.bazel": "sha256-47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=", "private/extensions/constants.bzl": "sha256-wuxGDkdWcFNlRfcneliNMs8cArVs/Q3vvsxtwRdYBZA=", From 5c3f20b8492d893a309122d167c4eaa98edfcdf8 Mon Sep 17 00:00:00 2001 From: Fabian Meumertzheim Date: Sat, 21 Dec 2024 15:06:07 +0100 Subject: [PATCH 03/11] grpc-cc --- .../overlay/private/extensions/constants.bzl | 2 +- .../0.0.0-20241220-5e258e33/overlay/tests/bcr/.bazelrc | 4 ++++ .../0.0.0-20241220-5e258e33/overlay/tests/bcr/BUILD.bazel | 5 +++++ modules/googleapis/0.0.0-20241220-5e258e33/source.json | 6 +++--- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/modules/googleapis/0.0.0-20241220-5e258e33/overlay/private/extensions/constants.bzl b/modules/googleapis/0.0.0-20241220-5e258e33/overlay/private/extensions/constants.bzl index 649b8d65579..8107a7bda3e 100644 --- a/modules/googleapis/0.0.0-20241220-5e258e33/overlay/private/extensions/constants.bzl +++ b/modules/googleapis/0.0.0-20241220-5e258e33/overlay/private/extensions/constants.bzl @@ -2,7 +2,7 @@ # module or to None if the rule is not supported yet. RULE_TO_FLAVOR = { "cc_gapic_library": None, - "cc_grpc_library": None, + "cc_grpc_library": "grpc-cc", "cc_proto_library": "cc", "csharp_gapic_assembly_pkg": None, "csharp_gapic_library": None, diff --git a/modules/googleapis/0.0.0-20241220-5e258e33/overlay/tests/bcr/.bazelrc b/modules/googleapis/0.0.0-20241220-5e258e33/overlay/tests/bcr/.bazelrc index e0b28aa3c76..467f4958072 100644 --- a/modules/googleapis/0.0.0-20241220-5e258e33/overlay/tests/bcr/.bazelrc +++ b/modules/googleapis/0.0.0-20241220-5e258e33/overlay/tests/bcr/.bazelrc @@ -1 +1,5 @@ common --java_runtime_version=remotejdk_11 + +# Disable warnings for external dependencies. +common --per_file_copt=external/.*@-w +common --host_per_file_copt=external/.*@-w diff --git a/modules/googleapis/0.0.0-20241220-5e258e33/overlay/tests/bcr/BUILD.bazel b/modules/googleapis/0.0.0-20241220-5e258e33/overlay/tests/bcr/BUILD.bazel index 1d873e0737d..4399bef3983 100644 --- a/modules/googleapis/0.0.0-20241220-5e258e33/overlay/tests/bcr/BUILD.bazel +++ b/modules/googleapis/0.0.0-20241220-5e258e33/overlay/tests/bcr/BUILD.bazel @@ -15,6 +15,11 @@ alias( actual = "@googleapis//google/bytestream:bytestream_go_proto", ) +alias( + name = "spanner_cc_grpc", + actual = "@googleapis//google/spanner/v1:spanner_cc_grpc", +) + cc_proto_library_fails_with_message_test( name = "bytestream_cc_proto_library_fails_with_message_test", target_under_test = "@googleapis//google/bytestream:bytestream_cc_proto", diff --git a/modules/googleapis/0.0.0-20241220-5e258e33/source.json b/modules/googleapis/0.0.0-20241220-5e258e33/source.json index d37e10a8dac..3c5104607fa 100644 --- a/modules/googleapis/0.0.0-20241220-5e258e33/source.json +++ b/modules/googleapis/0.0.0-20241220-5e258e33/source.json @@ -6,11 +6,11 @@ "MODULE.bazel": "sha256-MlXxZ/4UxwoscsQihmhKKGw1Cb6P0wAVqvQG56+1n1w=", "extensions.bzl": "sha256-jj4EKrYrYsALa4wi11LYl7yULEWhIDr3HyKNnL6LFUE=", "private/extensions/BUILD.bazel": "sha256-47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=", - "private/extensions/constants.bzl": "sha256-wuxGDkdWcFNlRfcneliNMs8cArVs/Q3vvsxtwRdYBZA=", + "private/extensions/constants.bzl": "sha256-O+GJD3XKyq0NoXwTK9Dnocne2uWMB62LlUDPw0BjdWc=", "private/extensions/fail_macro.bzl": "sha256-Ux6k9i7qKn7Y0gT1LFnHZiTGuPid7m1p3PncsnK8/iU=", "private/extensions/switched_rules.bzl": "sha256-LkAQ/CEVSLYhHb0k1Ym4uBRC0yf6NQugxPZjPZteXMg=", - "tests/bcr/.bazelrc": "sha256-R5NStkDbLtIGl0LFZ+A1deot1NjLK5J5sQS33rzcicc=", - "tests/bcr/BUILD.bazel": "sha256-OaYTbQXOcLHwR0Am3goLnjCwu3mK7fkfCQlZQvySh24=", + "tests/bcr/.bazelrc": "sha256-hFZT+gits3VtXcUkKuh3NCEC9FgBNGuNxaOVCuOiFPk=", + "tests/bcr/BUILD.bazel": "sha256-w0YhOe+5oJ32nvhp4TdbNJqVPSoRRztTKmyFv1mbqTc=", "tests/bcr/MODULE.bazel": "sha256-PvqkV0oO2SHSkDNVsvcFawocQcrwsVrjL/QiAZ6h+gM=", "tests/bcr/failure_test.bzl": "sha256-QV38fwhaAPQStLQr06YGR1NDE/lsgnTs4cDjR/oDpl8=" } From e6dda6f80b8e76ee1a5aa6a0fdff1d2cfd8a87e8 Mon Sep 17 00:00:00 2001 From: Fabian Meumertzheim Date: Sat, 21 Dec 2024 15:11:58 +0100 Subject: [PATCH 04/11] Add grpc-java --- modules/googleapis-grpc-cc/0.1.0/MODULE.bazel | 14 ++++++++++++++ .../0.1.0/overlay/MODULE.bazel | 1 + modules/googleapis-grpc-cc/0.1.0/presubmit.yml | 9 +++++++++ modules/googleapis-grpc-cc/0.1.0/source.json | 7 +++++++ modules/googleapis-grpc-cc/metadata.json | 16 ++++++++++++++++ modules/googleapis-grpc-java/0.1.0/MODULE.bazel | 14 ++++++++++++++ .../0.1.0/overlay/MODULE.bazel | 1 + modules/googleapis-grpc-java/0.1.0/presubmit.yml | 9 +++++++++ modules/googleapis-grpc-java/0.1.0/source.json | 7 +++++++ modules/googleapis-grpc-java/metadata.json | 16 ++++++++++++++++ .../overlay/private/extensions/constants.bzl | 2 +- .../overlay/tests/bcr/BUILD.bazel | 5 +++++ .../0.0.0-20241220-5e258e33/source.json | 4 ++-- 13 files changed, 102 insertions(+), 3 deletions(-) create mode 100644 modules/googleapis-grpc-cc/0.1.0/MODULE.bazel create mode 120000 modules/googleapis-grpc-cc/0.1.0/overlay/MODULE.bazel create mode 100644 modules/googleapis-grpc-cc/0.1.0/presubmit.yml create mode 100644 modules/googleapis-grpc-cc/0.1.0/source.json create mode 100644 modules/googleapis-grpc-cc/metadata.json create mode 100644 modules/googleapis-grpc-java/0.1.0/MODULE.bazel create mode 120000 modules/googleapis-grpc-java/0.1.0/overlay/MODULE.bazel create mode 100644 modules/googleapis-grpc-java/0.1.0/presubmit.yml create mode 100644 modules/googleapis-grpc-java/0.1.0/source.json create mode 100644 modules/googleapis-grpc-java/metadata.json diff --git a/modules/googleapis-grpc-cc/0.1.0/MODULE.bazel b/modules/googleapis-grpc-cc/0.1.0/MODULE.bazel new file mode 100644 index 00000000000..843ebe94398 --- /dev/null +++ b/modules/googleapis-grpc-cc/0.1.0/MODULE.bazel @@ -0,0 +1,14 @@ +module( + name = "googleapis-grpc-cc", + version = "0.1.0", + bazel_compatibility = [">=7.2.1"], +) + +bazel_dep(name = "googleapis", version = "0.0.0-20241220-5e258e33") +bazel_dep(name = "grpc", version = "1.66.0.bcr.2") + +switched_rules = use_extension("@googleapis//private/extensions:switched_rules.bzl", "switched_rules") +switched_rules.register( + name = "cc_grpc_library", + file = "@grpc//bazel:cc_grpc_library.bzl", +) diff --git a/modules/googleapis-grpc-cc/0.1.0/overlay/MODULE.bazel b/modules/googleapis-grpc-cc/0.1.0/overlay/MODULE.bazel new file mode 120000 index 00000000000..9b599e3ad9c --- /dev/null +++ b/modules/googleapis-grpc-cc/0.1.0/overlay/MODULE.bazel @@ -0,0 +1 @@ +../MODULE.bazel \ No newline at end of file diff --git a/modules/googleapis-grpc-cc/0.1.0/presubmit.yml b/modules/googleapis-grpc-cc/0.1.0/presubmit.yml new file mode 100644 index 00000000000..fd9c465d89e --- /dev/null +++ b/modules/googleapis-grpc-cc/0.1.0/presubmit.yml @@ -0,0 +1,9 @@ +tasks: + verify_targets: + name: Empty test + platform: ubuntu2404 + bazel: 8.x + build_flags: + - "--nobuild" + build_targets: + - "//..." diff --git a/modules/googleapis-grpc-cc/0.1.0/source.json b/modules/googleapis-grpc-cc/0.1.0/source.json new file mode 100644 index 00000000000..2434195e9a9 --- /dev/null +++ b/modules/googleapis-grpc-cc/0.1.0/source.json @@ -0,0 +1,7 @@ +{ + "integrity": "sha256-hznHbmgfkAkjuQDJ3w73XPQh05yrtUZQxLmtGbanbYU=", + "url": "https://github.com/fmeum/bazel-central-registry/releases/download/v1.0.0/empty.zip", + "overlay": { + "MODULE.bazel": "sha256-+6YcOMfETtd1CUAzcxFHtQvJtllgUrx5kWElgP6gYOs=" + } +} diff --git a/modules/googleapis-grpc-cc/metadata.json b/modules/googleapis-grpc-cc/metadata.json new file mode 100644 index 00000000000..ed2c966d2e4 --- /dev/null +++ b/modules/googleapis-grpc-cc/metadata.json @@ -0,0 +1,16 @@ +{ + "homepage": "https://github.com/googleapis/googleapis", + "maintainers": [ + { + "email": "bcr-maintainers@bazel.build", + "name": "No Maintainer Specified" + } + ], + "repository": [ + "github:googleapis/googleapis" + ], + "versions": [ + "0.1.0" + ], + "yanked_versions": {} +} diff --git a/modules/googleapis-grpc-java/0.1.0/MODULE.bazel b/modules/googleapis-grpc-java/0.1.0/MODULE.bazel new file mode 100644 index 00000000000..ece91188c61 --- /dev/null +++ b/modules/googleapis-grpc-java/0.1.0/MODULE.bazel @@ -0,0 +1,14 @@ +module( + name = "googleapis-grpc-java", + version = "0.1.0", + bazel_compatibility = [">=7.2.1"], +) + +bazel_dep(name = "googleapis", version = "0.0.0-20241220-5e258e33") +bazel_dep(name = "grpc-java", version = "1.66.0") + +switched_rules = use_extension("@googleapis//private/extensions:switched_rules.bzl", "switched_rules") +switched_rules.register( + name = "java_grpc_library", + file = "@grpc-java//:java_grpc_library.bzl", +) diff --git a/modules/googleapis-grpc-java/0.1.0/overlay/MODULE.bazel b/modules/googleapis-grpc-java/0.1.0/overlay/MODULE.bazel new file mode 120000 index 00000000000..9b599e3ad9c --- /dev/null +++ b/modules/googleapis-grpc-java/0.1.0/overlay/MODULE.bazel @@ -0,0 +1 @@ +../MODULE.bazel \ No newline at end of file diff --git a/modules/googleapis-grpc-java/0.1.0/presubmit.yml b/modules/googleapis-grpc-java/0.1.0/presubmit.yml new file mode 100644 index 00000000000..fd9c465d89e --- /dev/null +++ b/modules/googleapis-grpc-java/0.1.0/presubmit.yml @@ -0,0 +1,9 @@ +tasks: + verify_targets: + name: Empty test + platform: ubuntu2404 + bazel: 8.x + build_flags: + - "--nobuild" + build_targets: + - "//..." diff --git a/modules/googleapis-grpc-java/0.1.0/source.json b/modules/googleapis-grpc-java/0.1.0/source.json new file mode 100644 index 00000000000..e70553d611f --- /dev/null +++ b/modules/googleapis-grpc-java/0.1.0/source.json @@ -0,0 +1,7 @@ +{ + "integrity": "sha256-hznHbmgfkAkjuQDJ3w73XPQh05yrtUZQxLmtGbanbYU=", + "url": "https://github.com/fmeum/bazel-central-registry/releases/download/v1.0.0/empty.zip", + "overlay": { + "MODULE.bazel": "sha256-6OS1YB5nWgVsNnucanTpPJ9n+eF2Xy2VS/sJF53lIs0=" + } +} diff --git a/modules/googleapis-grpc-java/metadata.json b/modules/googleapis-grpc-java/metadata.json new file mode 100644 index 00000000000..ed2c966d2e4 --- /dev/null +++ b/modules/googleapis-grpc-java/metadata.json @@ -0,0 +1,16 @@ +{ + "homepage": "https://github.com/googleapis/googleapis", + "maintainers": [ + { + "email": "bcr-maintainers@bazel.build", + "name": "No Maintainer Specified" + } + ], + "repository": [ + "github:googleapis/googleapis" + ], + "versions": [ + "0.1.0" + ], + "yanked_versions": {} +} diff --git a/modules/googleapis/0.0.0-20241220-5e258e33/overlay/private/extensions/constants.bzl b/modules/googleapis/0.0.0-20241220-5e258e33/overlay/private/extensions/constants.bzl index 8107a7bda3e..ebdbcd9f33b 100644 --- a/modules/googleapis/0.0.0-20241220-5e258e33/overlay/private/extensions/constants.bzl +++ b/modules/googleapis/0.0.0-20241220-5e258e33/overlay/private/extensions/constants.bzl @@ -17,7 +17,7 @@ RULE_TO_FLAVOR = { "java_gapic_assembly_gradle_pkg": None, "java_gapic_library": None, "java_gapic_test": None, - "java_grpc_library": None, + "java_grpc_library": "grpc-java", "java_proto_library": "java", "moved_proto_library": None, "nodejs_gapic_assembly_pkg": None, diff --git a/modules/googleapis/0.0.0-20241220-5e258e33/overlay/tests/bcr/BUILD.bazel b/modules/googleapis/0.0.0-20241220-5e258e33/overlay/tests/bcr/BUILD.bazel index 4399bef3983..fa2181b756c 100644 --- a/modules/googleapis/0.0.0-20241220-5e258e33/overlay/tests/bcr/BUILD.bazel +++ b/modules/googleapis/0.0.0-20241220-5e258e33/overlay/tests/bcr/BUILD.bazel @@ -20,6 +20,11 @@ alias( actual = "@googleapis//google/spanner/v1:spanner_cc_grpc", ) +alias( + name = "spanner_java_grpc", + actual = "@googleapis//google/spanner/v1:spanner_java_grpc", +) + cc_proto_library_fails_with_message_test( name = "bytestream_cc_proto_library_fails_with_message_test", target_under_test = "@googleapis//google/bytestream:bytestream_cc_proto", diff --git a/modules/googleapis/0.0.0-20241220-5e258e33/source.json b/modules/googleapis/0.0.0-20241220-5e258e33/source.json index 3c5104607fa..893e28bc2ef 100644 --- a/modules/googleapis/0.0.0-20241220-5e258e33/source.json +++ b/modules/googleapis/0.0.0-20241220-5e258e33/source.json @@ -6,11 +6,11 @@ "MODULE.bazel": "sha256-MlXxZ/4UxwoscsQihmhKKGw1Cb6P0wAVqvQG56+1n1w=", "extensions.bzl": "sha256-jj4EKrYrYsALa4wi11LYl7yULEWhIDr3HyKNnL6LFUE=", "private/extensions/BUILD.bazel": "sha256-47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=", - "private/extensions/constants.bzl": "sha256-O+GJD3XKyq0NoXwTK9Dnocne2uWMB62LlUDPw0BjdWc=", + "private/extensions/constants.bzl": "sha256-Lr2u+OnTl5Y+9HUTLM4CQai8ohnBf9AoVAOv5JERgZs=", "private/extensions/fail_macro.bzl": "sha256-Ux6k9i7qKn7Y0gT1LFnHZiTGuPid7m1p3PncsnK8/iU=", "private/extensions/switched_rules.bzl": "sha256-LkAQ/CEVSLYhHb0k1Ym4uBRC0yf6NQugxPZjPZteXMg=", "tests/bcr/.bazelrc": "sha256-hFZT+gits3VtXcUkKuh3NCEC9FgBNGuNxaOVCuOiFPk=", - "tests/bcr/BUILD.bazel": "sha256-w0YhOe+5oJ32nvhp4TdbNJqVPSoRRztTKmyFv1mbqTc=", + "tests/bcr/BUILD.bazel": "sha256-s/s6ZF/2oc55YwhZRyry99R/FUV8Z43lOata3M8a7yQ=", "tests/bcr/MODULE.bazel": "sha256-PvqkV0oO2SHSkDNVsvcFawocQcrwsVrjL/QiAZ6h+gM=", "tests/bcr/failure_test.bzl": "sha256-QV38fwhaAPQStLQr06YGR1NDE/lsgnTs4cDjR/oDpl8=" } From 5b924da754f9ae3160fb479b085e4cf1aca2bc86 Mon Sep 17 00:00:00 2001 From: Fabian Meumertzheim Date: Sat, 21 Dec 2024 15:13:34 +0100 Subject: [PATCH 05/11] Reformat module files --- modules/googleapis-cc/0.1.0/MODULE.bazel | 2 +- modules/googleapis-cc/0.1.0/source.json | 2 +- modules/googleapis-go/0.1.0/MODULE.bazel | 2 +- modules/googleapis-go/0.1.0/source.json | 2 +- modules/googleapis-java/0.1.0/MODULE.bazel | 2 +- modules/googleapis-java/0.1.0/source.json | 2 +- modules/googleapis-python/0.1.0/MODULE.bazel | 2 +- modules/googleapis-python/0.1.0/source.json | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/modules/googleapis-cc/0.1.0/MODULE.bazel b/modules/googleapis-cc/0.1.0/MODULE.bazel index 92d0cc953c3..fb50172c499 100644 --- a/modules/googleapis-cc/0.1.0/MODULE.bazel +++ b/modules/googleapis-cc/0.1.0/MODULE.bazel @@ -11,4 +11,4 @@ switched_rules = use_extension("@googleapis//private/extensions:switched_rules.b switched_rules.register( name = "cc_proto_library", file = "@protobuf//bazel:cc_proto_library.bzl", -) \ No newline at end of file +) diff --git a/modules/googleapis-cc/0.1.0/source.json b/modules/googleapis-cc/0.1.0/source.json index 5e70383c24c..9ac5bc2fe2b 100644 --- a/modules/googleapis-cc/0.1.0/source.json +++ b/modules/googleapis-cc/0.1.0/source.json @@ -2,6 +2,6 @@ "integrity": "sha256-hznHbmgfkAkjuQDJ3w73XPQh05yrtUZQxLmtGbanbYU=", "url": "https://github.com/fmeum/bazel-central-registry/releases/download/v1.0.0/empty.zip", "overlay": { - "MODULE.bazel": "sha256-4GPXxlFen3Atai6EyboC87iGAPuNSpfBBmwnMQbayqc=" + "MODULE.bazel": "sha256-0t8JSjSK94lSCfY8NkTpv+I+/akmQIiNWGxmJE3grHQ=" } } diff --git a/modules/googleapis-go/0.1.0/MODULE.bazel b/modules/googleapis-go/0.1.0/MODULE.bazel index b8988bf0ae7..8b253022c66 100644 --- a/modules/googleapis-go/0.1.0/MODULE.bazel +++ b/modules/googleapis-go/0.1.0/MODULE.bazel @@ -11,4 +11,4 @@ switched_rules = use_extension("@googleapis//private/extensions:switched_rules.b switched_rules.register( name = "go_proto_library", file = "@rules_go//proto:def.bzl", -) \ No newline at end of file +) diff --git a/modules/googleapis-go/0.1.0/source.json b/modules/googleapis-go/0.1.0/source.json index 44d8e89b4c9..2364a475472 100644 --- a/modules/googleapis-go/0.1.0/source.json +++ b/modules/googleapis-go/0.1.0/source.json @@ -2,6 +2,6 @@ "integrity": "sha256-hznHbmgfkAkjuQDJ3w73XPQh05yrtUZQxLmtGbanbYU=", "url": "https://github.com/fmeum/bazel-central-registry/releases/download/v1.0.0/empty.zip", "overlay": { - "MODULE.bazel": "sha256-GUjZBV62PY/o9joplOGrL6pIIASpyqWnhns27+JUCts=" + "MODULE.bazel": "sha256-5BkG4nNFeIILQLDDXpVPuSJ2NACAspxl8CTjxkveT1o=" } } diff --git a/modules/googleapis-java/0.1.0/MODULE.bazel b/modules/googleapis-java/0.1.0/MODULE.bazel index fc2ed3e3f91..e47b2f73e1e 100644 --- a/modules/googleapis-java/0.1.0/MODULE.bazel +++ b/modules/googleapis-java/0.1.0/MODULE.bazel @@ -11,4 +11,4 @@ switched_rules = use_extension("@googleapis//private/extensions:switched_rules.b switched_rules.register( name = "java_proto_library", file = "@protobuf//bazel:java_proto_library.bzl", -) \ No newline at end of file +) diff --git a/modules/googleapis-java/0.1.0/source.json b/modules/googleapis-java/0.1.0/source.json index 5708b3223e4..83296b6e758 100644 --- a/modules/googleapis-java/0.1.0/source.json +++ b/modules/googleapis-java/0.1.0/source.json @@ -2,6 +2,6 @@ "integrity": "sha256-hznHbmgfkAkjuQDJ3w73XPQh05yrtUZQxLmtGbanbYU=", "url": "https://github.com/fmeum/bazel-central-registry/releases/download/v1.0.0/empty.zip", "overlay": { - "MODULE.bazel": "sha256-eU1okw/B5a/szrR9RY4J489YrHyiYkbZ3uSsxa7/i+4=" + "MODULE.bazel": "sha256-LCZExIuJd49TLk0a5I0dGzF0nOSIBSyQhvPOrIaV7+4=" } } diff --git a/modules/googleapis-python/0.1.0/MODULE.bazel b/modules/googleapis-python/0.1.0/MODULE.bazel index 5c67504f174..1654e6cc188 100644 --- a/modules/googleapis-python/0.1.0/MODULE.bazel +++ b/modules/googleapis-python/0.1.0/MODULE.bazel @@ -11,4 +11,4 @@ switched_rules = use_extension("@googleapis//private/extensions:switched_rules.b switched_rules.register( name = "py_proto_library", file = "@protobuf//bazel:py_proto_library.bzl", -) \ No newline at end of file +) diff --git a/modules/googleapis-python/0.1.0/source.json b/modules/googleapis-python/0.1.0/source.json index d22b767b3f1..57dff17c1f2 100644 --- a/modules/googleapis-python/0.1.0/source.json +++ b/modules/googleapis-python/0.1.0/source.json @@ -2,6 +2,6 @@ "integrity": "sha256-hznHbmgfkAkjuQDJ3w73XPQh05yrtUZQxLmtGbanbYU=", "url": "https://github.com/fmeum/bazel-central-registry/releases/download/v1.0.0/empty.zip", "overlay": { - "MODULE.bazel": "sha256-4Hlx29KheHuWdfrllIzz7aio1bHr7a2oe+VxNFPFoxM=" + "MODULE.bazel": "sha256-fC+GNs2HlOkSgVnPLlwrnh2Y+ueI5YlwQRC4c8lcej0=" } } From 88117608d03e334ae236f0a8f9a6a4557077de9a Mon Sep 17 00:00:00 2001 From: Fabian Meumertzheim Date: Sat, 21 Dec 2024 15:16:08 +0100 Subject: [PATCH 06/11] Fix test module --- .../0.0.0-20241220-5e258e33/overlay/tests/bcr/BUILD.bazel | 5 +++++ .../0.0.0-20241220-5e258e33/overlay/tests/bcr/MODULE.bazel | 5 ++++- modules/googleapis/0.0.0-20241220-5e258e33/source.json | 4 ++-- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/modules/googleapis/0.0.0-20241220-5e258e33/overlay/tests/bcr/BUILD.bazel b/modules/googleapis/0.0.0-20241220-5e258e33/overlay/tests/bcr/BUILD.bazel index fa2181b756c..89154afab3d 100644 --- a/modules/googleapis/0.0.0-20241220-5e258e33/overlay/tests/bcr/BUILD.bazel +++ b/modules/googleapis/0.0.0-20241220-5e258e33/overlay/tests/bcr/BUILD.bazel @@ -15,6 +15,11 @@ alias( actual = "@googleapis//google/bytestream:bytestream_go_proto", ) +alias( + name = "date_py_proto", + actual = "@googleapis//google/type:date_py_proto", +) + alias( name = "spanner_cc_grpc", actual = "@googleapis//google/spanner/v1:spanner_cc_grpc", diff --git a/modules/googleapis/0.0.0-20241220-5e258e33/overlay/tests/bcr/MODULE.bazel b/modules/googleapis/0.0.0-20241220-5e258e33/overlay/tests/bcr/MODULE.bazel index f6a3837d76e..f4b2509fd25 100644 --- a/modules/googleapis/0.0.0-20241220-5e258e33/overlay/tests/bcr/MODULE.bazel +++ b/modules/googleapis/0.0.0-20241220-5e258e33/overlay/tests/bcr/MODULE.bazel @@ -2,7 +2,10 @@ bazel_dep(name = "bazel_skylib", version = "1.7.1") bazel_dep(name = "googleapis") bazel_dep(name = "googleapis-go", version = "0.1.0") bazel_dep(name = "googleapis-java", version = "0.1.0") -# Intentionally missing a dependency on googleapis-cc. +bazel_dep(name = "googleapis-python", version = "0.1.0") +bazel_dep(name = "googleapis-grpc-cc", version = "0.1.0") +bazel_dep(name = "googleapis-grpc-java", version = "0.1.0") +# Intentionally missing a dependency on googleapis-cc to test that it doesn't result in an error. local_path_override( module_name = "googleapis", diff --git a/modules/googleapis/0.0.0-20241220-5e258e33/source.json b/modules/googleapis/0.0.0-20241220-5e258e33/source.json index 893e28bc2ef..63556ca21d8 100644 --- a/modules/googleapis/0.0.0-20241220-5e258e33/source.json +++ b/modules/googleapis/0.0.0-20241220-5e258e33/source.json @@ -10,8 +10,8 @@ "private/extensions/fail_macro.bzl": "sha256-Ux6k9i7qKn7Y0gT1LFnHZiTGuPid7m1p3PncsnK8/iU=", "private/extensions/switched_rules.bzl": "sha256-LkAQ/CEVSLYhHb0k1Ym4uBRC0yf6NQugxPZjPZteXMg=", "tests/bcr/.bazelrc": "sha256-hFZT+gits3VtXcUkKuh3NCEC9FgBNGuNxaOVCuOiFPk=", - "tests/bcr/BUILD.bazel": "sha256-s/s6ZF/2oc55YwhZRyry99R/FUV8Z43lOata3M8a7yQ=", - "tests/bcr/MODULE.bazel": "sha256-PvqkV0oO2SHSkDNVsvcFawocQcrwsVrjL/QiAZ6h+gM=", + "tests/bcr/BUILD.bazel": "sha256-SyxDBwLmV0c2ssGUSaHawNu8IDOXSGL/YaWsI4pnSbk=", + "tests/bcr/MODULE.bazel": "sha256-mBed9uTWcQM8aMMq9vOzprfoj6kmef5xj/Xl7PiDE6M=", "tests/bcr/failure_test.bzl": "sha256-QV38fwhaAPQStLQr06YGR1NDE/lsgnTs4cDjR/oDpl8=" } } From a4afc2b3c05dec3451539b576cd7f274e4220bb9 Mon Sep 17 00:00:00 2001 From: Fabian Meumertzheim Date: Sat, 21 Dec 2024 15:43:44 +0100 Subject: [PATCH 07/11] Drop googleapis-grpc-cc --- modules/googleapis-grpc-cc/0.1.0/MODULE.bazel | 14 -------------- .../0.1.0/overlay/MODULE.bazel | 1 - modules/googleapis-grpc-cc/0.1.0/presubmit.yml | 9 --------- modules/googleapis-grpc-cc/0.1.0/source.json | 7 ------- modules/googleapis-grpc-cc/metadata.json | 16 ---------------- .../overlay/private/extensions/constants.bzl | 2 +- .../overlay/tests/bcr/BUILD.bazel | 5 ----- .../overlay/tests/bcr/MODULE.bazel | 1 - .../0.0.0-20241220-5e258e33/source.json | 6 +++--- 9 files changed, 4 insertions(+), 57 deletions(-) delete mode 100644 modules/googleapis-grpc-cc/0.1.0/MODULE.bazel delete mode 120000 modules/googleapis-grpc-cc/0.1.0/overlay/MODULE.bazel delete mode 100644 modules/googleapis-grpc-cc/0.1.0/presubmit.yml delete mode 100644 modules/googleapis-grpc-cc/0.1.0/source.json delete mode 100644 modules/googleapis-grpc-cc/metadata.json diff --git a/modules/googleapis-grpc-cc/0.1.0/MODULE.bazel b/modules/googleapis-grpc-cc/0.1.0/MODULE.bazel deleted file mode 100644 index 843ebe94398..00000000000 --- a/modules/googleapis-grpc-cc/0.1.0/MODULE.bazel +++ /dev/null @@ -1,14 +0,0 @@ -module( - name = "googleapis-grpc-cc", - version = "0.1.0", - bazel_compatibility = [">=7.2.1"], -) - -bazel_dep(name = "googleapis", version = "0.0.0-20241220-5e258e33") -bazel_dep(name = "grpc", version = "1.66.0.bcr.2") - -switched_rules = use_extension("@googleapis//private/extensions:switched_rules.bzl", "switched_rules") -switched_rules.register( - name = "cc_grpc_library", - file = "@grpc//bazel:cc_grpc_library.bzl", -) diff --git a/modules/googleapis-grpc-cc/0.1.0/overlay/MODULE.bazel b/modules/googleapis-grpc-cc/0.1.0/overlay/MODULE.bazel deleted file mode 120000 index 9b599e3ad9c..00000000000 --- a/modules/googleapis-grpc-cc/0.1.0/overlay/MODULE.bazel +++ /dev/null @@ -1 +0,0 @@ -../MODULE.bazel \ No newline at end of file diff --git a/modules/googleapis-grpc-cc/0.1.0/presubmit.yml b/modules/googleapis-grpc-cc/0.1.0/presubmit.yml deleted file mode 100644 index fd9c465d89e..00000000000 --- a/modules/googleapis-grpc-cc/0.1.0/presubmit.yml +++ /dev/null @@ -1,9 +0,0 @@ -tasks: - verify_targets: - name: Empty test - platform: ubuntu2404 - bazel: 8.x - build_flags: - - "--nobuild" - build_targets: - - "//..." diff --git a/modules/googleapis-grpc-cc/0.1.0/source.json b/modules/googleapis-grpc-cc/0.1.0/source.json deleted file mode 100644 index 2434195e9a9..00000000000 --- a/modules/googleapis-grpc-cc/0.1.0/source.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "integrity": "sha256-hznHbmgfkAkjuQDJ3w73XPQh05yrtUZQxLmtGbanbYU=", - "url": "https://github.com/fmeum/bazel-central-registry/releases/download/v1.0.0/empty.zip", - "overlay": { - "MODULE.bazel": "sha256-+6YcOMfETtd1CUAzcxFHtQvJtllgUrx5kWElgP6gYOs=" - } -} diff --git a/modules/googleapis-grpc-cc/metadata.json b/modules/googleapis-grpc-cc/metadata.json deleted file mode 100644 index ed2c966d2e4..00000000000 --- a/modules/googleapis-grpc-cc/metadata.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "homepage": "https://github.com/googleapis/googleapis", - "maintainers": [ - { - "email": "bcr-maintainers@bazel.build", - "name": "No Maintainer Specified" - } - ], - "repository": [ - "github:googleapis/googleapis" - ], - "versions": [ - "0.1.0" - ], - "yanked_versions": {} -} diff --git a/modules/googleapis/0.0.0-20241220-5e258e33/overlay/private/extensions/constants.bzl b/modules/googleapis/0.0.0-20241220-5e258e33/overlay/private/extensions/constants.bzl index ebdbcd9f33b..ab36f3009bc 100644 --- a/modules/googleapis/0.0.0-20241220-5e258e33/overlay/private/extensions/constants.bzl +++ b/modules/googleapis/0.0.0-20241220-5e258e33/overlay/private/extensions/constants.bzl @@ -2,7 +2,7 @@ # module or to None if the rule is not supported yet. RULE_TO_FLAVOR = { "cc_gapic_library": None, - "cc_grpc_library": "grpc-cc", + "cc_grpc_library": None, "cc_proto_library": "cc", "csharp_gapic_assembly_pkg": None, "csharp_gapic_library": None, diff --git a/modules/googleapis/0.0.0-20241220-5e258e33/overlay/tests/bcr/BUILD.bazel b/modules/googleapis/0.0.0-20241220-5e258e33/overlay/tests/bcr/BUILD.bazel index 89154afab3d..09ff5f8c34e 100644 --- a/modules/googleapis/0.0.0-20241220-5e258e33/overlay/tests/bcr/BUILD.bazel +++ b/modules/googleapis/0.0.0-20241220-5e258e33/overlay/tests/bcr/BUILD.bazel @@ -20,11 +20,6 @@ alias( actual = "@googleapis//google/type:date_py_proto", ) -alias( - name = "spanner_cc_grpc", - actual = "@googleapis//google/spanner/v1:spanner_cc_grpc", -) - alias( name = "spanner_java_grpc", actual = "@googleapis//google/spanner/v1:spanner_java_grpc", diff --git a/modules/googleapis/0.0.0-20241220-5e258e33/overlay/tests/bcr/MODULE.bazel b/modules/googleapis/0.0.0-20241220-5e258e33/overlay/tests/bcr/MODULE.bazel index f4b2509fd25..dc220ff798b 100644 --- a/modules/googleapis/0.0.0-20241220-5e258e33/overlay/tests/bcr/MODULE.bazel +++ b/modules/googleapis/0.0.0-20241220-5e258e33/overlay/tests/bcr/MODULE.bazel @@ -3,7 +3,6 @@ bazel_dep(name = "googleapis") bazel_dep(name = "googleapis-go", version = "0.1.0") bazel_dep(name = "googleapis-java", version = "0.1.0") bazel_dep(name = "googleapis-python", version = "0.1.0") -bazel_dep(name = "googleapis-grpc-cc", version = "0.1.0") bazel_dep(name = "googleapis-grpc-java", version = "0.1.0") # Intentionally missing a dependency on googleapis-cc to test that it doesn't result in an error. diff --git a/modules/googleapis/0.0.0-20241220-5e258e33/source.json b/modules/googleapis/0.0.0-20241220-5e258e33/source.json index 63556ca21d8..77f207a62ca 100644 --- a/modules/googleapis/0.0.0-20241220-5e258e33/source.json +++ b/modules/googleapis/0.0.0-20241220-5e258e33/source.json @@ -6,12 +6,12 @@ "MODULE.bazel": "sha256-MlXxZ/4UxwoscsQihmhKKGw1Cb6P0wAVqvQG56+1n1w=", "extensions.bzl": "sha256-jj4EKrYrYsALa4wi11LYl7yULEWhIDr3HyKNnL6LFUE=", "private/extensions/BUILD.bazel": "sha256-47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=", - "private/extensions/constants.bzl": "sha256-Lr2u+OnTl5Y+9HUTLM4CQai8ohnBf9AoVAOv5JERgZs=", + "private/extensions/constants.bzl": "sha256-CtBb2ekQdEatYN0pd6l0Aakn8zRN6Ty2CAgzohNx4KI=", "private/extensions/fail_macro.bzl": "sha256-Ux6k9i7qKn7Y0gT1LFnHZiTGuPid7m1p3PncsnK8/iU=", "private/extensions/switched_rules.bzl": "sha256-LkAQ/CEVSLYhHb0k1Ym4uBRC0yf6NQugxPZjPZteXMg=", "tests/bcr/.bazelrc": "sha256-hFZT+gits3VtXcUkKuh3NCEC9FgBNGuNxaOVCuOiFPk=", - "tests/bcr/BUILD.bazel": "sha256-SyxDBwLmV0c2ssGUSaHawNu8IDOXSGL/YaWsI4pnSbk=", - "tests/bcr/MODULE.bazel": "sha256-mBed9uTWcQM8aMMq9vOzprfoj6kmef5xj/Xl7PiDE6M=", + "tests/bcr/BUILD.bazel": "sha256-V70eP/KkZPjN+Zu//fkuZmvg0IhUvzSMR2Iis3whacc=", + "tests/bcr/MODULE.bazel": "sha256-4s8xj9npqDzhJXi6BfQYDLhDoXwZ9cdFD4khXRvqWzs=", "tests/bcr/failure_test.bzl": "sha256-QV38fwhaAPQStLQr06YGR1NDE/lsgnTs4cDjR/oDpl8=" } } From f94e84dff9448533a7526f61d2c1d96f5119a943 Mon Sep 17 00:00:00 2001 From: Fabian Meumertzheim Date: Sat, 21 Dec 2024 16:03:15 +0100 Subject: [PATCH 08/11] Add protobuf dep --- modules/googleapis/0.0.0-20241220-5e258e33/MODULE.bazel | 1 + modules/googleapis/0.0.0-20241220-5e258e33/source.json | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/googleapis/0.0.0-20241220-5e258e33/MODULE.bazel b/modules/googleapis/0.0.0-20241220-5e258e33/MODULE.bazel index 5e962541753..29ab535276d 100644 --- a/modules/googleapis/0.0.0-20241220-5e258e33/MODULE.bazel +++ b/modules/googleapis/0.0.0-20241220-5e258e33/MODULE.bazel @@ -5,6 +5,7 @@ module( bazel_compatibility = [">=7.2.1"], ) +bazel_dep(name = "protobuf", version = "21.7", repo_name = "com_google_protobuf") bazel_dep(name = "rules_proto", version = "5.3.0-21.7") switched_rules = use_extension("//private/extensions:switched_rules.bzl", "switched_rules") diff --git a/modules/googleapis/0.0.0-20241220-5e258e33/source.json b/modules/googleapis/0.0.0-20241220-5e258e33/source.json index 77f207a62ca..74f47a21397 100644 --- a/modules/googleapis/0.0.0-20241220-5e258e33/source.json +++ b/modules/googleapis/0.0.0-20241220-5e258e33/source.json @@ -3,7 +3,7 @@ "strip_prefix": "googleapis-5e258e334154da04dcd0a567a61ac21518cac81b", "url": "https://github.com/googleapis/googleapis/archive/5e258e334154da04dcd0a567a61ac21518cac81b.tar.gz", "overlay": { - "MODULE.bazel": "sha256-MlXxZ/4UxwoscsQihmhKKGw1Cb6P0wAVqvQG56+1n1w=", + "MODULE.bazel": "sha256-p6zH/gAEnFto82U3NsmKX96nkCRe3slSZIr+NF1XZns=", "extensions.bzl": "sha256-jj4EKrYrYsALa4wi11LYl7yULEWhIDr3HyKNnL6LFUE=", "private/extensions/BUILD.bazel": "sha256-47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=", "private/extensions/constants.bzl": "sha256-CtBb2ekQdEatYN0pd6l0Aakn8zRN6Ty2CAgzohNx4KI=", From 58b5e5f753bb87db60c0f0d67928c0a18aee4af6 Mon Sep 17 00:00:00 2001 From: Fabian Meumertzheim Date: Sat, 21 Dec 2024 16:55:08 +0100 Subject: [PATCH 09/11] Add comments --- modules/googleapis/0.0.0-20241220-5e258e33/MODULE.bazel | 9 ++++++++- .../overlay/private/extensions/constants.bzl | 2 +- .../overlay/private/extensions/switched_rules.bzl | 2 ++ modules/googleapis/0.0.0-20241220-5e258e33/source.json | 6 +++--- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/modules/googleapis/0.0.0-20241220-5e258e33/MODULE.bazel b/modules/googleapis/0.0.0-20241220-5e258e33/MODULE.bazel index 29ab535276d..8840d2e901f 100644 --- a/modules/googleapis/0.0.0-20241220-5e258e33/MODULE.bazel +++ b/modules/googleapis/0.0.0-20241220-5e258e33/MODULE.bazel @@ -5,8 +5,15 @@ module( bazel_compatibility = [">=7.2.1"], ) +# Only needed for well-known protos. bazel_dep(name = "protobuf", version = "21.7", repo_name = "com_google_protobuf") + +# Only needed for proto_library. bazel_dep(name = "rules_proto", version = "5.3.0-21.7") switched_rules = use_extension("//private/extensions:switched_rules.bzl", "switched_rules") -use_repo(switched_rules, "com_google_googleapis_imports", "io_bazel_rules_go") +use_repo( + switched_rules, + "com_google_googleapis_imports", + "io_bazel_rules_go", +) diff --git a/modules/googleapis/0.0.0-20241220-5e258e33/overlay/private/extensions/constants.bzl b/modules/googleapis/0.0.0-20241220-5e258e33/overlay/private/extensions/constants.bzl index ab36f3009bc..13414d6aa1a 100644 --- a/modules/googleapis/0.0.0-20241220-5e258e33/overlay/private/extensions/constants.bzl +++ b/modules/googleapis/0.0.0-20241220-5e258e33/overlay/private/extensions/constants.bzl @@ -1,5 +1,5 @@ # Maps rules used by googleapis to if the rule is registered by the googleapis- -# module or to None if the rule is not supported yet. +# module or to None if the rule is not supported yet (some may never be). RULE_TO_FLAVOR = { "cc_gapic_library": None, "cc_grpc_library": None, diff --git a/modules/googleapis/0.0.0-20241220-5e258e33/overlay/private/extensions/switched_rules.bzl b/modules/googleapis/0.0.0-20241220-5e258e33/overlay/private/extensions/switched_rules.bzl index 2b287649506..391b6d32b62 100644 --- a/modules/googleapis/0.0.0-20241220-5e258e33/overlay/private/extensions/switched_rules.bzl +++ b/modules/googleapis/0.0.0-20241220-5e258e33/overlay/private/extensions/switched_rules.bzl @@ -44,6 +44,8 @@ _imports = repository_rule( }, ) +# This hack is needed due to direct references to @io_bazel_rules_go//proto:go_grpc in build files. +# Create an alias repo that resembles rules_go and forwards the go_grpc target to the actual target. def _io_bazel_rules_go_grpc_forwarder_impl(repo_ctx): content = "" if repo_ctx.attr.go_grpc_label: diff --git a/modules/googleapis/0.0.0-20241220-5e258e33/source.json b/modules/googleapis/0.0.0-20241220-5e258e33/source.json index 74f47a21397..6eed6b5ca0d 100644 --- a/modules/googleapis/0.0.0-20241220-5e258e33/source.json +++ b/modules/googleapis/0.0.0-20241220-5e258e33/source.json @@ -3,12 +3,12 @@ "strip_prefix": "googleapis-5e258e334154da04dcd0a567a61ac21518cac81b", "url": "https://github.com/googleapis/googleapis/archive/5e258e334154da04dcd0a567a61ac21518cac81b.tar.gz", "overlay": { - "MODULE.bazel": "sha256-p6zH/gAEnFto82U3NsmKX96nkCRe3slSZIr+NF1XZns=", + "MODULE.bazel": "sha256-/97gfXIGhSSjv7u/d+olSG9KWHwPsG7H8kj7NWXXqvE=", "extensions.bzl": "sha256-jj4EKrYrYsALa4wi11LYl7yULEWhIDr3HyKNnL6LFUE=", "private/extensions/BUILD.bazel": "sha256-47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=", - "private/extensions/constants.bzl": "sha256-CtBb2ekQdEatYN0pd6l0Aakn8zRN6Ty2CAgzohNx4KI=", + "private/extensions/constants.bzl": "sha256-N3+45VEQ9zVopqZw5BwDstYukv9pILF29K4Mu9zdpH8=", "private/extensions/fail_macro.bzl": "sha256-Ux6k9i7qKn7Y0gT1LFnHZiTGuPid7m1p3PncsnK8/iU=", - "private/extensions/switched_rules.bzl": "sha256-LkAQ/CEVSLYhHb0k1Ym4uBRC0yf6NQugxPZjPZteXMg=", + "private/extensions/switched_rules.bzl": "sha256-v8KqUuRupCid/jMiny6J/qYgbP2uRORrnC9rIWOwCTE=", "tests/bcr/.bazelrc": "sha256-hFZT+gits3VtXcUkKuh3NCEC9FgBNGuNxaOVCuOiFPk=", "tests/bcr/BUILD.bazel": "sha256-V70eP/KkZPjN+Zu//fkuZmvg0IhUvzSMR2Iis3whacc=", "tests/bcr/MODULE.bazel": "sha256-4s8xj9npqDzhJXi6BfQYDLhDoXwZ9cdFD4khXRvqWzs=", From f7339607d2faef0fa59589efa0ddc49080423d2b Mon Sep 17 00:00:00 2001 From: Fabian Meumertzheim Date: Wed, 25 Dec 2024 21:41:31 +0100 Subject: [PATCH 10/11] Add googleapis-grpc-cc --- modules/googleapis-grpc-cc/0.1.0/MODULE.bazel | 14 ++++++++++++++ .../0.1.0/overlay/MODULE.bazel | 1 + modules/googleapis-grpc-cc/0.1.0/presubmit.yml | 9 +++++++++ modules/googleapis-grpc-cc/0.1.0/source.json | 7 +++++++ modules/googleapis-grpc-cc/metadata.json | 16 ++++++++++++++++ .../overlay/private/extensions/constants.bzl | 2 +- .../overlay/tests/bcr/BUILD.bazel | 5 +++++ .../overlay/tests/bcr/MODULE.bazel | 1 + .../0.0.0-20241220-5e258e33/source.json | 6 +++--- 9 files changed, 57 insertions(+), 4 deletions(-) create mode 100644 modules/googleapis-grpc-cc/0.1.0/MODULE.bazel create mode 120000 modules/googleapis-grpc-cc/0.1.0/overlay/MODULE.bazel create mode 100644 modules/googleapis-grpc-cc/0.1.0/presubmit.yml create mode 100644 modules/googleapis-grpc-cc/0.1.0/source.json create mode 100644 modules/googleapis-grpc-cc/metadata.json diff --git a/modules/googleapis-grpc-cc/0.1.0/MODULE.bazel b/modules/googleapis-grpc-cc/0.1.0/MODULE.bazel new file mode 100644 index 00000000000..25e1d9d0cff --- /dev/null +++ b/modules/googleapis-grpc-cc/0.1.0/MODULE.bazel @@ -0,0 +1,14 @@ +module( + name = "googleapis-grpc-cc", + version = "0.1.0", + bazel_compatibility = [">=7.2.1"], +) + +bazel_dep(name = "googleapis", version = "0.0.0-20241220-5e258e33") +bazel_dep(name = "grpc", version = "1.69.0") + +switched_rules = use_extension("@googleapis//private/extensions:switched_rules.bzl", "switched_rules") +switched_rules.register( + name = "cc_grpc_library", + file = "@grpc//bazel:cc_grpc_library.bzl", +) diff --git a/modules/googleapis-grpc-cc/0.1.0/overlay/MODULE.bazel b/modules/googleapis-grpc-cc/0.1.0/overlay/MODULE.bazel new file mode 120000 index 00000000000..9b599e3ad9c --- /dev/null +++ b/modules/googleapis-grpc-cc/0.1.0/overlay/MODULE.bazel @@ -0,0 +1 @@ +../MODULE.bazel \ No newline at end of file diff --git a/modules/googleapis-grpc-cc/0.1.0/presubmit.yml b/modules/googleapis-grpc-cc/0.1.0/presubmit.yml new file mode 100644 index 00000000000..fd9c465d89e --- /dev/null +++ b/modules/googleapis-grpc-cc/0.1.0/presubmit.yml @@ -0,0 +1,9 @@ +tasks: + verify_targets: + name: Empty test + platform: ubuntu2404 + bazel: 8.x + build_flags: + - "--nobuild" + build_targets: + - "//..." diff --git a/modules/googleapis-grpc-cc/0.1.0/source.json b/modules/googleapis-grpc-cc/0.1.0/source.json new file mode 100644 index 00000000000..990aadb893c --- /dev/null +++ b/modules/googleapis-grpc-cc/0.1.0/source.json @@ -0,0 +1,7 @@ +{ + "integrity": "sha256-hznHbmgfkAkjuQDJ3w73XPQh05yrtUZQxLmtGbanbYU=", + "url": "https://github.com/fmeum/bazel-central-registry/releases/download/v1.0.0/empty.zip", + "overlay": { + "MODULE.bazel": "sha256-OtTzO+YModGNxMzZm53YuAcqKpIRv92mY0g/xFb4Wdc=" + } +} diff --git a/modules/googleapis-grpc-cc/metadata.json b/modules/googleapis-grpc-cc/metadata.json new file mode 100644 index 00000000000..ed2c966d2e4 --- /dev/null +++ b/modules/googleapis-grpc-cc/metadata.json @@ -0,0 +1,16 @@ +{ + "homepage": "https://github.com/googleapis/googleapis", + "maintainers": [ + { + "email": "bcr-maintainers@bazel.build", + "name": "No Maintainer Specified" + } + ], + "repository": [ + "github:googleapis/googleapis" + ], + "versions": [ + "0.1.0" + ], + "yanked_versions": {} +} diff --git a/modules/googleapis/0.0.0-20241220-5e258e33/overlay/private/extensions/constants.bzl b/modules/googleapis/0.0.0-20241220-5e258e33/overlay/private/extensions/constants.bzl index 13414d6aa1a..4a03504c650 100644 --- a/modules/googleapis/0.0.0-20241220-5e258e33/overlay/private/extensions/constants.bzl +++ b/modules/googleapis/0.0.0-20241220-5e258e33/overlay/private/extensions/constants.bzl @@ -2,7 +2,7 @@ # module or to None if the rule is not supported yet (some may never be). RULE_TO_FLAVOR = { "cc_gapic_library": None, - "cc_grpc_library": None, + "cc_grpc_library": "grpc-cc", "cc_proto_library": "cc", "csharp_gapic_assembly_pkg": None, "csharp_gapic_library": None, diff --git a/modules/googleapis/0.0.0-20241220-5e258e33/overlay/tests/bcr/BUILD.bazel b/modules/googleapis/0.0.0-20241220-5e258e33/overlay/tests/bcr/BUILD.bazel index 09ff5f8c34e..89154afab3d 100644 --- a/modules/googleapis/0.0.0-20241220-5e258e33/overlay/tests/bcr/BUILD.bazel +++ b/modules/googleapis/0.0.0-20241220-5e258e33/overlay/tests/bcr/BUILD.bazel @@ -20,6 +20,11 @@ alias( actual = "@googleapis//google/type:date_py_proto", ) +alias( + name = "spanner_cc_grpc", + actual = "@googleapis//google/spanner/v1:spanner_cc_grpc", +) + alias( name = "spanner_java_grpc", actual = "@googleapis//google/spanner/v1:spanner_java_grpc", diff --git a/modules/googleapis/0.0.0-20241220-5e258e33/overlay/tests/bcr/MODULE.bazel b/modules/googleapis/0.0.0-20241220-5e258e33/overlay/tests/bcr/MODULE.bazel index dc220ff798b..f4b2509fd25 100644 --- a/modules/googleapis/0.0.0-20241220-5e258e33/overlay/tests/bcr/MODULE.bazel +++ b/modules/googleapis/0.0.0-20241220-5e258e33/overlay/tests/bcr/MODULE.bazel @@ -3,6 +3,7 @@ bazel_dep(name = "googleapis") bazel_dep(name = "googleapis-go", version = "0.1.0") bazel_dep(name = "googleapis-java", version = "0.1.0") bazel_dep(name = "googleapis-python", version = "0.1.0") +bazel_dep(name = "googleapis-grpc-cc", version = "0.1.0") bazel_dep(name = "googleapis-grpc-java", version = "0.1.0") # Intentionally missing a dependency on googleapis-cc to test that it doesn't result in an error. diff --git a/modules/googleapis/0.0.0-20241220-5e258e33/source.json b/modules/googleapis/0.0.0-20241220-5e258e33/source.json index 6eed6b5ca0d..def444c1358 100644 --- a/modules/googleapis/0.0.0-20241220-5e258e33/source.json +++ b/modules/googleapis/0.0.0-20241220-5e258e33/source.json @@ -6,12 +6,12 @@ "MODULE.bazel": "sha256-/97gfXIGhSSjv7u/d+olSG9KWHwPsG7H8kj7NWXXqvE=", "extensions.bzl": "sha256-jj4EKrYrYsALa4wi11LYl7yULEWhIDr3HyKNnL6LFUE=", "private/extensions/BUILD.bazel": "sha256-47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=", - "private/extensions/constants.bzl": "sha256-N3+45VEQ9zVopqZw5BwDstYukv9pILF29K4Mu9zdpH8=", + "private/extensions/constants.bzl": "sha256-q9cZgKLI4NYkskvNEJT29H4y7FN2Dfzz7Z9TVElozbk=", "private/extensions/fail_macro.bzl": "sha256-Ux6k9i7qKn7Y0gT1LFnHZiTGuPid7m1p3PncsnK8/iU=", "private/extensions/switched_rules.bzl": "sha256-v8KqUuRupCid/jMiny6J/qYgbP2uRORrnC9rIWOwCTE=", "tests/bcr/.bazelrc": "sha256-hFZT+gits3VtXcUkKuh3NCEC9FgBNGuNxaOVCuOiFPk=", - "tests/bcr/BUILD.bazel": "sha256-V70eP/KkZPjN+Zu//fkuZmvg0IhUvzSMR2Iis3whacc=", - "tests/bcr/MODULE.bazel": "sha256-4s8xj9npqDzhJXi6BfQYDLhDoXwZ9cdFD4khXRvqWzs=", + "tests/bcr/BUILD.bazel": "sha256-SyxDBwLmV0c2ssGUSaHawNu8IDOXSGL/YaWsI4pnSbk=", + "tests/bcr/MODULE.bazel": "sha256-mBed9uTWcQM8aMMq9vOzprfoj6kmef5xj/Xl7PiDE6M=", "tests/bcr/failure_test.bzl": "sha256-QV38fwhaAPQStLQr06YGR1NDE/lsgnTs4cDjR/oDpl8=" } } From 0398bd8a80484e0dfc59a2eacf74616ebfc36eb3 Mon Sep 17 00:00:00 2001 From: Fabian Meumertzheim Date: Wed, 25 Dec 2024 21:48:25 +0100 Subject: [PATCH 11/11] Test with all deps --- modules/googleapis-grpc-cc/0.1.0/MODULE.bazel | 1 + modules/googleapis-grpc-cc/0.1.0/source.json | 2 +- modules/googleapis-grpc-java/0.1.0/MODULE.bazel | 1 + modules/googleapis-grpc-java/0.1.0/source.json | 2 +- .../overlay/tests/bcr/BUILD.bazel | 17 +++++++++++------ .../overlay/tests/bcr/MODULE.bazel | 2 +- .../overlay/tests/bcr/failure_test.bzl | 8 ++++---- .../0.0.0-20241220-5e258e33/source.json | 6 +++--- 8 files changed, 23 insertions(+), 16 deletions(-) diff --git a/modules/googleapis-grpc-cc/0.1.0/MODULE.bazel b/modules/googleapis-grpc-cc/0.1.0/MODULE.bazel index 25e1d9d0cff..5496eb1c367 100644 --- a/modules/googleapis-grpc-cc/0.1.0/MODULE.bazel +++ b/modules/googleapis-grpc-cc/0.1.0/MODULE.bazel @@ -5,6 +5,7 @@ module( ) bazel_dep(name = "googleapis", version = "0.0.0-20241220-5e258e33") +bazel_dep(name = "googleapis-cc", version = "0.1.0") bazel_dep(name = "grpc", version = "1.69.0") switched_rules = use_extension("@googleapis//private/extensions:switched_rules.bzl", "switched_rules") diff --git a/modules/googleapis-grpc-cc/0.1.0/source.json b/modules/googleapis-grpc-cc/0.1.0/source.json index 990aadb893c..f7cd08ea9e9 100644 --- a/modules/googleapis-grpc-cc/0.1.0/source.json +++ b/modules/googleapis-grpc-cc/0.1.0/source.json @@ -2,6 +2,6 @@ "integrity": "sha256-hznHbmgfkAkjuQDJ3w73XPQh05yrtUZQxLmtGbanbYU=", "url": "https://github.com/fmeum/bazel-central-registry/releases/download/v1.0.0/empty.zip", "overlay": { - "MODULE.bazel": "sha256-OtTzO+YModGNxMzZm53YuAcqKpIRv92mY0g/xFb4Wdc=" + "MODULE.bazel": "sha256-1ZTbiLjlnPN92Io8vy6Bac58gc46ZCaPItM1FTahlU8=" } } diff --git a/modules/googleapis-grpc-java/0.1.0/MODULE.bazel b/modules/googleapis-grpc-java/0.1.0/MODULE.bazel index ece91188c61..be205e932cf 100644 --- a/modules/googleapis-grpc-java/0.1.0/MODULE.bazel +++ b/modules/googleapis-grpc-java/0.1.0/MODULE.bazel @@ -5,6 +5,7 @@ module( ) bazel_dep(name = "googleapis", version = "0.0.0-20241220-5e258e33") +bazel_dep(name = "googleapis-java", version = "0.1.0") bazel_dep(name = "grpc-java", version = "1.66.0") switched_rules = use_extension("@googleapis//private/extensions:switched_rules.bzl", "switched_rules") diff --git a/modules/googleapis-grpc-java/0.1.0/source.json b/modules/googleapis-grpc-java/0.1.0/source.json index e70553d611f..d1b55326188 100644 --- a/modules/googleapis-grpc-java/0.1.0/source.json +++ b/modules/googleapis-grpc-java/0.1.0/source.json @@ -2,6 +2,6 @@ "integrity": "sha256-hznHbmgfkAkjuQDJ3w73XPQh05yrtUZQxLmtGbanbYU=", "url": "https://github.com/fmeum/bazel-central-registry/releases/download/v1.0.0/empty.zip", "overlay": { - "MODULE.bazel": "sha256-6OS1YB5nWgVsNnucanTpPJ9n+eF2Xy2VS/sJF53lIs0=" + "MODULE.bazel": "sha256-Jt7vfm3iIYxTxHAzqYzdbQ/gaJbfvK1trB6cb+1trNQ=" } } diff --git a/modules/googleapis/0.0.0-20241220-5e258e33/overlay/tests/bcr/BUILD.bazel b/modules/googleapis/0.0.0-20241220-5e258e33/overlay/tests/bcr/BUILD.bazel index 89154afab3d..e8adedeab5c 100644 --- a/modules/googleapis/0.0.0-20241220-5e258e33/overlay/tests/bcr/BUILD.bazel +++ b/modules/googleapis/0.0.0-20241220-5e258e33/overlay/tests/bcr/BUILD.bazel @@ -1,4 +1,4 @@ -load(":failure_test.bzl", "cc_proto_library_fails_with_message_test") +load(":failure_test.bzl", "php_proto_library_fails_with_message_test") alias( name = "bytestream_proto", @@ -6,8 +6,8 @@ alias( ) alias( - name = "bytestream_java_proto", - actual = "@googleapis//google/bytestream:bytestream_java_proto", + name = "bytestream_cc_proto", + actual = "@googleapis//google/bytestream:bytestream_cc_proto", ) alias( @@ -15,6 +15,11 @@ alias( actual = "@googleapis//google/bytestream:bytestream_go_proto", ) +alias( + name = "bytestream_java_proto", + actual = "@googleapis//google/bytestream:bytestream_java_proto", +) + alias( name = "date_py_proto", actual = "@googleapis//google/type:date_py_proto", @@ -30,7 +35,7 @@ alias( actual = "@googleapis//google/spanner/v1:spanner_java_grpc", ) -cc_proto_library_fails_with_message_test( - name = "bytestream_cc_proto_library_fails_with_message_test", - target_under_test = "@googleapis//google/bytestream:bytestream_cc_proto", +php_proto_library_fails_with_message_test( + name = "php_proto_library_fails_with_message_test", + target_under_test = "@googleapis//google/bytestream:bytestream_php_proto", ) diff --git a/modules/googleapis/0.0.0-20241220-5e258e33/overlay/tests/bcr/MODULE.bazel b/modules/googleapis/0.0.0-20241220-5e258e33/overlay/tests/bcr/MODULE.bazel index f4b2509fd25..7d610805eb1 100644 --- a/modules/googleapis/0.0.0-20241220-5e258e33/overlay/tests/bcr/MODULE.bazel +++ b/modules/googleapis/0.0.0-20241220-5e258e33/overlay/tests/bcr/MODULE.bazel @@ -1,11 +1,11 @@ bazel_dep(name = "bazel_skylib", version = "1.7.1") bazel_dep(name = "googleapis") +bazel_dep(name = "googleapis-cc", version = "0.1.0") bazel_dep(name = "googleapis-go", version = "0.1.0") bazel_dep(name = "googleapis-java", version = "0.1.0") bazel_dep(name = "googleapis-python", version = "0.1.0") bazel_dep(name = "googleapis-grpc-cc", version = "0.1.0") bazel_dep(name = "googleapis-grpc-java", version = "0.1.0") -# Intentionally missing a dependency on googleapis-cc to test that it doesn't result in an error. local_path_override( module_name = "googleapis", diff --git a/modules/googleapis/0.0.0-20241220-5e258e33/overlay/tests/bcr/failure_test.bzl b/modules/googleapis/0.0.0-20241220-5e258e33/overlay/tests/bcr/failure_test.bzl index e7d91d35626..772c3747ed7 100644 --- a/modules/googleapis/0.0.0-20241220-5e258e33/overlay/tests/bcr/failure_test.bzl +++ b/modules/googleapis/0.0.0-20241220-5e258e33/overlay/tests/bcr/failure_test.bzl @@ -1,11 +1,11 @@ load("@bazel_skylib//lib:unittest.bzl", "analysistest", "asserts") -def _cc_proto_library_fails_with_message_test_impl(ctx): +def _php_proto_library_fails_with_message_test_impl(ctx): env = analysistest.begin(ctx) - asserts.expect_failure(env, """Add 'bazel_dep(name = "googleapis-cc", version = "0.1.0")' to your MODULE.bazel file to use 'cc_proto_library' targets in 'googleapis'.""") + 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.""") return analysistest.end(env) -cc_proto_library_fails_with_message_test = analysistest.make( - _cc_proto_library_fails_with_message_test_impl, +php_proto_library_fails_with_message_test = analysistest.make( + _php_proto_library_fails_with_message_test_impl, expect_failure = True, ) diff --git a/modules/googleapis/0.0.0-20241220-5e258e33/source.json b/modules/googleapis/0.0.0-20241220-5e258e33/source.json index def444c1358..3aa12c0cb78 100644 --- a/modules/googleapis/0.0.0-20241220-5e258e33/source.json +++ b/modules/googleapis/0.0.0-20241220-5e258e33/source.json @@ -10,8 +10,8 @@ "private/extensions/fail_macro.bzl": "sha256-Ux6k9i7qKn7Y0gT1LFnHZiTGuPid7m1p3PncsnK8/iU=", "private/extensions/switched_rules.bzl": "sha256-v8KqUuRupCid/jMiny6J/qYgbP2uRORrnC9rIWOwCTE=", "tests/bcr/.bazelrc": "sha256-hFZT+gits3VtXcUkKuh3NCEC9FgBNGuNxaOVCuOiFPk=", - "tests/bcr/BUILD.bazel": "sha256-SyxDBwLmV0c2ssGUSaHawNu8IDOXSGL/YaWsI4pnSbk=", - "tests/bcr/MODULE.bazel": "sha256-mBed9uTWcQM8aMMq9vOzprfoj6kmef5xj/Xl7PiDE6M=", - "tests/bcr/failure_test.bzl": "sha256-QV38fwhaAPQStLQr06YGR1NDE/lsgnTs4cDjR/oDpl8=" + "tests/bcr/BUILD.bazel": "sha256-KZzDURLUNDOiMsurUHrnuWYogHPFs7W+Ar9ZrilPLuE=", + "tests/bcr/MODULE.bazel": "sha256-9jtnEIcXJpG7TmZll5BFHSm3Mpq3TA8bq4nei7K1M3w=", + "tests/bcr/failure_test.bzl": "sha256-pKImfWiY7m3EB1w0n4C66/LABDBwTYr/2nqxoC+gvBc=" } }