From 0b2927007047865d73ab0bb258e3600402224ea9 Mon Sep 17 00:00:00 2001 From: Paul Meyer Date: Wed, 15 Jan 2025 18:45:07 +0100 Subject: [PATCH] envoy: add test to check deps derivation for storepaths Signed-off-by: Paul Meyer --- pkgs/by-name/en/envoy/package.nix | 36 +++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/pkgs/by-name/en/envoy/package.nix b/pkgs/by-name/en/envoy/package.nix index 1af918135653..efe2718208fb 100644 --- a/pkgs/by-name/en/envoy/package.nix +++ b/pkgs/by-name/en/envoy/package.nix @@ -19,6 +19,10 @@ python3, linuxHeaders, nixosTests, + runCommandLocal, + gnutar, + gnugrep, + envoy, # v8 (upstream default), wavm, wamr, wasmtime, disabled wasmRuntime ? "wamr", @@ -242,6 +246,38 @@ buildBazelPackage rec { envoy = nixosTests.envoy; # tested as a core component of Pomerium pomerium = nixosTests.pomerium; + + deps-store-free = + runCommandLocal "${envoy.name}-deps-store-free-test" + { + nativeBuildInputs = [ + gnutar + gnugrep + ]; + } + '' + touch $out + tar -xf ${envoy.deps} + grep -r /nix/store external && status=$? || status=$? + case $status in + 1) + echo "No match found." + ;; + 0) + echo + echo "Error: Found references to /nix/store in envoy.deps derivation" + echo "This is a reproducibility issue, as the hash of the fixed-output derivation" + echo "will change in case the store path of the input changes." + echo + echo "Replace the store path in fetcherAttrs.preInstall." + exit 1 + ;; + *) + echo "An unexpected error occurred." + exit $status + ;; + esac + ''; }; meta = with lib; {