···9 1 file changed, 3 insertions(+), 3 deletions(-)
1011diff --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",
···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"],
···9 1 file changed, 3 insertions(+), 3 deletions(-)
1011diff --git a/bazel/repository_locations.bzl b/bazel/repository_locations.bzl
12+index 1293e432c815071ed55721760e583ac0e9f40108..664f8c8e2bf4641e7862e9321fd6f91d162c3c17 100644
13--- a/bazel/repository_locations.bzl
14+++ b/bazel/repository_locations.bzl
15+@@ -1528,8 +1528,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",
···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+@@ -1540,7 +1540,7 @@ REPOSITORY_LOCATIONS_SPEC = dict(
27 "dataplane_ext",
28 ],
29 extensions = ["envoy.wasm.runtime.wasmtime"],
+32-12
pkgs/by-name/en/envoy/package.nix
···1{
2 lib,
3- bazel_6,
4 bazel-gazelle,
5 buildBazelPackage,
6 fetchFromGitHub,
···16 jdk,
17 ninja,
18 patchelf,
19- python3,
20 linuxHeaders,
21 nixosTests,
22 runCommandLocal,
···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.2";
38- rev = "c657e59fac461e406c8fdbe57ced833ddc236ee1";
39- hash = "sha256-f9JsgHEyOg1ZoEb7d3gy3+qoovpA3oOx6O8yL0U8mhI=";
40 };
4142 # these need to be updated for any changes to fetchAttrs
43 depsHash =
44 {
45- x86_64-linux = "sha256-CczmVD/3tWR3LygXc3cTAyrMPZUTajqtRew85wBM5mY=";
46- aarch64-linux = "sha256-GemlfXHlaHPn1/aBxj2Ve9tuwsEdlQQCU1v57378Dgs=";
47 }
48 .${stdenv.system} or (throw "unsupported system ${stdenv.system}");
490050in
51buildBazelPackage rec {
52 pname = "envoy";
53 inherit (srcVer) version;
54- bazel = bazel_6;
5556 src = applyPatches {
57 src = fetchFromGitHub {
···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",'
99100- # 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"' ""
0105106 substitute ${./rules_rust_extra.patch} bazel/nix/rules_rust_extra.patch \
107 --subst-var-by bash "$(type -p bash)"
···130 postPatch = ''
131 ${postPatch}
13200133 substituteInPlace bazel/dependency_imports.bzl \
134 --replace-fail 'crate_universe_dependencies(' 'crate_universe_dependencies(bootstrap=True, ' \
135 --replace-fail 'crates_repository(' 'crates_repository(generator="@@cargo_bazel_bootstrap//:cargo-bazel", '
136 '';
137 preInstall = ''
0000000000138 # Strip out the path to the build location (by deleting the comment line).
139 find $bazelOut/external -name requirements.bzl | while read requirements; do
140 sed -i '/# Generated from /d' "$requirements"
···151 $bazelOut/external/rules_rust/util/process_wrapper/private/process_wrapper.sh \
152 $bazelOut/external/rules_rust/crate_universe/src/metadata/cargo_tree_rustc_wrapper.sh
153154- rm -r $bazelOut/external/go_sdk
155 rm -r $bazelOut/external/local_jdk
156 rm -r $bazelOut/external/bazel_gazelle_go_repository_tools/bin
157···175 dontUseCmakeConfigure = true;
176 dontUseGnConfigure = true;
177 dontUseNinjaInstall = true;
0178 preConfigure = ''
000179 # Make executables work, for the most part.
180 find $bazelOut/external -type f -executable | while read execbin; do
181 file "$execbin" | grep -q ': ELF .*, dynamically linked,' || continue
···211 removeLocalConfigCc = true;
212 removeLocal = false;
213 bazelTargets = [ "//source/exe:envoy-static" ];
000214 bazelBuildFlags = [
215 "-c opt"
216 "--spawn_strategy=standalone"
···1{
2 lib,
3+ bazel_7,
4 bazel-gazelle,
5 buildBazelPackage,
6 fetchFromGitHub,
···16 jdk,
17 ninja,
18 patchelf,
19+ python312,
20 linuxHeaders,
21 nixosTests,
22 runCommandLocal,
···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.35.1";
38+ rev = "6e9539d0366baf85baf9acb3e618cb3384765f13";
39+ hash = "sha256-c1c8j/BCRrvAEqjt4EQ/d7zsM1zUe4Qr5EHzpuGblIk=";
40 };
4142 # these need to be updated for any changes to fetchAttrs
43 depsHash =
44 {
45+ x86_64-linux = "sha256-E6yUSd00ngmjaMds+9UVZLtcYhzeS8F9eSIkC1mZSps=";
46+ aarch64-linux = "sha256-ivboOrV/uORKVHRL3685aopcElGvzsxgVcUmYsBwzXY=";
47 }
48 .${stdenv.system} or (throw "unsupported system ${stdenv.system}");
4950+ python3 = python312;
51+52in
53buildBazelPackage rec {
54 pname = "envoy";
55 inherit (srcVer) version;
56+ bazel = bazel_7;
5758 src = applyPatches {
59 src = fetchFromGitHub {
···99 --replace-fail 'crate_universe_dependencies()' 'crate_universe_dependencies(rust_toolchain_cargo_template="@@//bazel/nix:cargo", rust_toolchain_rustc_template="@@//bazel/nix:rustc")' \
100 --replace-fail 'crates_repository(' 'crates_repository(rust_toolchain_cargo_template="@@//bazel/nix:cargo", rust_toolchain_rustc_template="@@//bazel/nix:rustc",'
101102+ # patch rules_rust for envoy specifics
0103 cp ${./rules_rust.patch} bazel/rules_rust.patch
104 substituteInPlace bazel/repositories.bzl \
105+ --replace-fail ', "@envoy//bazel:rules_rust_ppc64le.patch"' "" \
106+ --replace-fail '"@envoy//bazel:emsdk.patch"' ""
107108 substitute ${./rules_rust_extra.patch} bazel/nix/rules_rust_extra.patch \
109 --subst-var-by bash "$(type -p bash)"
···132 postPatch = ''
133 ${postPatch}
134135+ echo "common --repository_cache=\"$bazelOut/external/repository_cache\"" >> .bazelrc
136+137 substituteInPlace bazel/dependency_imports.bzl \
138 --replace-fail 'crate_universe_dependencies(' 'crate_universe_dependencies(bootstrap=True, ' \
139 --replace-fail 'crates_repository(' 'crates_repository(generator="@@cargo_bazel_bootstrap//:cargo-bazel", '
140 '';
141 preInstall = ''
142+ mkdir $NIX_BUILD_TOP/empty
143+ pushd $NIX_BUILD_TOP/empty
144+ touch MODULE.bazel
145+ # Unfortunately, we need to fetch a lot of irrelevant junk to make this work.
146+ # This really bloats the size of the FOD.
147+ # TODO: lukegb - figure out how to make this suck less.
148+ bazel fetch --repository_cache="$bazelOut/external/repository_cache"
149+ bazel sync --repository_cache="$bazelOut/external/repository_cache"
150+ popd
151+152 # Strip out the path to the build location (by deleting the comment line).
153 find $bazelOut/external -name requirements.bzl | while read requirements; do
154 sed -i '/# Generated from /d' "$requirements"
···165 $bazelOut/external/rules_rust/util/process_wrapper/private/process_wrapper.sh \
166 $bazelOut/external/rules_rust/crate_universe/src/metadata/cargo_tree_rustc_wrapper.sh
1670168 rm -r $bazelOut/external/local_jdk
169 rm -r $bazelOut/external/bazel_gazelle_go_repository_tools/bin
170···188 dontUseCmakeConfigure = true;
189 dontUseGnConfigure = true;
190 dontUseNinjaInstall = true;
191+ bazel = null;
192 preConfigure = ''
193+ echo "common --repository_cache=\"$bazelOut/external/repository_cache\"" >> .bazelrc
194+ echo "common --repository_disable_download" >> .bazelrc
195+196 # Make executables work, for the most part.
197 find $bazelOut/external -type f -executable | while read execbin; do
198 file "$execbin" | grep -q ': ELF .*, dynamically linked,' || continue
···228 removeLocalConfigCc = true;
229 removeLocal = false;
230 bazelTargets = [ "//source/exe:envoy-static" ];
231+ bazelFlags = [
232+ "--repo_env=BAZEL_HTTP_RULES_URLS_AS_DEFAULT_CANONICAL_ID=0"
233+ ];
234 bazelBuildFlags = [
235 "-c opt"
236 "--spawn_strategy=standalone"
-51
pkgs/by-name/en/envoy/rules_rust.patch
···56Signed-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(-)
1314-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(
63diff --git crate_universe/src/lockfile.rs crate_universe/src/lockfile.rs
64index 3e0ce6265fda6fbdd9e3e989e3e4e4443b615b8c..0fafcea8fbc7a590676d34d2c4ca8c413b953955 100644
65--- crate_universe/src/lockfile.rs