envoy: 1.27.5 -> 1.30.1

Co-authored-by: Paul Meyer <49727155+katexochen@users.noreply.github.com>

+118 -208
+19 -15
pkgs/servers/http/envoy/0001-nixpkgs-use-system-Python.patch
··· 1 - From 4a9739da420b9584d5b9582c19cf3f86a6a90609 Mon Sep 17 00:00:00 2001 2 - From: Luke Granger-Brown <git@lukegb.com> 3 - Date: Fri, 12 May 2023 08:12:04 +0100 4 - Subject: [PATCH 1/3] nixpkgs: use system Python 1 + From 418d38868d63c0009460e1a3ca004987fe26346b Mon Sep 17 00:00:00 2001 2 + From: Paul Meyer <49727155+katexochen@users.noreply.github.com> 3 + Date: Mon, 22 Apr 2024 11:52:59 +0200 4 + Subject: [PATCH 1/4] nixpkgs: use system Python 5 5 6 + Signed-off-by: Paul Meyer <49727155+katexochen@users.noreply.github.com> 6 7 --- 7 8 bazel/python_dependencies.bzl | 11 ++++------- 8 - bazel/repositories_extra.bzl | 16 ---------------- 9 - 2 files changed, 4 insertions(+), 23 deletions(-) 9 + bazel/repositories_extra.bzl | 17 +---------------- 10 + 2 files changed, 5 insertions(+), 23 deletions(-) 10 11 11 12 diff --git a/bazel/python_dependencies.bzl b/bazel/python_dependencies.bzl 12 - index ea50bf30ba..b82f374720 100644 13 + index b747fd0b9a..b82f374720 100644 13 14 --- a/bazel/python_dependencies.bzl 14 15 +++ b/bazel/python_dependencies.bzl 15 16 @@ -1,27 +1,24 @@ 16 - load("@rules_python//python:pip.bzl", "pip_parse") 17 - -load("@python3_11//:defs.bzl", "interpreter") 18 17 -load("@envoy_toolshed//:packages.bzl", "load_packages") 18 + -load("@python3_11//:defs.bzl", "interpreter") 19 + load("@rules_python//python:pip.bzl", "pip_parse") 19 20 20 21 def envoy_python_dependencies(): 21 22 - # TODO(phlax): rename base_pip3 -> pip3 and remove this ··· 45 46 extra_pip_args = ["--require-hashes"], 46 47 ) 47 48 diff --git a/bazel/repositories_extra.bzl b/bazel/repositories_extra.bzl 48 - index 40d348073f..17b98b1ea1 100644 49 + index a5bc2d5277..001de36a16 100644 49 50 --- a/bazel/repositories_extra.bzl 50 51 +++ b/bazel/repositories_extra.bzl 51 - @@ -1,29 +1,13 @@ 52 + @@ -2,19 +2,11 @@ load("@aspect_bazel_lib//lib:repositories.bzl", "aspect_bazel_lib_dependencies") 53 + load("@com_github_rules_proto_grpc//:repositories.bzl", "rules_proto_grpc_toolchains") 52 54 load("@emsdk//:deps.bzl", emsdk_deps = "deps") 53 - -load("@rules_python//python:repositories.bzl", "python_register_toolchains") 54 55 load("@proxy_wasm_cpp_host//bazel/cargo/wasmtime:crates.bzl", "wasmtime_fetch_remote_crates") 56 + -load("@rules_python//python:repositories.bzl", "py_repositories", "python_register_toolchains") 57 + +load("@rules_python//python:repositories.bzl", "py_repositories") 55 58 load("//bazel/external/cargo:crates.bzl", "raze_fetch_remote_crates") 56 - load("@aspect_bazel_lib//lib:repositories.bzl", "aspect_bazel_lib_dependencies") 57 59 58 60 -def _python_minor_version(python_version): 59 61 - return "_".join(python_version.split(".")[:-1]) ··· 68 70 ignore_root_user_error = False): 69 71 emsdk_deps() 70 72 raze_fetch_remote_crates() 71 - wasmtime_fetch_remote_crates() 73 + @@ -22,11 +14,4 @@ def envoy_dependencies_extra( 74 + rules_proto_grpc_toolchains() 75 + py_repositories() 72 76 73 77 - # Registers underscored Python minor version - eg `python3_10` 74 78 - python_register_toolchains( ··· 79 83 - 80 84 aspect_bazel_lib_dependencies() 81 85 -- 82 - 2.42.0 86 + 2.44.0 83 87
+16 -53
pkgs/servers/http/envoy/0002-nixpkgs-use-system-Go.patch
··· 1 - From 10e577a3c300f76ead5a5512f2fe970f12e46592 Mon Sep 17 00:00:00 2001 2 - From: Luke Granger-Brown <git@lukegb.com> 3 - Date: Fri, 12 May 2023 08:13:21 +0100 4 - Subject: [PATCH 2/3] nixpkgs: use system Go 1 + From 0ecb8b5bc194fecb10c523d5856dc0b4cb78f6e4 Mon Sep 17 00:00:00 2001 2 + From: Paul Meyer <49727155+katexochen@users.noreply.github.com> 3 + Date: Mon, 22 Apr 2024 11:58:00 +0200 4 + Subject: [PATCH 2/4] nixpkgs: use system Go 5 5 6 + Signed-off-by: Paul Meyer <49727155+katexochen@users.noreply.github.com> 6 7 --- 7 - bazel/dependency_imports.bzl | 29 +---------------------------- 8 - bazel/repositories.bzl | 3 --- 9 - 2 files changed, 1 insertion(+), 31 deletions(-) 8 + bazel/dependency_imports.bzl | 2 +- 9 + bazel/repositories.bzl | 3 --- 10 + 2 files changed, 1 insertion(+), 4 deletions(-) 10 11 11 12 diff --git a/bazel/dependency_imports.bzl b/bazel/dependency_imports.bzl 12 - index b743a1936d..afa04ef5c0 100644 13 + index 0e29abb8d0..df19c84755 100644 13 14 --- a/bazel/dependency_imports.bzl 14 15 +++ b/bazel/dependency_imports.bzl 15 - @@ -18,7 +18,7 @@ load("@com_google_cel_cpp//bazel:deps.bzl", "parser_deps") 16 - load("@com_github_chrusty_protoc_gen_jsonschema//:deps.bzl", protoc_gen_jsonschema_go_dependencies = "go_dependencies") 16 + @@ -19,7 +19,7 @@ load("@rules_rust//rust:repositories.bzl", "rules_rust_dependencies", "rust_regi 17 + load("@upb//bazel:workspace_deps.bzl", "upb_deps") 17 18 18 19 # go version for rules_go 19 - -GO_VERSION = "1.18" 20 + -GO_VERSION = "1.20" 20 21 +GO_VERSION = "host" 21 22 22 - JQ_VERSION = "1.6" 23 + JQ_VERSION = "1.7" 23 24 YQ_VERSION = "4.24.4" 24 - @@ -27,7 +27,6 @@ def envoy_dependency_imports(go_version = GO_VERSION, jq_version = JQ_VERSION, y 25 - rules_foreign_cc_dependencies() 26 - go_rules_dependencies() 27 - go_register_toolchains(go_version) 28 - - envoy_download_go_sdks(go_version) 29 - gazelle_dependencies(go_sdk = "go_sdk") 30 - apple_rules_dependencies() 31 - pip_dependencies() 32 - @@ -148,29 +147,3 @@ def envoy_dependency_imports(go_version = GO_VERSION, jq_version = JQ_VERSION, y 33 - ) 34 - 35 - protoc_gen_jsonschema_go_dependencies() 36 - - 37 - -def envoy_download_go_sdks(go_version): 38 - - go_download_sdk( 39 - - name = "go_linux_amd64", 40 - - goos = "linux", 41 - - goarch = "amd64", 42 - - version = go_version, 43 - - ) 44 - - go_download_sdk( 45 - - name = "go_linux_arm64", 46 - - goos = "linux", 47 - - goarch = "arm64", 48 - - version = go_version, 49 - - ) 50 - - go_download_sdk( 51 - - name = "go_darwin_amd64", 52 - - goos = "darwin", 53 - - goarch = "amd64", 54 - - version = go_version, 55 - - ) 56 - - go_download_sdk( 57 - - name = "go_darwin_arm64", 58 - - goos = "darwin", 59 - - goarch = "arm64", 60 - - version = go_version, 61 - - ) 62 25 diff --git a/bazel/repositories.bzl b/bazel/repositories.bzl 63 - index 71667227f7..b10a47d344 100644 26 + index d91aa712bd..6623972286 100644 64 27 --- a/bazel/repositories.bzl 65 28 +++ b/bazel/repositories.bzl 66 - @@ -215,9 +215,6 @@ def _go_deps(skip_targets): 29 + @@ -246,9 +246,6 @@ def _go_deps(skip_targets): 67 30 if "io_bazel_rules_go" not in skip_targets: 68 31 external_http_archive( 69 32 name = "io_bazel_rules_go", ··· 74 37 external_http_archive("bazel_gazelle") 75 38 76 39 -- 77 - 2.42.0 40 + 2.44.0 78 41
+11 -10
pkgs/servers/http/envoy/0003-nixpkgs-use-system-C-C-toolchains.patch
··· 1 - From 6175deb13a2df8bd25a56021ba8754e4be445219 Mon Sep 17 00:00:00 2001 2 - From: Luke Granger-Brown <git@lukegb.com> 3 - Date: Fri, 13 Oct 2023 21:42:51 +0000 4 - Subject: [PATCH 3/3] nixpkgs: use system C/C++ toolchains 1 + From d2fbc618ea040360e08b3c462bcdf0f8f44dd434 Mon Sep 17 00:00:00 2001 2 + From: Paul Meyer <49727155+katexochen@users.noreply.github.com> 3 + Date: Mon, 22 Apr 2024 11:59:22 +0200 4 + Subject: [PATCH 3/4] nixpkgs: use system C/C++ toolchains 5 5 6 + Signed-off-by: Paul Meyer <49727155+katexochen@users.noreply.github.com> 6 7 --- 7 8 bazel/dependency_imports.bzl | 6 +++++- 8 9 1 file changed, 5 insertions(+), 1 deletion(-) 9 10 10 11 diff --git a/bazel/dependency_imports.bzl b/bazel/dependency_imports.bzl 11 - index afa04ef5c0..a5ffaf4ff3 100644 12 + index df19c84755..9732a5d646 100644 12 13 --- a/bazel/dependency_imports.bzl 13 14 +++ b/bazel/dependency_imports.bzl 14 - @@ -24,7 +24,11 @@ JQ_VERSION = "1.6" 15 + @@ -25,7 +25,11 @@ JQ_VERSION = "1.7" 15 16 YQ_VERSION = "4.24.4" 16 17 17 18 def envoy_dependency_imports(go_version = GO_VERSION, jq_version = JQ_VERSION, yq_version = YQ_VERSION): 18 19 - rules_foreign_cc_dependencies() 19 20 + rules_foreign_cc_dependencies( 20 21 + register_default_tools=False, # no prebuilt toolchains 21 - + register_built_tools=False, # nor from source 22 - + register_preinstalled_tools=True, # use host tools (default) 22 + + register_built_tools=False, # nor from source 23 + + register_preinstalled_tools=True, # use host tools (default) 23 24 + ) 24 25 go_rules_dependencies() 25 26 go_register_toolchains(go_version) 26 - gazelle_dependencies(go_sdk = "go_sdk") 27 + if go_version != "host": 27 28 -- 28 - 2.42.0 29 + 2.44.0 29 30
+29
pkgs/servers/http/envoy/0004-nixpkgs-add-cstdint-in-dd-trace-cpp.patch
··· 1 + From dd3509a7d646a970480f94a8e09f377e9783504d Mon Sep 17 00:00:00 2001 2 + From: Malte Poll <1780588+malt3@users.noreply.github.com> 3 + Date: Mon, 22 Apr 2024 16:07:58 +0200 4 + Subject: [PATCH 4/4] nixpkgs: add cstdint in dd-trace-cpp 5 + 6 + --- 7 + bazel/repositories.bzl | 6 +++++- 8 + 1 file changed, 5 insertions(+), 1 deletion(-) 9 + 10 + diff --git a/bazel/repositories.bzl b/bazel/repositories.bzl 11 + index d91aa712bd..467348e773 100644 12 + --- a/bazel/repositories.bzl 13 + +++ b/bazel/repositories.bzl 14 + @@ -772,7 +772,11 @@ def _io_opentelemetry_api_cpp(): 15 + ) 16 + 17 + def _com_github_datadog_dd_trace_cpp(): 18 + - external_http_archive("com_github_datadog_dd_trace_cpp") 19 + + external_http_archive( 20 + + name = "com_github_datadog_dd_trace_cpp", 21 + + patch_args = ["-p1"], 22 + + patches = ["@envoy//bazel:dd_trace_cpp.patch"], 23 + + ) 24 + native.bind( 25 + name = "dd_trace_cpp", 26 + actual = "@com_github_datadog_dd_trace_cpp//:dd_trace_cpp", 27 + -- 28 + 2.42.0 29 +
+25
pkgs/servers/http/envoy/dd_trace_cpp.patch
··· 1 + From 4851a6a722b228ecbfd9df255dab3d8f30bd84b9 Mon Sep 17 00:00:00 2001 2 + From: Malte Poll <1780588+malt3@users.noreply.github.com> 3 + Date: Mon, 22 Apr 2024 15:36:33 +0200 4 + Subject: [PATCH] nixpkgs: add cstdint to fix compilation under GCC 13 5 + 6 + https://gcc.gnu.org/gcc-13/porting_to.html#header-dep-changes 7 + --- 8 + src/datadog/parse_util.h | 1 + 9 + 1 file changed, 1 insertion(+) 10 + 11 + diff --git a/src/datadog/parse_util.h b/src/datadog/parse_util.h 12 + index c603286..c8e4e83 100644 13 + --- a/src/datadog/parse_util.h 14 + +++ b/src/datadog/parse_util.h 15 + @@ -2,6 +2,7 @@ 16 + 17 + // This component provides parsing-related miscellanea. 18 + 19 + +#include <cstdint> 20 + #include <string> 21 + #include <unordered_map> 22 + #include <vector> 23 + -- 24 + 2.42.0 25 +
+18 -14
pkgs/servers/http/envoy/default.nix
··· 25 25 # However, the version string is more useful for end-users. 26 26 # These are contained in a attrset of their own to make it obvious that 27 27 # people should update both. 28 - version = "1.27.5"; 29 - rev = "be4f1cfd31c79fc05651efa2f88429b3c03d1d9e"; 30 - hash = "sha256-+sjNqq91YfyW83aq/8WoSo7Jl5QZUmtWtsajnLLMgDc="; 28 + version = "1.30.1"; 29 + rev = "816188b86a0a52095b116b107f576324082c7c02"; 30 + hash = "sha256-G0rT+OfMk2nitTXcxMr04jwUMYTfb4VBEV1zftalgFU="; 31 31 }; 32 32 33 33 # these need to be updated for any changes to fetchAttrs 34 34 depsHash = { 35 - x86_64-linux = "sha256-4XJgPfNEPmbvAZMLlQcnIaoGzaFtyhsuEshdEjLh0OY="; 36 - aarch64-linux = "sha256-85HLiK+xX/tabazh97J4fWk5KYc7kynbxj/g8HCGTD4="; 35 + x86_64-linux = "sha256-Pj176fQts/H+BlzsVkx+OlUF+4+GHutnNZ5f+eagMmk="; 36 + aarch64-linux = "sha256-5El0WOYTLiBKhYxRXKJFv1m2M8jZlN1cYrJDnRX2wYs="; 37 37 }.${stdenv.system} or (throw "unsupported system ${stdenv.system}"); 38 38 in 39 39 buildBazelPackage { ··· 57 57 sed -i '/javabase=/d' .bazelrc 58 58 sed -i '/"-Werror"/d' bazel/envoy_internal.bzl 59 59 60 - cp ${./protobuf.patch} bazel/protobuf.patch 60 + cp ${./dd_trace_cpp.patch} bazel/dd_trace_cpp.patch 61 61 ''; 62 62 63 63 patches = [ ··· 70 70 # use system C/C++ tools 71 71 ./0003-nixpkgs-use-system-C-C-toolchains.patch 72 72 73 - # bump proxy-wasm-cpp-host until > 1.27.3/1.28.0 74 - (fetchpatch { 75 - url = "https://github.com/envoyproxy/envoy/pull/31451.patch"; 76 - hash = "sha256-n8k7bho3B8Gm0dJbgf43kU7ymvo15aGJ2Twi2xR450g="; 77 - }) 73 + # apply patch to dd-trace-cpp 74 + # remove once a version of dd-trace-cpp is released and adopted by envoy 75 + # that contains https://github.com/DataDog/dd-trace-cpp/commit/3a8e1e9a3cf4e87ef053e954a39dc7a967ac6965 76 + ./0004-nixpkgs-add-cstdint-in-dd-trace-cpp.patch 78 77 ]; 79 78 80 79 nativeBuildInputs = [ ··· 90 89 buildInputs = [ 91 90 linuxHeaders 92 91 ]; 93 - 94 - # external/com_github_grpc_grpc/src/core/ext/transport/binder/transport/binder_transport.cc:756:29: error: format not a string literal and no format arguments [-Werror=format-security] 95 - hardeningDisable = [ "format" ]; 96 92 97 93 fetchAttrs = { 98 94 sha256 = depsHash; ··· 171 167 "--extra_toolchains=@local_jdk//:all" 172 168 "--java_runtime_version=local_jdk" 173 169 "--tool_java_runtime_version=local_jdk" 170 + 171 + # undefined reference to 'grpc_core::*Metadata*::*Memento* 172 + # 173 + # During linking of the final binary, we see undefined references to grpc_core related symbols. 174 + # The missing symbols would be instantiations of a template class from https://github.com/grpc/grpc/blob/v1.59.4/src/core/lib/transport/metadata_batch.h 175 + # "ParseMemento" and "MementoToValue" are only implemented for some types 176 + # and appear unused and unimplemented for the undefined cases reported by the linker. 177 + "--linkopt=-Wl,--unresolved-symbols=ignore-in-object-files" 174 178 175 179 "--define=wasm=${wasmRuntime}" 176 180 ] ++ (lib.optionals stdenv.isAarch64 [
-116
pkgs/servers/http/envoy/protobuf.patch
··· 1 - diff --git a/BUILD.bazel b/BUILD.bazel 2 - index 637882c49..2cb08f1b0 100644 3 - --- a/BUILD.bazel 4 - +++ b/BUILD.bazel 5 - @@ -165,6 +165,8 @@ alias( 6 - visibility = ["//visibility:public"], 7 - ) 8 - 9 - +# Envoy: Patch 10 - + 11 - cc_binary( 12 - name = "protoc", 13 - copts = COPTS, 14 - @@ -173,6 +175,14 @@ cc_binary( 15 - deps = ["//src/google/protobuf/compiler:protoc_lib"], 16 - ) 17 - 18 - +alias( 19 - + name = "protobuf_python_genproto", 20 - + actual = "//python:well_known_types_py_pb2_genproto", 21 - + visibility = ["//visibility:public"], 22 - +) 23 - + 24 - +# /Envoy: Patch 25 - + 26 - cc_binary( 27 - name = "protoc_static", 28 - copts = COPTS, 29 - diff --git a/python/google/protobuf/__init__.py b/python/google/protobuf/__init__.py 30 - index 88de4cf8a..b3e046997 100755 31 - --- a/python/google/protobuf/__init__.py 32 - +++ b/python/google/protobuf/__init__.py 33 - @@ -31,3 +31,10 @@ 34 - # Copyright 2007 Google Inc. All Rights Reserved. 35 - 36 - __version__ = '4.23.1' 37 - + 38 - + 39 - +if __name__ != '__main__': 40 - + try: 41 - + __import__('pkg_resources').declare_namespace(__name__) 42 - + except ImportError: 43 - + __path__ = __import__('pkgutil').extend_path(__path__, __name__) 44 - diff --git a/src/google/protobuf/compiler/BUILD.bazel b/src/google/protobuf/compiler/BUILD.bazel 45 - index a2171c806..8aec6187f 100644 46 - --- a/src/google/protobuf/compiler/BUILD.bazel 47 - +++ b/src/google/protobuf/compiler/BUILD.bazel 48 - @@ -306,7 +306,7 @@ cc_library( 49 - srcs = ["retention.cc"], 50 - hdrs = ["retention.h"], 51 - include_prefix = "google/protobuf/compiler", 52 - - visibility = ["//src/google/protobuf:__subpackages__"], 53 - + visibility = ["//visibility:public"], 54 - deps = [ 55 - "//src/google/protobuf:protobuf_nowkt", 56 - "@com_google_absl//absl/types:span", 57 - diff --git a/src/google/protobuf/io/BUILD.bazel b/src/google/protobuf/io/BUILD.bazel 58 - index 8f39625c2..2c2c73dcd 100644 59 - --- a/src/google/protobuf/io/BUILD.bazel 60 - +++ b/src/google/protobuf/io/BUILD.bazel 61 - @@ -142,7 +142,7 @@ cc_library( 62 - "@com_google_absl//absl/log:absl_log", 63 - ] + select({ 64 - "//build_defs:config_msvc": [], 65 - - "//conditions:default": ["@zlib//:zlib"], 66 - + "//conditions:default": ["//external:zlib"], 67 - }), 68 - ) 69 - 70 - diff --git a/src/google/protobuf/map.h b/src/google/protobuf/map.h 71 - index 869ebf100..fec92e2b1 100644 72 - --- a/src/google/protobuf/map.h 73 - +++ b/src/google/protobuf/map.h 74 - @@ -883,7 +883,7 @@ class KeyMapBase : public UntypedMapBase { 75 - TreeConvert(b); 76 - } 77 - ABSL_DCHECK(TableEntryIsTree(b)) 78 - - << (void*)table_[b] << " " << (uintptr_t)table_[b]; 79 - + << reinterpret_cast<void*>(table_[b]) << " " << static_cast<uintptr_t>(table_[b]); 80 - InsertUniqueInTree(b, node); 81 - index_of_first_non_null_ = (std::min)(index_of_first_non_null_, b); 82 - } 83 - diff --git a/src/google/protobuf/map_field.h b/src/google/protobuf/map_field.h 84 - index 70b12b1e7..b8f46db45 100644 85 - --- a/src/google/protobuf/map_field.h 86 - +++ b/src/google/protobuf/map_field.h 87 - @@ -345,7 +345,7 @@ class PROTOBUF_EXPORT MapFieldBase : public MapFieldBaseForParse { 88 - 89 - protected: 90 - // "protected" stops users from deleting a `MapFieldBase *` 91 - - ~MapFieldBase(); 92 - + virtual ~MapFieldBase(); 93 - 94 - public: 95 - // Returns reference to internal repeated field. Data written using 96 - diff --git a/src/google/protobuf/port_def.inc b/src/google/protobuf/port_def.inc 97 - index 1c6a24945..6186c2ad1 100644 98 - --- a/src/google/protobuf/port_def.inc 99 - +++ b/src/google/protobuf/port_def.inc 100 - @@ -1004,7 +1004,7 @@ static_assert(PROTOBUF_ABSL_MIN(20230125, 3), 101 - #pragma clang diagnostic ignored "-Wshorten-64-to-32" 102 - // Turn on -Wdeprecated-enum-enum-conversion. This deprecation comes in C++20 103 - // via http://wg21.link/p1120r0. 104 - -#pragma clang diagnostic error "-Wdeprecated-enum-enum-conversion" 105 - +// #pragma clang diagnostic error "-Wdeprecated-enum-enum-conversion" 106 - // This error has been generally flaky, but we need to disable it specifically 107 - // to fix https://github.com/protocolbuffers/protobuf/issues/12313 108 - #pragma clang diagnostic ignored "-Wunused-parameter" 109 - @@ -1062,6 +1062,7 @@ static_assert(PROTOBUF_ABSL_MIN(20230125, 3), 110 - #pragma warning(disable: 4125) 111 - #endif 112 - 113 - +#pragma GCC diagnostic ignored "-Wundef" 114 - #if PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII 115 - #define PROTOBUF_DEBUG true 116 - #else