Skip to content

Commit 7e92525

Browse files
committed
Make flake evaluation resilient to missing self.rev
The attribute self.rev is missing also when flake inputs are overridden, and it's highly desirable that the flake's evaluation is able to succeed with overridden inputs. The workbench-run-supervisor-ci-test-bage has its own logic around checking self.rev, which does not use the top-level overlay; and the system-tests script aborts the evaluation when self.rev is missing. This change makes workbench-run-supervisor-ci-test-bage use pkgs.gitrev as the rest of the flake and moves the checking self.rev to inside system-tests script.
1 parent 892b620 commit 7e92525

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

flake.nix

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -206,10 +206,7 @@
206206
inherit profileName workbenchStartArgs;
207207
backendName = "supervisor";
208208
useCabalRun = false;
209-
cardano-node-rev =
210-
if builtins.hasAttr "rev" self
211-
then pkgs.gitrev
212-
else throw "Cannot get git revision of 'cardano-node', unclean checkout?";
209+
cardano-node-rev = pkgs.gitrev;
213210
}).workbench-profile-run;
214211
in
215212
{
@@ -231,7 +228,11 @@
231228
name = "system-tests";
232229
runtimeInputs = with pkgs; [ git gnused ];
233230
text = ''
234-
NODE_REV="${self.rev or (throw "Sorry, need clean/pushed git revision to run system tests")}"
231+
NODE_REV="${self.rev or ""}"
232+
if [[ -z $NODE_REV ]]; then
233+
echo "Sorry, need clean/pushed git revision to run system tests"
234+
exit 1;
235+
fi
235236
MAKE_TARGET=testpr
236237
mkdir -p tmp && cd tmp
237238
rm -rf cardano-node-tests

0 commit comments

Comments
 (0)