From 56a7bc5030966e5ecbd06e9106fe52db172c89e3 Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Thu, 31 Dec 2020 16:46:55 +0100 Subject: [PATCH] nix: Fix build errors with stale .tix files present --- .../checked-shell-script/checked-shell-script.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/nix/overlays/checked-shell-script/checked-shell-script.nix b/nix/overlays/checked-shell-script/checked-shell-script.nix index a776e0c69..4e21d26db 100644 --- a/nix/overlays/checked-shell-script/checked-shell-script.nix +++ b/nix/overlays/checked-shell-script/checked-shell-script.nix @@ -22,6 +22,14 @@ let '' #!${runtimeShell} set -euo pipefail + + # make sure that no script creates conflicting tix files + # postgrest-coverage will override HPCTIXFILE to make proper use of it + if test ! -v HPCTIXFILE; then + hpctixdir=$(mktemp -d) + export HPCTIXFILE="$hpctixdir"/postgrest.tix + trap 'rm -rf $hpctixdir' EXIT + fi '' + lib.optionalString inRootDir '' cd "$(${git}/bin/git rev-parse --show-toplevel)" @@ -32,7 +40,7 @@ let exit 1 fi '' - + text; + + "(${text})"; checkPhase = ''