Skip to content

Commit 09c3e3f

Browse files
authored
deps: remove utf8_range dependency in favor of protobuf's copy (#39260)
## Description The `utf8_range` library has moved to be part of protobuf's third_party directory [[See This](https://github.com/protocolbuffers/utf8_range?tab=readme-ov-file )]. This PR removes our separate dependency on `utf8_range` and updates our code to use the copy from protobuf instead. This simplifies our dependency tree without changing functionality, as we're already using protobuf version 29.3 which includes utf8_range in its third_party directory. Signed-off-by: Rohit Agrawal <[email protected]>
1 parent 10c66fa commit 09c3e3f

File tree

5 files changed

+7
-21
lines changed

5 files changed

+7
-21
lines changed

bazel/repositories.bzl

-4
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,6 @@ def envoy_dependencies(skip_targets = []):
208208
external_http_archive("proxy_wasm_rust_sdk")
209209
_com_google_cel_cpp()
210210
_com_github_google_perfetto()
211-
_utf8_range()
212211
_rules_ruby()
213212
external_http_archive("com_github_google_flatbuffers")
214213
external_http_archive("bazel_features")
@@ -938,9 +937,6 @@ def _com_github_fdio_vpp_vcl():
938937
patches = ["@envoy//bazel/foreign_cc:vpp_vcl.patch"],
939938
)
940939

941-
def _utf8_range():
942-
external_http_archive("utf8_range")
943-
944940
def _rules_ruby():
945941
external_http_archive("rules_ruby")
946942

bazel/repository_locations.bzl

-14
Original file line numberDiff line numberDiff line change
@@ -1512,20 +1512,6 @@ REPOSITORY_LOCATIONS_SPEC = dict(
15121512
license = "Apache-2.0",
15131513
license_url = "https://github.com/bazelbuild/rules_license/blob/{version}/LICENSE",
15141514
),
1515-
utf8_range = dict(
1516-
project_name = "utf8_range",
1517-
project_desc = "Fast UTF-8 validation with Range algorithm (NEON+SSE4+AVX2)",
1518-
project_url = "https://github.com/protocolbuffers/utf8_range",
1519-
version = "d863bc33e15cba6d873c878dcca9e6fe52b2f8cb",
1520-
sha256 = "c56f0a8c562050e6523a3095cf5610d19c190cd99bac622cc3e5754be51aaa7b",
1521-
strip_prefix = "utf8_range-{version}",
1522-
urls = ["https://github.com/protocolbuffers/utf8_range/archive/{version}.tar.gz"],
1523-
use_category = ["build", "dataplane_core", "controlplane"],
1524-
release_date = "2023-05-26",
1525-
cpe = "N/A",
1526-
license = "MIT",
1527-
license_url = "https://github.com/protocolbuffers/utf8_range/blob/{version}/LICENSE",
1528-
),
15291515
com_github_maxmind_libmaxminddb = dict(
15301516
project_name = "maxmind_libmaxminddb",
15311517
project_desc = "C library for reading MaxMind DB files",

source/common/json/BUILD

+3-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ envoy_cc_library(
4141
":json_internal_lib",
4242
"//source/common/common:assert_lib",
4343
"//source/common/common:thread_lib",
44-
"@utf8_range//:utf8_validity",
44+
"@com_github_nlohmann_json//:json",
45+
"@com_google_absl//absl/strings:str_format",
46+
"@com_google_protobuf//third_party/utf8_range:utf8_validity",
4547
],
4648
)
4749

source/common/json/json_sanitizer.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#include "source/common/json/json_internal.h"
66

77
#include "absl/strings/str_format.h"
8-
#include "utf8_validity.h"
8+
#include "third_party/utf8_range/utf8_validity.h"
99

1010
namespace Envoy {
1111
namespace Json {

source/common/protobuf/BUILD

+3-1
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,12 @@ envoy_cc_library(
8484
"//source/common/runtime:runtime_features_lib",
8585
"@com_github_cncf_xds//udpa/annotations:pkg_cc_proto",
8686
"@com_github_jbeder_yaml_cpp//:yaml-cpp",
87+
"@com_google_absl//absl/strings",
88+
"@com_google_absl//absl/strings:str_format",
8789
"@com_google_protobuf//:protobuf",
90+
"@com_google_protobuf//third_party/utf8_range:utf8_validity",
8891
"@envoy_api//envoy/annotations:pkg_cc_proto",
8992
"@envoy_api//envoy/type/v3:pkg_cc_proto",
90-
"@utf8_range//:utf8_validity",
9193
],
9294
)
9395

0 commit comments

Comments
 (0)