Files
lix/tests/functional/output-cycles.sh
T
Maximilian Bosch e2641cb890 libstore/local-derivation-goal: show tree with references that lead to an output cycle
Closes #551

This adds a special accessor that falls back to checking if a store-path
exists within a chroot if it's not a valid path. That way,
`genGraphString` can find out which files have which references before
the outputs are registered.

Change-Id: I03c9d508fa3c72e5c262194461a25d71f3f4de15
2025-08-24 01:15:15 +02:00

19 lines
713 B
Bash

source common.sh
clearStore
error="$(! nix-build check-outputs.nix -A cycle 2>&1)"
grepQuiet "cycle detected in build of '.*' in the references of output 'bar' from output 'foo'" <<<"$error"
if [[ "$(uname -s)" = Linux ]]; then
<<<"$error" grepQuiet "/store/.*-cycle-bar"
<<<"$error" grepQuiet "└───lib/libfoo: ….*cycle-baz.*"
<<<"$error" grepQuiet " →.*/store/.*-cycle-baz"
<<<"$error" grepQuiet " └───share/lalala:.*-cycle-foo.*"
fi
error="$(! nix-build check-outputs.nix -A as_dependency 2>&1)"
grepQuiet "cycle detected in build of '.*' in the references of output 'bar' from output 'foo'" <<<"$error"
grepQuiet "error: 1 dependencies of derivation" <<<"$error"