Skip to content

Commit 6cfa3cf

Browse files
committed
envoy: allow overriding depsHash externally
This avoids needing to patch the package in order to change some of the configuration options. This is a bit of a cop out, but it's the easiest thing to do right now without doing a cross-product fetch of all of the configurations we want to support.
1 parent 6c95958 commit 6cfa3cf

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

pkgs/by-name/en/envoy/package.nix

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@
2727

2828
# v8 (upstream default), wavm, wamr, wasmtime, disabled
2929
wasmRuntime ? "wamr",
30+
31+
# Allows overriding the deps hash used for building - you will likely need to
32+
# set this if you have changed the 'wasmRuntime' setting.
33+
depsHash ? null,
3034
}:
3135

3236
let
@@ -41,12 +45,15 @@ let
4145
};
4246

4347
# these need to be updated for any changes to fetchAttrs
44-
depsHash =
45-
{
46-
x86_64-linux = "sha256-E6yUSd00ngmjaMds+9UVZLtcYhzeS8F9eSIkC1mZSps=";
47-
aarch64-linux = "sha256-ivboOrV/uORKVHRL3685aopcElGvzsxgVcUmYsBwzXY=";
48-
}
49-
.${stdenv.system} or (throw "unsupported system ${stdenv.system}");
48+
depsHash' =
49+
if depsHash != null then
50+
depsHash
51+
else
52+
{
53+
x86_64-linux = "sha256-E6yUSd00ngmjaMds+9UVZLtcYhzeS8F9eSIkC1mZSps=";
54+
aarch64-linux = "sha256-ivboOrV/uORKVHRL3685aopcElGvzsxgVcUmYsBwzXY=";
55+
}
56+
.${stdenv.system} or (throw "unsupported system ${stdenv.system}");
5057

5158
python3 = python312;
5259

@@ -127,7 +134,7 @@ buildBazelPackage rec {
127134
buildInputs = [ linuxHeaders ];
128135

129136
fetchAttrs = {
130-
sha256 = depsHash;
137+
sha256 = depsHash';
131138
env.CARGO_BAZEL_REPIN = true;
132139
dontUseCmakeConfigure = true;
133140
dontUseGnConfigure = true;

0 commit comments

Comments
 (0)