From fce20ac83943d94e3bd465c41b03bd1e5d0c756f Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Mon, 13 Jan 2014 10:36:50 +0100 Subject: Tighten sanity check. Check for the same file appearing as different artifacts in a child list. See QBS-491 for an example. Change-Id: Ie93268c05386ccfae2a57097a19e5ec7d135902a Reviewed-by: Joerg Bornemann --- src/lib/buildgraph/buildgraph.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/lib/buildgraph/buildgraph.cpp b/src/lib/buildgraph/buildgraph.cpp index 1d389d536..d80aebe84 100644 --- a/src/lib/buildgraph/buildgraph.cpp +++ b/src/lib/buildgraph/buildgraph.cpp @@ -446,10 +446,21 @@ static void doSanityChecksForProduct(const ResolvedProductConstPtr &product, con QBS_CHECK(transformer); QBS_CHECK(transformer->outputs.contains(artifact)); + logger.qbsDebug() << "The transformer has " << transformer->outputs.count() + << " outputs."; ArtifactList transformerOutputChildren; foreach (const Artifact * const output, transformer->outputs) { QBS_CHECK(output->transformer == transformer); transformerOutputChildren.unite(output->children); + QSet childFilePaths; + foreach (const Artifact * const a, output->children) { + if (childFilePaths.contains(a->filePath())) { + throw ErrorInfo(QString::fromLocal8Bit("There is more than one artifact for " + "file '%1' in the child list for output '%2'.") + .arg(a->filePath(), output->filePath()), CodeLocation(), true); + } + childFilePaths << a->filePath(); + } } if (logger.traceEnabled()) { logger.qbsTrace() << "The transformer output children are:"; -- cgit v1.2.3