aboutsummaryrefslogtreecommitdiff
path: root/tests/flakes/follow-paths.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/flakes/follow-paths.sh')
-rw-r--r--tests/flakes/follow-paths.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/flakes/follow-paths.sh b/tests/flakes/follow-paths.sh
index a70d9acb2..f9d5c8c80 100644
--- a/tests/flakes/follow-paths.sh
+++ b/tests/flakes/follow-paths.sh
@@ -150,6 +150,25 @@ nix flake lock $flakeFollowsA 2>&1 | grep "warning: input 'B' has an override fo
nix flake lock $flakeFollowsA 2>&1 | grep "warning: input 'B' has an override for a non-existent input 'invalid2'"
# Now test follow path overloading
+# This tests a lockfile checking regression https://github.com/NixOS/nix/pull/8819
+#
+# We construct the following graph, where p->q means p has input q.
+# A double edge means that the edge gets overridden using `follows`.
+#
+# A
+# / \
+# / \
+# v v
+# B ==> C --- follows declared in A
+# \\ /
+# \\/ --- follows declared in B
+# v
+# D
+#
+# The message was
+# error: input 'B/D' follows a non-existent input 'B/C/D'
+#
+# Note that for `B` to resolve its follow for `D`, it needs `C/D`, for which it needs to resolve the follow on `C` first.
flakeFollowsOverloadA=$TEST_ROOT/follows/overload/flakeA
flakeFollowsOverloadB=$TEST_ROOT/follows/overload/flakeA/flakeB
flakeFollowsOverloadC=$TEST_ROOT/follows/overload/flakeA/flakeB/flakeC