mirror of
https://github.com/NixOS/nix
synced 2025-07-09 07:53:55 +02:00
Merge pull request #5839 from tweag/balsoft/yet-another-follows-bugfix
flake.cc: computeLocks: Only verify overrides when they could change
This commit is contained in:
commit
96d08fcd66
2 changed files with 25 additions and 21 deletions
|
@ -716,11 +716,10 @@ cat > $flakeFollowsA/flake.nix <<EOF
|
|||
inputs = {
|
||||
B = {
|
||||
url = "path:./flakeB";
|
||||
inputs.foobar.follows = "D";
|
||||
inputs.nonFlake.follows = "D";
|
||||
inputs.foobar.follows = "foobar";
|
||||
};
|
||||
|
||||
D.url = "path:./flakeD";
|
||||
foobar.url = "path:$flakeFollowsA/flakeE";
|
||||
};
|
||||
outputs = { ... }: {};
|
||||
}
|
||||
|
@ -731,8 +730,6 @@ cat > $flakeFollowsB/flake.nix <<EOF
|
|||
description = "Flake B";
|
||||
inputs = {
|
||||
foobar.url = "path:$flakeFollowsA/flakeE";
|
||||
nonFlake.url = "path:$nonFlakeDir";
|
||||
goodoo.follows = "C/goodoo";
|
||||
C = {
|
||||
url = "path:./flakeC";
|
||||
inputs.foobar.follows = "foobar";
|
||||
|
@ -747,7 +744,6 @@ cat > $flakeFollowsC/flake.nix <<EOF
|
|||
description = "Flake C";
|
||||
inputs = {
|
||||
foobar.url = "path:$flakeFollowsA/flakeE";
|
||||
goodoo.follows = "foobar";
|
||||
};
|
||||
outputs = { ... }: {};
|
||||
}
|
||||
|
@ -785,7 +781,7 @@ newLock="$(cat "$flakeFollowsA/flake.lock")"
|
|||
diff <(echo "$newLock") <(echo "$oldLock")
|
||||
|
||||
[[ $(jq -c .nodes.B.inputs.C $flakeFollowsA/flake.lock) = '"C"' ]]
|
||||
[[ $(jq -c .nodes.B.inputs.foobar $flakeFollowsA/flake.lock) = '["D"]' ]]
|
||||
[[ $(jq -c .nodes.B.inputs.foobar $flakeFollowsA/flake.lock) = '["foobar"]' ]]
|
||||
[[ $(jq -c .nodes.C.inputs.foobar $flakeFollowsA/flake.lock) = '["B","foobar"]' ]]
|
||||
|
||||
# Ensure removing follows from flake.nix removes them from the lockfile
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue