aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@digia.com>2013-11-26 14:19:07 +0100
committerChristian Kandeler <christian.kandeler@digia.com>2013-11-27 10:22:02 +0100
commit003ebacfdc16c8b65c7d96b4edf4d0821fe695cd (patch)
tree8e932a45b9b78d14b1749009268c284f4561cdfd
parent9898402835f814d3a91c8880b155b6352d41e2f1 (diff)
Better error diagnostics.
- Add sanity check for multiple artifacts with the same file path. - Print more information in case of multiple inputs to a non-multiplex rule. Change-Id: Ic76248fe61ba02bf3ff0820b9c968efc4b04ff20 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
-rw-r--r--src/lib/buildgraph/buildgraph.cpp3
-rw-r--r--src/lib/buildgraph/rulesapplicator.cpp6
2 files changed, 9 insertions, 0 deletions
diff --git a/src/lib/buildgraph/buildgraph.cpp b/src/lib/buildgraph/buildgraph.cpp
index f8c4f8b6a..cb3d6bda3 100644
--- a/src/lib/buildgraph/buildgraph.cpp
+++ b/src/lib/buildgraph/buildgraph.cpp
@@ -428,8 +428,11 @@ static void doSanityChecksForProduct(const ResolvedProductConstPtr &product, con
logger.qbsTrace() << "Checking target artifact '" << ta->fileName() << "'.";
QBS_CHECK(buildData->artifacts.contains(ta));
}
+ QSet<QString> filePaths;
foreach (Artifact * const artifact, buildData->artifacts) {
logger.qbsDebug() << "Sanity checking artifact '" << artifact->fileName() << "'";
+ QBS_CHECK(!filePaths.contains(artifact->filePath()));
+ filePaths << artifact->filePath();
QBS_CHECK(artifact->product == product);
foreach (const Artifact * const parent, artifact->parents)
QBS_CHECK(parent->children.contains(artifact));
diff --git a/src/lib/buildgraph/rulesapplicator.cpp b/src/lib/buildgraph/rulesapplicator.cpp
index 0e3e95374..788549ad4 100644
--- a/src/lib/buildgraph/rulesapplicator.cpp
+++ b/src/lib/buildgraph/rulesapplicator.cpp
@@ -268,6 +268,12 @@ Artifact *RulesApplicator::createOutputArtifact(const RuleArtifactConstPtr &rule
.arg(outputArtifact->transformer->rule->script->location.line())
.arg(outputArtifact->transformer->rule->script->location.column())
.arg(th);
+
+ QStringList inputFilePaths;
+ foreach (const Artifact * const a, m_transformer->inputs)
+ inputFilePaths << a->filePath();
+ e.append(Tr::tr("The input artifacts are: %1")
+ .arg(inputFilePaths.join(QLatin1String(", "))));
throw ErrorInfo(e);
}
}