Skip to content

Commit 0b29270

Browse files
committed
envoy: add test to check deps derivation for storepaths
Signed-off-by: Paul Meyer <[email protected]>
1 parent 56de4ac commit 0b29270

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

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

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@
1919
python3,
2020
linuxHeaders,
2121
nixosTests,
22+
runCommandLocal,
23+
gnutar,
24+
gnugrep,
25+
envoy,
2226

2327
# v8 (upstream default), wavm, wamr, wasmtime, disabled
2428
wasmRuntime ? "wamr",
@@ -242,6 +246,38 @@ buildBazelPackage rec {
242246
envoy = nixosTests.envoy;
243247
# tested as a core component of Pomerium
244248
pomerium = nixosTests.pomerium;
249+
250+
deps-store-free =
251+
runCommandLocal "${envoy.name}-deps-store-free-test"
252+
{
253+
nativeBuildInputs = [
254+
gnutar
255+
gnugrep
256+
];
257+
}
258+
''
259+
touch $out
260+
tar -xf ${envoy.deps}
261+
grep -r /nix/store external && status=$? || status=$?
262+
case $status in
263+
1)
264+
echo "No match found."
265+
;;
266+
0)
267+
echo
268+
echo "Error: Found references to /nix/store in envoy.deps derivation"
269+
echo "This is a reproducibility issue, as the hash of the fixed-output derivation"
270+
echo "will change in case the store path of the input changes."
271+
echo
272+
echo "Replace the store path in fetcherAttrs.preInstall."
273+
exit 1
274+
;;
275+
*)
276+
echo "An unexpected error occurred."
277+
exit $status
278+
;;
279+
esac
280+
'';
245281
};
246282

247283
meta = with lib; {

0 commit comments

Comments
 (0)