mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-29 17:16:15 +02:00
Print out all bad references/requisites at once
Also updates tests to check for new information. Fixes #799
This commit is contained in:
parent
0423787086
commit
608b0265e1
2 changed files with 15 additions and 3 deletions
|
@ -2775,13 +2775,24 @@ void DerivationGoal::registerOutputs()
|
||||||
} else
|
} else
|
||||||
used = references;
|
used = references;
|
||||||
|
|
||||||
|
PathSet badPaths;
|
||||||
|
|
||||||
for (auto & i : used)
|
for (auto & i : used)
|
||||||
if (allowed) {
|
if (allowed) {
|
||||||
if (spec.find(i) == spec.end())
|
if (spec.find(i) == spec.end())
|
||||||
throw BuildError(format("output ‘%1%’ is not allowed to refer to path ‘%2%’") % actualPath % i);
|
badPaths.insert(i);
|
||||||
} else {
|
} else {
|
||||||
if (spec.find(i) != spec.end())
|
if (spec.find(i) != spec.end())
|
||||||
throw BuildError(format("output ‘%1%’ is not allowed to refer to path ‘%2%’") % actualPath % i);
|
badPaths.insert(i);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!badPaths.empty()) {
|
||||||
|
string badPathsStr;
|
||||||
|
for (auto & i : badPaths) {
|
||||||
|
badPathsStr += "\n\t";
|
||||||
|
badPathsStr += i;
|
||||||
|
}
|
||||||
|
throw BuildError(format("output ‘%1%’ is not allowed to refer to the following paths:%2%") % actualPath % badPathsStr);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,8 @@ nix-build -o $RESULT check-reqs.nix -A test1
|
||||||
|
|
||||||
(! nix-build -o $RESULT check-reqs.nix -A test2)
|
(! nix-build -o $RESULT check-reqs.nix -A test2)
|
||||||
(! nix-build -o $RESULT check-reqs.nix -A test3)
|
(! nix-build -o $RESULT check-reqs.nix -A test3)
|
||||||
(! nix-build -o $RESULT check-reqs.nix -A test4)
|
(! nix-build -o $RESULT check-reqs.nix -A test4) 2>&1 | grep -q 'check-reqs-dep1'
|
||||||
|
(! nix-build -o $RESULT check-reqs.nix -A test4) 2>&1 | grep -q 'check-reqs-dep2'
|
||||||
(! nix-build -o $RESULT check-reqs.nix -A test5)
|
(! nix-build -o $RESULT check-reqs.nix -A test5)
|
||||||
(! nix-build -o $RESULT check-reqs.nix -A test6)
|
(! nix-build -o $RESULT check-reqs.nix -A test6)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue