envoy: 1.33.0 -> 1.34.0 (#399369)

authored by

Luke Granger-Brown and committed by
GitHub
a8b3c0f4 7a5ae347

+165 -12
+1
pkgs/by-name/en/envoy/0001-nixpkgs-use-system-Python.patch
··· 4 Subject: [PATCH] nixpkgs: use system Python 5 6 Signed-off-by: Paul Meyer <49727155+katexochen@users.noreply.github.com> 7 --- 8 bazel/python_dependencies.bzl | 9 ++++----- 9 bazel/repositories_extra.bzl | 17 +----------------
··· 4 Subject: [PATCH] nixpkgs: use system Python 5 6 Signed-off-by: Paul Meyer <49727155+katexochen@users.noreply.github.com> 7 + Signed-off-by: Luke Granger-Brown <git@lukegb.com> 8 --- 9 bazel/python_dependencies.bzl | 9 ++++----- 10 bazel/repositories_extra.bzl | 17 +----------------
+3 -2
pkgs/by-name/en/envoy/0002-nixpkgs-use-system-Go.patch
··· 4 Subject: [PATCH] nixpkgs: use system Go 5 6 Signed-off-by: Paul Meyer <49727155+katexochen@users.noreply.github.com> 7 --- 8 bazel/dependency_imports.bzl | 2 +- 9 1 file changed, 1 insertion(+), 1 deletion(-) 10 11 diff --git a/bazel/dependency_imports.bzl b/bazel/dependency_imports.bzl 12 - index c68eb4bf3ed2d39d46d38d7bd0eeab2c74a507fa..addee4f6af74ea78ae778b73384e01db83ac6694 100644 13 --- a/bazel/dependency_imports.bzl 14 +++ b/bazel/dependency_imports.bzl 15 - @@ -20,7 +20,7 @@ load("@rules_rust//rust:defs.bzl", "rust_common") 16 load("@rules_rust//rust:repositories.bzl", "rules_rust_dependencies", "rust_register_toolchains", "rust_repository_set") 17 18 # go version for rules_go
··· 4 Subject: [PATCH] nixpkgs: use system Go 5 6 Signed-off-by: Paul Meyer <49727155+katexochen@users.noreply.github.com> 7 + Signed-off-by: Luke Granger-Brown <git@lukegb.com> 8 --- 9 bazel/dependency_imports.bzl | 2 +- 10 1 file changed, 1 insertion(+), 1 deletion(-) 11 12 diff --git a/bazel/dependency_imports.bzl b/bazel/dependency_imports.bzl 13 + index aef33aa103dc1136e63e165fb9ee6a267f52ba54..c5aefca14b729b548c4e90857202eb82576b507d 100644 14 --- a/bazel/dependency_imports.bzl 15 +++ b/bazel/dependency_imports.bzl 16 + @@ -22,7 +22,7 @@ load("@rules_rust//rust:defs.bzl", "rust_common") 17 load("@rules_rust//rust:repositories.bzl", "rules_rust_dependencies", "rust_register_toolchains", "rust_repository_set") 18 19 # go version for rules_go
+5 -4
pkgs/by-name/en/envoy/0003-nixpkgs-use-system-C-C-toolchains.patch
··· 4 Subject: [PATCH] nixpkgs: use system C/C++ toolchains 5 6 Signed-off-by: Paul Meyer <49727155+katexochen@users.noreply.github.com> 7 --- 8 bazel/dependency_imports.bzl | 6 +++++- 9 1 file changed, 5 insertions(+), 1 deletion(-) 10 11 diff --git a/bazel/dependency_imports.bzl b/bazel/dependency_imports.bzl 12 - index addee4f6af74ea78ae778b73384e01db83ac6694..dc1967e43b2b71358d2767a3d83b52819987290d 100644 13 --- a/bazel/dependency_imports.bzl 14 +++ b/bazel/dependency_imports.bzl 15 - @@ -26,7 +26,11 @@ JQ_VERSION = "1.7" 16 - YQ_VERSION = "4.24.4" 17 18 - def envoy_dependency_imports(go_version = GO_VERSION, jq_version = JQ_VERSION, yq_version = YQ_VERSION): 19 - rules_foreign_cc_dependencies() 20 + rules_foreign_cc_dependencies( 21 + register_default_tools=False, # no prebuilt toolchains
··· 4 Subject: [PATCH] nixpkgs: use system C/C++ toolchains 5 6 Signed-off-by: Paul Meyer <49727155+katexochen@users.noreply.github.com> 7 + Signed-off-by: Luke Granger-Brown <git@lukegb.com> 8 --- 9 bazel/dependency_imports.bzl | 6 +++++- 10 1 file changed, 5 insertions(+), 1 deletion(-) 11 12 diff --git a/bazel/dependency_imports.bzl b/bazel/dependency_imports.bzl 13 + index c5aefca14b729b548c4e90857202eb82576b507d..6938ce63abb53661e8d1fb71eaaab03ba0cc37c6 100644 14 --- a/bazel/dependency_imports.bzl 15 +++ b/bazel/dependency_imports.bzl 16 + @@ -30,7 +30,11 @@ YQ_VERSION = "4.24.4" 17 + BUF_VERSION = "v1.50.0" 18 19 + def envoy_dependency_imports(go_version = GO_VERSION, jq_version = JQ_VERSION, yq_version = YQ_VERSION, buf_version = BUF_VERSION): 20 - rules_foreign_cc_dependencies() 21 + rules_foreign_cc_dependencies( 22 + register_default_tools=False, # no prebuilt toolchains
+34
pkgs/by-name/en/envoy/0004-nixpkgs-bump-rules_rust-to-0.60.0.patch
···
··· 1 + From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 2 + From: Luke Granger-Brown <git@lukegb.com> 3 + Date: Thu, 17 Apr 2025 02:40:18 +0100 4 + Subject: [PATCH] nixpkgs: bump rules_rust to 0.60.0 5 + 6 + Signed-off-by: Luke Granger-Brown <git@lukegb.com> 7 + --- 8 + bazel/repository_locations.bzl | 6 +++--- 9 + 1 file changed, 3 insertions(+), 3 deletions(-) 10 + 11 + diff --git a/bazel/repository_locations.bzl b/bazel/repository_locations.bzl 12 + index 6904bc93bdda3ee2308f13d61e62295fa11d799b..e4574878a566cceb4dc2343f3cade0350ea5e5ff 100644 13 + --- a/bazel/repository_locations.bzl 14 + +++ b/bazel/repository_locations.bzl 15 + @@ -1465,8 +1465,8 @@ REPOSITORY_LOCATIONS_SPEC = dict( 16 + project_name = "Bazel rust rules", 17 + project_desc = "Bazel rust rules (used by Wasm)", 18 + project_url = "https://github.com/bazelbuild/rules_rust", 19 + - version = "0.56.0", 20 + - sha256 = "f1306aac0b258b790df01ad9abc6abb0df0b65416c74b4ef27f4aab298780a64", 21 + + version = "0.60.0", 22 + + sha256 = "7825214ccad7c2482cb490ac91dbc1e88b30223062796ce328aca893b74ae342", 23 + # Note: rules_rust should point to the releases, not archive to avoid the hassle of bootstrapping in crate_universe. 24 + # This is described in https://bazelbuild.github.io/rules_rust/crate_universe.html#setup, otherwise bootstrap 25 + # is required which in turn requires a system CC toolchains, not the bazel controlled ones. 26 + @@ -1477,7 +1477,7 @@ REPOSITORY_LOCATIONS_SPEC = dict( 27 + "dataplane_ext", 28 + ], 29 + extensions = ["envoy.wasm.runtime.wasmtime"], 30 + - release_date = "2024-12-16", 31 + + release_date = "2025-04-08", 32 + cpe = "N/A", 33 + license = "Apache-2.0", 34 + license_url = "https://github.com/bazelbuild/rules_rust/blob/{version}/LICENSE.txt",
+21 -6
pkgs/by-name/en/envoy/package.nix
··· 34 # However, the version string is more useful for end-users. 35 # These are contained in a attrset of their own to make it obvious that 36 # people should update both. 37 - version = "1.33.0"; 38 - rev = "b0f43d67aa25c1b03c97186a200cc187f4c22db3"; 39 - hash = "sha256-zqekRpOlaA2IrwwFUEwASa1uokET98h5sr7EwzWgcbU="; 40 }; 41 42 # these need to be updated for any changes to fetchAttrs 43 depsHash = 44 { 45 - x86_64-linux = "sha256-4CQkHlXbDpRiqzeyserVf9PpLx3ME7TtZ2H88ggog6U="; 46 - aarch64-linux = "sha256-FxkfBWiG0NIInl28w+l4YvaV2VFuCtjn5VBAKvJoxM8="; 47 } 48 .${stdenv.system} or (throw "unsupported system ${stdenv.system}"); 49 ··· 59 repo = "envoy"; 60 inherit (srcVer) hash rev; 61 }; 62 patches = [ 63 # use system Python, not bazel-fetched binary Python 64 ./0001-nixpkgs-use-system-Python.patch ··· 68 69 # use system C/C++ tools 70 ./0003-nixpkgs-use-system-C-C-toolchains.patch 71 ]; 72 postPatch = '' 73 chmod -R +w . ··· 91 substituteInPlace bazel/dependency_imports.bzl \ 92 --replace-fail 'crate_universe_dependencies()' 'crate_universe_dependencies(rust_toolchain_cargo_template="@@//bazel/nix:cargo", rust_toolchain_rustc_template="@@//bazel/nix:rustc")' \ 93 --replace-fail 'crates_repository(' 'crates_repository(rust_toolchain_cargo_template="@@//bazel/nix:cargo", rust_toolchain_rustc_template="@@//bazel/nix:rustc",' 94 95 substitute ${./rules_rust_extra.patch} bazel/nix/rules_rust_extra.patch \ 96 --subst-var-by bash "$(type -p bash)" ··· 133 sed -i \ 134 -e 's,${python3},__NIXPYTHON__,' \ 135 -e 's,${stdenv.shellPackage},__NIXSHELL__,' \ 136 $bazelOut/external/com_github_luajit_luajit/build.py \ 137 $bazelOut/external/local_config_sh/BUILD \ 138 $bazelOut/external/*_pip3/BUILD.bazel \ ··· 180 sed -i \ 181 -e 's,__NIXPYTHON__,${python3},' \ 182 -e 's,__NIXSHELL__,${stdenv.shellPackage},' \ 183 $bazelOut/external/com_github_luajit_luajit/build.py \ 184 $bazelOut/external/local_config_sh/BUILD \ 185 - $bazelOut/external/*_pip3/BUILD.bazel 186 187 # Install repinned rules_rust lockfile 188 cp $bazelOut/external/Cargo.Bazel.lock source/extensions/dynamic_modules/sdk/rust/Cargo.Bazel.lock
··· 34 # However, the version string is more useful for end-users. 35 # These are contained in a attrset of their own to make it obvious that 36 # people should update both. 37 + version = "1.34.0"; 38 + rev = "d7809ba2b07fd869d49bfb122b27f6a7977b4d94"; 39 + hash = "sha256-SKdUrBXe0E3fMo73NROFO9Ck5FZidF/awP+QRA5t3VM="; 40 }; 41 42 # these need to be updated for any changes to fetchAttrs 43 depsHash = 44 { 45 + x86_64-linux = "sha256-CiP9qH8/+nNZM8BNz84eVwWphVyDNo2KOYcK0wOsXn0="; 46 + aarch64-linux = "sha256-9HGg68R546JY1EOm22tg9CuPt0nU+FooFcLG9A2hkzE="; 47 } 48 .${stdenv.system} or (throw "unsupported system ${stdenv.system}"); 49 ··· 59 repo = "envoy"; 60 inherit (srcVer) hash rev; 61 }; 62 + # By convention, these patches are generated like: 63 + # git format-patch --zero-commit --signoff --no-numbered --minimal --full-index --no-signature 64 patches = [ 65 # use system Python, not bazel-fetched binary Python 66 ./0001-nixpkgs-use-system-Python.patch ··· 70 71 # use system C/C++ tools 72 ./0003-nixpkgs-use-system-C-C-toolchains.patch 73 + 74 + # bump rules_rust to support newer Rust 75 + ./0004-nixpkgs-bump-rules_rust-to-0.60.0.patch 76 ]; 77 postPatch = '' 78 chmod -R +w . ··· 96 substituteInPlace bazel/dependency_imports.bzl \ 97 --replace-fail 'crate_universe_dependencies()' 'crate_universe_dependencies(rust_toolchain_cargo_template="@@//bazel/nix:cargo", rust_toolchain_rustc_template="@@//bazel/nix:rustc")' \ 98 --replace-fail 'crates_repository(' 'crates_repository(rust_toolchain_cargo_template="@@//bazel/nix:cargo", rust_toolchain_rustc_template="@@//bazel/nix:rustc",' 99 + 100 + # patch rules_rust for envoy specifics, but also to support old Bazel 101 + # (Bazel 6 doesn't have ctx.watch, but ctx.path is sufficient for our use) 102 + cp ${./rules_rust.patch} bazel/rules_rust.patch 103 + substituteInPlace bazel/repositories.bzl \ 104 + --replace-fail ', "@envoy//bazel:rules_rust_ppc64le.patch"' "" 105 106 substitute ${./rules_rust_extra.patch} bazel/nix/rules_rust_extra.patch \ 107 --subst-var-by bash "$(type -p bash)" ··· 144 sed -i \ 145 -e 's,${python3},__NIXPYTHON__,' \ 146 -e 's,${stdenv.shellPackage},__NIXSHELL__,' \ 147 + -e 's,${builtins.storeDir}/[^/]\+/bin/bash,__NIXBASH__,' \ 148 $bazelOut/external/com_github_luajit_luajit/build.py \ 149 $bazelOut/external/local_config_sh/BUILD \ 150 $bazelOut/external/*_pip3/BUILD.bazel \ ··· 192 sed -i \ 193 -e 's,__NIXPYTHON__,${python3},' \ 194 -e 's,__NIXSHELL__,${stdenv.shellPackage},' \ 195 + -e 's,__NIXBASH__,${stdenv.shell},' \ 196 $bazelOut/external/com_github_luajit_luajit/build.py \ 197 $bazelOut/external/local_config_sh/BUILD \ 198 + $bazelOut/external/*_pip3/BUILD.bazel \ 199 + $bazelOut/external/rules_rust/util/process_wrapper/private/process_wrapper.sh \ 200 + $bazelOut/external/rules_rust/crate_universe/src/metadata/cargo_tree_rustc_wrapper.sh 201 202 # Install repinned rules_rust lockfile 203 cp $bazelOut/external/Cargo.Bazel.lock source/extensions/dynamic_modules/sdk/rust/Cargo.Bazel.lock
+101
pkgs/by-name/en/envoy/rules_rust.patch
···
··· 1 + From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 2 + From: Luke Granger-Brown <git@lukegb.com> 3 + Date: Thu, 17 Apr 2025 02:44:24 +0100 4 + Subject: [PATCH] rules_rust base 5 + 6 + Signed-off-by: Luke Granger-Brown <git@lukegb.com> 7 + --- 8 + cargo/private/cargo_bootstrap.bzl | 8 ++++---- 9 + crate_universe/extensions.bzl | 10 +++++----- 10 + crate_universe/src/lockfile.rs | 4 ++-- 11 + rust/private/rustc.bzl | 4 ++-- 12 + 4 files changed, 13 insertions(+), 13 deletions(-) 13 + 14 + diff --git cargo/private/cargo_bootstrap.bzl cargo/private/cargo_bootstrap.bzl 15 + index a8021c49d62037ef32c7c64d5bb4a5efe3a8b4aa..f63d7c23ae0bddc9f3fece347a3a2b5b0afe6d8d 100644 16 + --- cargo/private/cargo_bootstrap.bzl 17 + +++ cargo/private/cargo_bootstrap.bzl 18 + @@ -173,13 +173,13 @@ def _detect_changes(repository_ctx): 19 + # 'consumed' which means changes to it will trigger rebuilds 20 + 21 + for src in repository_ctx.attr.srcs: 22 + - repository_ctx.watch(src) 23 + + repository_ctx.path(src) 24 + 25 + - repository_ctx.watch(repository_ctx.attr.cargo_lockfile) 26 + - repository_ctx.watch(repository_ctx.attr.cargo_toml) 27 + + repository_ctx.path(repository_ctx.attr.cargo_lockfile) 28 + + repository_ctx.path(repository_ctx.attr.cargo_toml) 29 + 30 + if repository_ctx.attr.cargo_config: 31 + - repository_ctx.watch(repository_ctx.attr.cargo_config) 32 + + repository_ctx.path(repository_ctx.attr.cargo_config) 33 + 34 + def _cargo_bootstrap_repository_impl(repository_ctx): 35 + # Pretend to Bazel that this rule's input files have been used, so that it will re-run the rule if they change. 36 + diff --git crate_universe/extensions.bzl crate_universe/extensions.bzl 37 + index a749b10c8d469bd316d78034059c94b1fd98dbef..8f8c84dac1ec330d5e8e6abbd930387cb6c9f29e 100644 38 + --- crate_universe/extensions.bzl 39 + +++ crate_universe/extensions.bzl 40 + @@ -957,17 +957,17 @@ def _crate_impl(module_ctx): 41 + fail("Spec specified for repo {}, but the module defined repositories {}".format(repo, local_repos)) 42 + 43 + for cfg in mod.tags.from_cargo + mod.tags.from_specs: 44 + - # Preload all external repositories. Calling `module_ctx.watch` will cause restarts of the implementation 45 + + # Preload all external repositories. Calling `module_ctx.path` will cause restarts of the implementation 46 + # function of the module extension when the file has changed. 47 + if cfg.cargo_lockfile: 48 + - module_ctx.watch(cfg.cargo_lockfile) 49 + + module_ctx.path(cfg.cargo_lockfile) 50 + if cfg.lockfile: 51 + - module_ctx.watch(cfg.lockfile) 52 + + module_ctx.path(cfg.lockfile) 53 + if cfg.cargo_config: 54 + - module_ctx.watch(cfg.cargo_config) 55 + + module_ctx.path(cfg.cargo_config) 56 + if hasattr(cfg, "manifests"): 57 + for m in cfg.manifests: 58 + - module_ctx.watch(m) 59 + + module_ctx.path(m) 60 + 61 + cargo_path, rustc_path = _get_host_cargo_rustc(module_ctx, host_triple, cfg.host_tools_repo) 62 + cargo_bazel_fn = new_cargo_bazel_fn( 63 + diff --git crate_universe/src/lockfile.rs crate_universe/src/lockfile.rs 64 + index 3e0ce6265fda6fbdd9e3e989e3e4e4443b615b8c..0fafcea8fbc7a590676d34d2c4ca8c413b953955 100644 65 + --- crate_universe/src/lockfile.rs 66 + +++ crate_universe/src/lockfile.rs 67 + @@ -146,10 +146,10 @@ impl Digest { 68 + )); 69 + hasher.update(b"\0"); 70 + 71 + - hasher.update(Digest::compute_single_hash(cargo_version, "Cargo version")); 72 + + hasher.update(Digest::compute_single_hash("hermetic", "Cargo version")); 73 + hasher.update(b"\0"); 74 + 75 + - hasher.update(Digest::compute_single_hash(rustc_version, "Rustc version")); 76 + + hasher.update(Digest::compute_single_hash("hermetic", "Rustc version")); 77 + hasher.update(b"\0"); 78 + 79 + let hash = hasher.finalize().encode_hex::<String>(); 80 + diff --git rust/private/rustc.bzl rust/private/rustc.bzl 81 + index d78c28902c8f73ae655b8f6b5df3db5a1805aa19..321a24a946c33d5e3452758a72a77b52d5a3eccf 100644 82 + --- rust/private/rustc.bzl 83 + +++ rust/private/rustc.bzl 84 + @@ -1059,7 +1059,7 @@ def construct_arguments( 85 + 86 + if toolchain.llvm_cov and ctx.configuration.coverage_enabled: 87 + # https://doc.rust-lang.org/rustc/instrument-coverage.html 88 + - rustc_flags.add("--codegen=instrument-coverage") 89 + + pass 90 + 91 + if toolchain._experimental_link_std_dylib: 92 + rustc_flags.add("--codegen=prefer-dynamic") 93 + @@ -1563,7 +1563,7 @@ def rustc_compile_action( 94 + }) 95 + crate_info = rust_common.create_crate_info(**crate_info_dict) 96 + 97 + - if crate_info.type in ["staticlib", "cdylib"]: 98 + + if crate_info.type in ["staticlib", "cdylib"] and not out_binary: 99 + # These rules are not supposed to be depended on by other rust targets, and 100 + # as such they shouldn't provide a CrateInfo. However, one may still want to 101 + # write a rust_test for them, so we provide the CrateInfo wrapped in a provider