Skip to content
Draft
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions api/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ bazel_dep(name = "protobuf", version = "33.1", 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")
bazel_dep(name = "rules_cc", version = "0.2.22")
bazel_dep(name = "rules_go", version = "0.59.0", repo_name = "io_bazel_rules_go")
bazel_dep(name = "rules_go", version = "0.59.0")
bazel_dep(name = "rules_java", version = "9.0.3")
bazel_dep(name = "rules_jvm_external", version = "6.8")
bazel_dep(name = "rules_proto", version = "7.1.0")
Expand All @@ -31,7 +31,7 @@ bazel_dep(name = "zipkin-api", version = "1.0.0")
bazel_dep(name = "googletest", version = "1.17.0", dev_dependency = True)

# Go SDK and toolchain configuration
go_sdk = use_extension("@io_bazel_rules_go//go:extensions.bzl", "go_sdk")
go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk")
go_sdk.download(version = "1.24.6")
use_repo(
go_sdk,
Expand Down
2 changes: 1 addition & 1 deletion api/bazel/BUILD
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
load("@aspect_bazel_lib//lib:jq.bzl", "jq")
load("@aspect_bazel_lib//lib:yq.bzl", "yq")
load("@envoy_toolshed//:macros.bzl", "json_data")
load("@io_bazel_rules_go//proto:compiler.bzl", "go_proto_compiler")
load("@rules_go//proto:compiler.bzl", "go_proto_compiler")
load(
":external_proto_deps.bzl",
"EXTERNAL_PROTO_CC_BAZEL_DEP_MAP",
Expand Down
8 changes: 4 additions & 4 deletions api/bazel/api_build_system.bzl
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
load("@com_envoyproxy_protoc_gen_validate//bazel:pgv_proto_library.bzl", "pgv_cc_proto_library")
load("@grpc//bazel:cc_grpc_library.bzl", "cc_grpc_library")
load("@grpc//bazel:python_rules.bzl", _py_proto_library = "py_proto_library")
load("@io_bazel_rules_go//go:def.bzl", "go_test")
load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
load("@protobuf//bazel:java_lite_proto_library.bzl", "java_lite_proto_library")
load("@protobuf//bazel:proto_library.bzl", "proto_library")
load("@rules_cc//cc:defs.bzl", "cc_test")
load("@rules_go//go:def.bzl", "go_test")
load("@rules_go//proto:def.bzl", "go_proto_library")
load(
"//bazel:external_proto_deps.bzl",
"EXTERNAL_PROTO_CC_BAZEL_DEP_MAP",
Expand Down Expand Up @@ -161,9 +161,9 @@ def api_proto_package(
has_services = has_services,
)

compilers = ["@io_bazel_rules_go//proto:go_proto", "@com_envoyproxy_protoc_gen_validate//bazel/go:pgv_plugin_go", "@envoy_api//bazel:vtprotobuf_plugin_go"]
compilers = ["@rules_go//proto:go_proto", "@com_envoyproxy_protoc_gen_validate//bazel/go:pgv_plugin_go", "@envoy_api//bazel:vtprotobuf_plugin_go"]
if has_services:
compilers = ["@io_bazel_rules_go//proto:go_proto", "@io_bazel_rules_go//proto:go_grpc_v2", "@com_envoyproxy_protoc_gen_validate//bazel/go:pgv_plugin_go", "@envoy_api//bazel:vtprotobuf_plugin_go"]
compilers = ["@rules_go//proto:go_proto", "@rules_go//proto:go_grpc_v2", "@com_envoyproxy_protoc_gen_validate//bazel/go:pgv_plugin_go", "@envoy_api//bazel:vtprotobuf_plugin_go"]

deps = (
[_go_proto_mapping(dep) for dep in deps] +
Expand Down
16 changes: 13 additions & 3 deletions api/bazel/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,14 @@ def api_dependencies(bzlmod = False):
external_http_archive(
name = "prometheus_metrics_model",
build_file_content = PROMETHEUSMETRICS_BUILD_CONTENT,
repo_mapping = {"@io_bazel_rules_go": "@rules_go"},
)
external_http_archive(
name = "com_github_chrusty_protoc_gen_jsonschema",
repo_mapping = {
"@bazel_gazelle": "@gazelle",
"@com_google_protobuf": "@protobuf",
"@io_bazel_rules_go": "@rules_go",
},
)
external_http_archive(
Expand Down Expand Up @@ -50,13 +52,17 @@ def api_dependencies(bzlmod = False):
"@com_google_absl": "@abseil-cpp",
"@com_github_grpc_grpc": "@grpc",
"@com_google_protobuf": "@protobuf",
"@io_bazel_rules_go": "@rules_go",
},
)
external_http_archive(
name = "googleapis",
patch_args = ["-p1"],
patches = ["@envoy//bazel:googleapis.patch"],
repo_mapping = {
"@com_github_grpc_grpc": "@grpc",
"@com_google_protobuf": "@protobuf",
"@io_bazel_rules_go": "@rules_go",
},
)
external_http_archive(
Expand All @@ -66,6 +72,7 @@ def api_dependencies(bzlmod = False):
"@com_google_protobuf": "@protobuf",
"@com_github_grpc_grpc": "@grpc",
"@com_googlesource_code_re2": "@re2",
"@io_bazel_rules_go": "@rules_go",
},
)
external_http_archive(
Expand All @@ -79,6 +86,7 @@ def api_dependencies(bzlmod = False):
name = "zipkin-api",
location_name = "zipkin_api",
build_file_content = ZIPKINAPI_BUILD_CONTENT,
repo_mapping = {"@io_bazel_rules_go": "@rules_go"},
)
external_http_archive(
name = "opentelemetry-proto",
Expand All @@ -87,19 +95,21 @@ def api_dependencies(bzlmod = False):
repo_mapping = {
"@com_google_absl": "@abseil-cpp",
"@com_google_protobuf": "@protobuf",
"@io_bazel_rules_go": "@rules_go",
},
)
external_http_archive(
name = "dev_cel",
repo_mapping = {
"@com_google_absl": "@abseil-cpp",
"@com_google_protobuf": "@protobuf",
"@io_bazel_rules_go": "@rules_go",
},
)

PROMETHEUSMETRICS_BUILD_CONTENT = """
load("@envoy_api//bazel:api_build_system.bzl", "api_cc_py_proto_library")
load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
load("@rules_go//proto:def.bzl", "go_proto_library")

api_cc_py_proto_library(
name = "client_model",
Expand All @@ -120,7 +130,7 @@ go_proto_library(
ZIPKINAPI_BUILD_CONTENT = """

load("@envoy_api//bazel:api_build_system.bzl", "api_cc_py_proto_library")
load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
load("@rules_go//proto:def.bzl", "go_proto_library")

api_cc_py_proto_library(
name = "zipkin",
Expand Down Expand Up @@ -149,7 +159,7 @@ load("@grpc//bazel:cc_grpc_library.bzl", "cc_grpc_library")
load("@grpc//bazel:python_rules.bzl", "py_proto_library", "py_grpc_library")
load("@protobuf//bazel:cc_proto_library.bzl", "cc_proto_library")
load("@protobuf//bazel:proto_library.bzl", "proto_library")
load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library", "go_grpc_library")
load("@rules_go//proto:def.bzl", "go_proto_library", "go_grpc_library")

package(default_visibility = ["//visibility:public"])

Expand Down
2 changes: 2 additions & 0 deletions bazel/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ exports_files([
"test_for_benchmark_wrapper.sh",
"repository_locations.bzl",
"deps.yaml",
"googleapis.patch",
"rules_go.patch",
"exported_symbols.txt",
"exported_symbols_apple.txt",
])
Expand Down
24 changes: 21 additions & 3 deletions bazel/dependency_imports.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ load("@envoy_toolshed//compile:sanitizer_libs.bzl", "setup_sanitizer_libs")
load("@envoy_toolshed//coverage/grcov:grcov_repository.bzl", "grcov_repository")
load("@fuzzing_pip3//:requirements.bzl", pip_fuzzing_dependencies = "install_deps")
load("@gazelle//:deps.bzl", "gazelle_dependencies", "go_repository")
load("@io_bazel_rules_go//go:deps.bzl", "go_download_sdk", "go_register_toolchains", "go_rules_dependencies")
load("@proxy-wasm-rust-sdk//bazel:dependencies.bzl", "proxy_wasm_rust_sdk_dependencies")
load("@rules_apple//apple:repositories.bzl", "apple_rules_dependencies")
load("@rules_buf//buf:repositories.bzl", "rules_buf_toolchains")
load("@rules_cc//cc:extensions.bzl", "compatibility_proxy_repo")
load("@rules_foreign_cc//foreign_cc:repositories.bzl", "rules_foreign_cc_dependencies")
load("@rules_fuzzing//fuzzing:repositories.bzl", "rules_fuzzing_dependencies")
load("@rules_go//go:deps.bzl", "go_download_sdk", "go_register_toolchains", "go_rules_dependencies")
load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies")
load("@rules_proto_grpc//:repositories.bzl", "rules_proto_grpc_toolchains")
load("@rules_rust//crate_universe:defs.bzl", "crate", "crates_repository")
Expand Down Expand Up @@ -117,6 +117,7 @@ def envoy_dependency_imports(
name = "org_golang_google_grpc",
build_file_proto_mode = "disable",
importpath = "google.golang.org/grpc",
repo_mapping = {"@io_bazel_rules_go": "@rules_go"},
sum = "h1:aHQeeJbo8zAkAa3pRzrVjZlbz6uSfeOXlJNQM0RAbz0=",
version = "v1.68.0",
build_directives = [
Expand All @@ -130,6 +131,7 @@ def envoy_dependency_imports(
go_repository(
name = "org_golang_x_net",
importpath = "golang.org/x/net",
repo_mapping = {"@io_bazel_rules_go": "@rules_go"},
sum = "h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0=",
version = "v0.34.0",
build_directives = [
Expand All @@ -142,18 +144,21 @@ def envoy_dependency_imports(
go_repository(
name = "org_golang_x_sys",
importpath = "golang.org/x/sys",
repo_mapping = {"@io_bazel_rules_go": "@rules_go"},
sum = "h1:3yZWxaJjBmCWXqhN1qh02AkOnCQ1poK6oF+a7xWL6Gc=",
version = "v0.38.0",
)
go_repository(
name = "org_golang_x_text",
importpath = "golang.org/x/text",
repo_mapping = {"@io_bazel_rules_go": "@rules_go"},
sum = "h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo=",
version = "v0.21.0",
)
go_repository(
name = "org_golang_google_genproto_googleapis_api",
importpath = "google.golang.org/genproto/googleapis/api",
repo_mapping = {"@io_bazel_rules_go": "@rules_go"},
sum = "h1:+2XxjfsAu6vqFxwGBRcHiMaDCuZiqXGDUDVWVtrFAnE=",
version = "v0.0.0-20251029180050-ab9386a59fda",
build_directives = [
Expand All @@ -163,19 +168,22 @@ def envoy_dependency_imports(
go_repository(
name = "org_golang_google_genproto_googleapis_rpc",
importpath = "google.golang.org/genproto/googleapis/rpc",
repo_mapping = {"@io_bazel_rules_go": "@rules_go"},
sum = "h1:i/Q+bfisr7gq6feoJnS/DlpdwEL4ihp41fvRiM3Ork0=",
version = "v0.0.0-20251029180050-ab9386a59fda",
)
go_repository(
name = "org_golang_google_protobuf",
build_file_proto_mode = "disable",
importpath = "google.golang.org/protobuf",
repo_mapping = {"@io_bazel_rules_go": "@rules_go"},
sum = "h1:AYd7cD/uASjIL6Q9LiTjz8JLcrh/88q5UObnmY3aOOE=",
version = "v1.36.10",
)
go_repository(
name = "xds_go",
importpath = "github.com/cncf/xds/go",
repo_mapping = {"@io_bazel_rules_go": "@rules_go"},
sum = "h1:gt7U1Igw0xbJdyaCM5H2CnlAlPSkzrhsebQB6WQWjLA=",
version = "v0.0.0-20251110193048-8bfbf64dc13e",
build_directives = [
Expand All @@ -185,12 +193,14 @@ def envoy_dependency_imports(
go_repository(
name = "dev_cel_expr",
importpath = "cel.dev/expr",
repo_mapping = {"@io_bazel_rules_go": "@rules_go"},
sum = "h1:1KrZg61W6TWSxuNZ37Xy49ps13NUovb66QLprthtwi4=",
version = "v0.25.1",
)
go_repository(
name = "com_github_spf13_afero",
importpath = "github.com/spf13/afero",
repo_mapping = {"@io_bazel_rules_go": "@rules_go"},
sum = "h1:EaGW2JJh15aKOejeuJ+wpFSHnbd7GE6Wvp3TsNhb6LY=",
version = "v1.10.0",
build_directives = [
Expand All @@ -202,6 +212,7 @@ def envoy_dependency_imports(
go_repository(
name = "com_github_lyft_protoc_gen_star_v2",
importpath = "github.com/lyft/protoc-gen-star/v2",
repo_mapping = {"@io_bazel_rules_go": "@rules_go"},
sum = "h1:sIXJOMrYnQZJu7OB7ANSF4MYri2fTEGIsRLz6LwI4xE=",
version = "v2.0.4-0.20230330145011-496ad1ac90a4",
build_directives = [
Expand All @@ -212,6 +223,7 @@ def envoy_dependency_imports(
go_repository(
name = "com_github_iancoleman_strcase",
importpath = "github.com/iancoleman/strcase",
repo_mapping = {"@io_bazel_rules_go": "@rules_go"},
sum = "h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI=",
version = "v0.3.0",
)
Expand All @@ -220,15 +232,21 @@ def envoy_dependency_imports(
importpath = "github.com/planetscale/vtprotobuf",
sum = "h1:ujRGEVWJEoaxQ+8+HMl8YEpGaDAgohgZxJ5S+d2TTFQ=",
version = "v0.6.1-0.20240409071808-615f978279ca",
repo_mapping = {"@com_google_protobuf": "@protobuf"},
repo_mapping = {
"@com_google_protobuf": "@protobuf",
"@io_bazel_rules_go": "@rules_go",
},
)

go_repository(
name = "com_github_envoyproxy_protoc_gen_validate",
importpath = "github.com/envoyproxy/protoc-gen-validate",
sum = "h1:TvGH1wof4H33rezVKWSpqKz5NXWg5VPuZ0uONDT6eb4=",
version = "v1.3.0",
repo_mapping = {"@com_google_protobuf": "@protobuf"},
repo_mapping = {
"@com_google_protobuf": "@protobuf",
"@io_bazel_rules_go": "@rules_go",
},
)

rules_proto_grpc_toolchains()
Expand Down
3 changes: 2 additions & 1 deletion bazel/deps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -549,10 +549,11 @@ intel_ittapi:
extensions:
- envoy.wasm.runtime.v8

io_bazel_rules_go:
rules_go:
project_name: "Go rules for Bazel"
project_desc: "Bazel rules for the Go language"
project_url: "https://github.com/bazelbuild/rules_go"
apparent_name: io_bazel_rules_go
release_date: "2026-06-04"
use_category:
- build
Expand Down
28 changes: 28 additions & 0 deletions bazel/googleapis.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
diff --git a/repository_rules.bzl b/repository_rules.bzl
index efdcf49b..7b65907a 100644
--- a/repository_rules.bzl
+++ b/repository_rules.bzl
@@ -184,19 +184,19 @@ def switched_rules_by_language(
#
rules["go_proto_library"] = _switch(
go,
- "@io_bazel_rules_go//proto:def.bzl",
+ "@rules_go//proto:def.bzl",
)
rules["go_grpc_library"] = _switch(
go,
- "@io_bazel_rules_go//proto:def.bzl",
+ "@rules_go//proto:def.bzl",
)
rules["go_library"] = _switch(
go,
- "@io_bazel_rules_go//go:def.bzl",
+ "@rules_go//go:def.bzl",
)
rules["go_test"] = _switch(
go and grpc and gapic and go_test,
- "@io_bazel_rules_go//go:def.bzl",
+ "@rules_go//go:def.bzl",
)
rules["go_gapic_library"] = _switch(
go and grpc and gapic,
24 changes: 19 additions & 5 deletions bazel/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,22 @@ def _cc_deps():
def _go_deps(skip_targets):
# Keep the skip_targets check around until Istio Proxy has stopped using
# it to exclude the Go rules.
if "io_bazel_rules_go" not in skip_targets:
if "io_bazel_rules_go" not in skip_targets and "rules_go" not in skip_targets:
external_http_archive(
name = "io_bazel_rules_go",
repo_mapping = {"@com_google_protobuf": "@protobuf"},
name = "rules_go",
patch_args = ["-p1"],
patches = ["@envoy//bazel:rules_go.patch"],
repo_mapping = {
"@com_google_protobuf": "@protobuf",
"@io_bazel_rules_go": "@rules_go",
},
)
external_http_archive(
name = "gazelle",
repo_mapping = {"@com_google_protobuf": "@protobuf"},
repo_mapping = {
"@com_google_protobuf": "@protobuf",
"@io_bazel_rules_go": "@rules_go",
},
)

def _rust_deps():
Expand Down Expand Up @@ -398,7 +406,10 @@ def _com_github_bazel_buildtools():
# cf: https://github.com/bazelbuild/buildtools/issues/367
external_http_archive(
name = "buildtools",
repo_mapping = {"@com_google_protobuf": "@protobuf"},
repo_mapping = {
"@com_google_protobuf": "@protobuf",
"@io_bazel_rules_go": "@rules_go",
},
)

def _c_ares():
Expand Down Expand Up @@ -613,6 +624,7 @@ def _cel_cpp():
"@com_google_protobuf": "@protobuf",
"@com_github_google_flatbuffers": "@flatbuffers",
"@com_googlesource_code_re2": "@re2",
"@io_bazel_rules_go": "@rules_go",
},
)

Expand All @@ -623,6 +635,7 @@ def _cel_cpp():
repo_mapping = {
"@com_google_absl": "@abseil-cpp",
"@com_google_protobuf": "@protobuf",
"@io_bazel_rules_go": "@rules_go",
},
)

Expand Down Expand Up @@ -922,6 +935,7 @@ def _rules_proto_grpc():
"@com_github_grpc_grpc": "@grpc",
"@bazel_gazelle": "@gazelle",
"@com_google_protobuf": "@protobuf",
"@io_bazel_rules_go": "@rules_go",
},
)

Expand Down
Loading