aboutsummaryrefslogtreecommitdiff
path: root/tests/selfref-gc.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/selfref-gc.sh')
-rw-r--r--tests/selfref-gc.sh30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/selfref-gc.sh b/tests/selfref-gc.sh
new file mode 100644
index 000000000..3f1f50eea
--- /dev/null
+++ b/tests/selfref-gc.sh
@@ -0,0 +1,30 @@
+source common.sh
+
+requireDaemonNewerThan "2.6.0pre20211215"
+
+clearStore
+
+nix-build --no-out-link -E '
+ with import ./config.nix;
+
+ let d1 = mkDerivation {
+ name = "selfref-gc";
+ outputs = [ "out" ];
+ buildCommand = "
+ echo SELF_REF: $out > $out
+ ";
+ }; in
+
+ # the only change from d1 is d1 as an (unused) build input
+ # to get identical store path in CA.
+ mkDerivation {
+ name = "selfref-gc";
+ outputs = [ "out" ];
+ buildCommand = "
+ echo UNUSED: ${d1}
+ echo SELF_REF: $out > $out
+ ";
+ }
+'
+
+nix-collect-garbage