about summary refs log tree commit diff
path: root/src/libstore/build.cc
diff options
context:
space:
mode:
authorDan Peebles <pumpkin@me.com>2016-04-16T23·58-0400
committerDan Peebles <pumpkin@me.com>2016-04-16T23·58-0400
commit608b0265e104b4a97f51e5745b1a32078770f3cf (patch)
tree49954dfd00ad973e646fddab37b4ee6d67333be8 /src/libstore/build.cc
parent04237870866faaf7dce7c21332b47fef5d79ce65 (diff)
Print out all bad references/requisites at once
Also updates tests to check for new information. Fixes #799
Diffstat (limited to 'src/libstore/build.cc')
-rw-r--r--src/libstore/build.cc15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/libstore/build.cc b/src/libstore/build.cc
index ba3f3a371d..4b1c177fe2 100644
--- a/src/libstore/build.cc
+++ b/src/libstore/build.cc
@@ -2775,14 +2775,25 @@ void DerivationGoal::registerOutputs()
             } else
                 used = references;
 
+            PathSet badPaths;
+
             for (auto & i : used)
                 if (allowed) {
                     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 {
                     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);
+            }
         };
 
         checkRefs("allowedReferences", true, false);