Skip to content
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions modules/envoy_api/0.0.0-20251105-4a2b9a3/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
module(
name = "envoy_api",
version = "0.0.0-20251105-4a2b9a3",
)

bazel_dep(name = "abseil-cpp", version = "20250814.1", repo_name = "com_google_absl")
bazel_dep(name = "bazel_skylib", version = "1.8.1")
bazel_dep(name = "gazelle", version = "0.46.0", repo_name = "bazel_gazelle")
bazel_dep(name = "googleapis", version = "0.0.0-20251003-2193a2bf", repo_name = "com_google_googleapis")
bazel_dep(name = "googletest", version = "1.17.0", repo_name = "com_google_googletest")
bazel_dep(name = "grpc", version = "1.74.1", repo_name = "com_github_grpc_grpc")
bazel_dep(name = "opencensus-proto", version = "0.4.1.bcr.2", repo_name = "opencensus_proto")
bazel_dep(name = "opentelemetry-proto", version = "1.5.0", repo_name = "opentelemetry_proto")
bazel_dep(name = "protobuf", version = "33.0", repo_name = "com_google_protobuf")
bazel_dep(name = "protoc-gen-validate", version = "1.2.1.bcr.2", repo_name = "com_envoyproxy_protoc_gen_validate")
bazel_dep(name = "re2", version = "2024-07-02.bcr.1", repo_name = "com_googlesource_code_re2")
bazel_dep(name = "rules_go", version = "0.58.3", repo_name = "io_bazel_rules_go")
bazel_dep(name = "rules_proto", version = "7.1.0")
bazel_dep(name = "rules_python", version = "1.6.0")
bazel_dep(name = "rules_cc", version = "0.2.13")
bazel_dep(name = "xds", version = "0.0.0-20240423-555b57e", repo_name = "com_github_cncf_xds")

# Bump google_benchmark to avoid rules_foreign_cc
bazel_dep(name = "google_benchmark", version = "1.9.4")

non_module_deps = use_extension("//bazel:repositories.bzl", "non_module_deps")
use_repo(
non_module_deps,
"prometheus_metrics_model",
)

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

go_deps = use_extension("@bazel_gazelle//:extensions.bzl", "go_deps")
go_deps.module(
path = "github.com/planetscale/vtprotobuf",
sum = "h1:GFCKgmp0tecUJ0sJuv4pzYCqS9+RGSn52M3FUwPs+uo=",
version = "v0.6.1-0.20240319094008-0393e58bdf10",
)
go_deps.module(
path = "google.golang.org/protobuf",
sum = "h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8=",
version = "v1.31.0",
)
go_deps.module(
path = "google.golang.org/genproto/googleapis/rpc",
sum = "h1:Elxv5MwEkCI9f5SkoL6afed6NTdxaGoAo39eANBwHL8=",
version = "v0.0.0-20240521202816-d264139d666e",
)
go_deps.module(
path = "google.golang.org/genproto/googleapis/api",
sum = "h1:SkdGTrROJl2jRGT/Fxv5QUf9jtdKCQh4KQJXbXVLAi0=",
version = "v0.0.0-20240521202816-d264139d666e",
)
go_deps.module(
path = "github.com/golang/protobuf",
sum = "h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=",
version = "v1.5.4",
)
use_repo(
go_deps,
"com_github_golang_protobuf",
"com_github_planetscale_vtprotobuf",
"org_golang_google_genproto_googleapis_api",
"org_golang_google_genproto_googleapis_rpc",
"org_golang_google_protobuf",
)
116 changes: 116 additions & 0 deletions modules/envoy_api/0.0.0-20251105-4a2b9a3/patches/bzlmod_fixes.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
diff --git a/bazel/BUILD b/bazel/BUILD
index f68f07c9..feaada93 100644
--- a/bazel/BUILD
+++ b/bazel/BUILD
@@ -1,4 +1,3 @@
-load("@envoy_toolshed//:macros.bzl", "json_data")
load("@io_bazel_rules_go//proto:compiler.bzl", "go_proto_compiler")
load(
":external_proto_deps.bzl",
@@ -28,17 +27,3 @@ go_proto_compiler(
valid_archive = False,
visibility = ["//visibility:public"],
)
-
-json_data(
- name = "repository_locations",
- data = load_repository_locations_spec(REPOSITORY_LOCATIONS_SPEC),
-)
-
-json_data(
- name = "external_proto_deps",
- data = dict(
- cc = EXTERNAL_PROTO_CC_BAZEL_DEP_MAP,
- go = EXTERNAL_PROTO_GO_BAZEL_DEP_MAP,
- imports = EXTERNAL_PROTO_IMPORT_BAZEL_DEP_MAP,
- ),
-)
diff --git a/bazel/api_build_system.bzl b/bazel/api_build_system.bzl
index e3047cac..a5d4ae70 100644
--- a/bazel/api_build_system.bzl
+++ b/bazel/api_build_system.bzl
@@ -1,6 +1,7 @@
load("@com_envoyproxy_protoc_gen_validate//bazel:pgv_proto_library.bzl", "pgv_cc_proto_library")
load("@com_github_grpc_grpc//bazel:cc_grpc_library.bzl", "cc_grpc_library")
load("@com_github_grpc_grpc//bazel:python_rules.bzl", _py_proto_library = "py_proto_library")
+load("@com_google_protobuf//bazel:java_proto_library.bzl", "java_proto_library")
load("@com_google_protobuf//bazel:proto_library.bzl", "proto_library")
load("@io_bazel_rules_go//go:def.bzl", "go_test")
load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
@@ -24,6 +25,7 @@ _CC_GRPC_SUFFIX = "_cc_grpc"
_GO_PROTO_SUFFIX = "_go_proto"
_GO_IMPORTPATH_PREFIX = "github.com/envoyproxy/go-control-plane/"
_JAVA_PROTO_SUFFIX = "_java_proto"
+_IS_BZLMOD = str(Label("//:invalid")).startswith("@@")

_COMMON_PROTO_DEPS = [
"@com_google_protobuf//:any_proto",
@@ -43,7 +45,8 @@ _COMMON_PROTO_DEPS = [
def _proto_mapping(dep, proto_dep_map, proto_suffix):
mapped = proto_dep_map.get(dep)
if mapped == None:
- prefix = "@" + Label(dep).workspace_name if not dep.startswith("//") else ""
+ prefix = "@@" if _IS_BZLMOD else "@"
+ prefix = prefix + Label(dep).repo_name if not dep.startswith("//") else ""
return prefix + "//" + Label(dep).package + ":" + Label(dep).name + proto_suffix
return mapped

@@ -113,7 +116,7 @@ def api_cc_py_proto_library(
)

if java:
- native.java_proto_library(
+ java_proto_library(
name = name + _JAVA_PROTO_SUFFIX,
visibility = ["//visibility:public"],
deps = [relative_name],
diff --git a/bazel/cc_proto_descriptor_library/builddefs.bzl b/bazel/cc_proto_descriptor_library/builddefs.bzl
index 23d9f558..e3ae549e 100644
--- a/bazel/cc_proto_descriptor_library/builddefs.bzl
+++ b/bazel/cc_proto_descriptor_library/builddefs.bzl
@@ -3,6 +3,9 @@
"""

load("@bazel_skylib//lib:paths.bzl", "paths")
+load("@com_google_protobuf//bazel/common:proto_info.bzl", "ProtoInfo")
+load("@rules_cc//cc/common:cc_common.bzl", "cc_common")
+load("@rules_cc//cc/common:cc_info.bzl", "CcInfo")

# begin:google_only
# load("@bazel_tools//tools/cpp:toolchain_utils.bzl", "find_cpp_toolchain", "use_cpp_toolchain")
diff --git a/bazel/repositories.bzl b/bazel/repositories.bzl
index 217614f5..274bee87 100644
--- a/bazel/repositories.bzl
+++ b/bazel/repositories.bzl
@@ -12,7 +12,13 @@ def external_http_archive(name, **kwargs):
**kwargs
)

-def api_dependencies():
+def api_dependencies(bzlmod = False):
+ external_http_archive(
+ name = "prometheus_metrics_model",
+ build_file_content = PROMETHEUSMETRICS_BUILD_CONTENT,
+ )
+ if bzlmod:
+ return
external_http_archive(
name = "bazel_skylib",
)
@@ -30,10 +36,6 @@ def api_dependencies():
external_http_archive(
name = "com_github_cncf_xds",
)
- external_http_archive(
- name = "prometheus_metrics_model",
- build_file_content = PROMETHEUSMETRICS_BUILD_CONTENT,
- )
external_http_archive(
name = "rules_buf",
)
@@ -380,3 +382,5 @@ go_grpc_library(
],
)
"""
+
+non_module_deps = module_extension(implementation = lambda ctx: api_dependencies(bzlmod = True))
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
diff --git a/MODULE.bazel b/MODULE.bazel
new file mode 100644
index 00000000..7e4f959a
--- /dev/null
+++ b/MODULE.bazel
@@ -0,0 +1,68 @@
+module(
+ name = "envoy_api",
+ version = "0.0.0-20251105-4a2b9a3",
+)
+
+bazel_dep(name = "abseil-cpp", version = "20250814.1", repo_name = "com_google_absl")
+bazel_dep(name = "bazel_skylib", version = "1.8.1")
+bazel_dep(name = "gazelle", version = "0.46.0", repo_name = "bazel_gazelle")
+bazel_dep(name = "googleapis", version = "0.0.0-20251003-2193a2bf", repo_name = "com_google_googleapis")
+bazel_dep(name = "googletest", version = "1.17.0", repo_name = "com_google_googletest")
+bazel_dep(name = "grpc", version = "1.74.1", repo_name = "com_github_grpc_grpc")
+bazel_dep(name = "opencensus-proto", version = "0.4.1.bcr.2", repo_name = "opencensus_proto")
+bazel_dep(name = "opentelemetry-proto", version = "1.5.0", repo_name = "opentelemetry_proto")
+bazel_dep(name = "protobuf", version = "33.0", repo_name = "com_google_protobuf")
+bazel_dep(name = "protoc-gen-validate", version = "1.2.1.bcr.2", repo_name = "com_envoyproxy_protoc_gen_validate")
+bazel_dep(name = "re2", version = "2024-07-02.bcr.1", repo_name = "com_googlesource_code_re2")
+bazel_dep(name = "rules_go", version = "0.58.3", repo_name = "io_bazel_rules_go")
+bazel_dep(name = "rules_proto", version = "7.1.0")
+bazel_dep(name = "rules_python", version = "1.6.0")
+bazel_dep(name = "rules_cc", version = "0.2.13")
+bazel_dep(name = "xds", version = "0.0.0-20240423-555b57e", repo_name = "com_github_cncf_xds")
+
+# Bump google_benchmark to avoid rules_foreign_cc
+bazel_dep(name = "google_benchmark", version = "1.9.4")
+
+non_module_deps = use_extension("//bazel:repositories.bzl", "non_module_deps")
+use_repo(
+ non_module_deps,
+ "prometheus_metrics_model",
+)
+
+go_sdk = use_extension("@io_bazel_rules_go//go:extensions.bzl", "go_sdk")
+go_sdk.download(version = "1.24.0")
+
+go_deps = use_extension("@bazel_gazelle//:extensions.bzl", "go_deps")
+go_deps.module(
+ path = "github.com/planetscale/vtprotobuf",
+ sum = "h1:GFCKgmp0tecUJ0sJuv4pzYCqS9+RGSn52M3FUwPs+uo=",
+ version = "v0.6.1-0.20240319094008-0393e58bdf10",
+)
+go_deps.module(
+ path = "google.golang.org/protobuf",
+ sum = "h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8=",
+ version = "v1.31.0",
+)
+go_deps.module(
+ path = "google.golang.org/genproto/googleapis/rpc",
+ sum = "h1:Elxv5MwEkCI9f5SkoL6afed6NTdxaGoAo39eANBwHL8=",
+ version = "v0.0.0-20240521202816-d264139d666e",
+)
+go_deps.module(
+ path = "google.golang.org/genproto/googleapis/api",
+ sum = "h1:SkdGTrROJl2jRGT/Fxv5QUf9jtdKCQh4KQJXbXVLAi0=",
+ version = "v0.0.0-20240521202816-d264139d666e",
+)
+go_deps.module(
+ path = "github.com/golang/protobuf",
+ sum = "h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=",
+ version = "v1.5.4",
+)
+use_repo(
+ go_deps,
+ "com_github_golang_protobuf",
+ "com_github_planetscale_vtprotobuf",
+ "org_golang_google_genproto_googleapis_api",
+ "org_golang_google_genproto_googleapis_rpc",
+ "org_golang_google_protobuf",
+)
32 changes: 32 additions & 0 deletions modules/envoy_api/0.0.0-20251105-4a2b9a3/presubmit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
matrix:
unix_platform:
- debian11
- ubuntu2404
- macos_arm64
bazel:
- 7.x
- 8.x
- 9.*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curiosity: What is the difference between .x and .*? Should we align on one approach?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

9.* fetches the latest release or release rc. 9.x only fetches the latest official release, which doesn't exist yet.

tasks:
verify_targets:
name: Verify build targets
platform: ${{ unix_platform }}
bazel: ${{ bazel }}
build_targets:
- "@envoy_api//test/build:go_build_test"
- "@envoy_api//tools/..."
build_flags:
- "--java_runtime_version=remotejdk_21"
- '--cxxopt=-std=c++17'
- '--host_cxxopt=-std=c++17'
verify_targets_windows:
name: Verify build targets
platform: windows
bazel: ${{ bazel }}
build_targets:
- "@envoy_api//test/build:go_build_test"
- "@envoy_api//tools/..."
build_flags:
- "--java_runtime_version=remotejdk_21"
- '--cxxopt=/std:c++17'
- '--host_cxxopt=/std:c++17'
10 changes: 10 additions & 0 deletions modules/envoy_api/0.0.0-20251105-4a2b9a3/source.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"url": "https://github.com/envoyproxy/data-plane-api/archive/4a2b9a30628e95e0cfe985c45c10adc8a6b1643b.tar.gz",
"integrity": "sha256-o/2aW/FgnYAAai84BXRkEpiwprYG5z3dKzDsB1t+SMU=",
"strip_prefix": "data-plane-api-4a2b9a30628e95e0cfe985c45c10adc8a6b1643b",
"patch_strip": 1,
"patches": {
"bzlmod_fixes.patch": "sha256-ZSNfOF4rh3KtVXMaElLazh08fd0Mu376hedcEQo4wfA=",
"module_dot_bazel.patch": "sha256-QrdIOmzA/K+wStl4BkV1QoihFEdwIc6FIn+SIEQxvGk="
}
}
3 changes: 2 additions & 1 deletion modules/envoy_api/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
],
"versions": [
"0.0.0-20241214-918efc9",
"0.0.0-20250128-4de3c74"
"0.0.0-20250128-4de3c74",
"0.0.0-20251105-4a2b9a3"
],
"yanked_versions": {}
}
Loading
Loading