Turn error for non-existant follows into a warning

This commit is contained in:
Maximilian Bosch 2022-07-12 11:22:35 +02:00
parent c1c37f3200
commit 411111a3bc
No known key found for this signature in database
GPG key ID: 091DBF4D1FC46B8E
2 changed files with 3 additions and 4 deletions

View file

@ -373,8 +373,7 @@ LockedFlake lockFlake(
{ {
debug("computing lock file node '%s'", printInputPath(inputPathPrefix)); debug("computing lock file node '%s'", printInputPath(inputPathPrefix));
auto overrides2 = overrides; for (auto [inputPath, inputOverride] : overrides) {
for (auto & [inputPath, inputOverride] : overrides2) {
auto inputPath2(inputPath); auto inputPath2(inputPath);
auto follow = inputPath2.back(); auto follow = inputPath2.back();
inputPath2.pop_back(); inputPath2.pop_back();
@ -388,7 +387,7 @@ LockedFlake lockFlake(
root.append(".inputs."); root.append(".inputs.");
} }
} }
throw Error( warn(
"%s has a `follows'-declaration for a non-existant input %s!", "%s has a `follows'-declaration for a non-existant input %s!",
root, root,
follow follow

View file

@ -877,4 +877,4 @@ EOF
git -C $flakeFollowsA add flake.nix git -C $flakeFollowsA add flake.nix
nix flake lock $flakeFollowsA 2>&1 | grep "error: B has a \`follows'-declaration for a non-existant input invalid!" nix flake lock $flakeFollowsA 2>&1 | grep "warning: B has a \`follows'-declaration for a non-existant input invalid!"