diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2018-06-08 14:55:29 +0200 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2018-06-08 15:13:47 +0200 |
commit | 073fda0ab536b5610ff1b9191db582791552509e (patch) | |
tree | 16f0bbacc116e93778e9490ba2c2d9efff738d35 /src/lib/corelib/buildgraph | |
parent | 9349866b37118db9179d1f0689e872ca1260f040 (diff) | |
parent | 5f71b2220f9ff6838799c407972309bff1e8fc96 (diff) |
Merge 1.12 into master
Change-Id: I0c914674c0728a7f7bc70fd9608914b95ef55a30
Diffstat (limited to 'src/lib/corelib/buildgraph')
-rw-r--r-- | src/lib/corelib/buildgraph/executor.cpp | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/src/lib/corelib/buildgraph/executor.cpp b/src/lib/corelib/buildgraph/executor.cpp index 24f484ad2..8713b9b41 100644 --- a/src/lib/corelib/buildgraph/executor.cpp +++ b/src/lib/corelib/buildgraph/executor.cpp @@ -771,8 +771,7 @@ void Executor::rescueOldBuildData(Artifact *artifact, bool *childrenAdded = 0) return; qCDebug(lcBuildGraph) << "Attempting to rescue data of artifact" << artifact->fileName(); - typedef std::pair<Artifact *, bool> ChildArtifactData; - QList<ChildArtifactData> childrenToConnect; + std::vector<Artifact *> childrenToConnect; bool canRescue = artifact->transformer->commands == rad.commands; if (canRescue) { ResolvedProductPtr pseudoProduct = ResolvedProduct::create(); @@ -796,10 +795,15 @@ void Executor::rescueOldBuildData(Artifact *artifact, bool *childrenAdded = 0) removeGeneratedArtifactFromDisk(cd.childFilePath, m_logger); } } - // TODO: Shouldn't addedByScanner always be true here? Otherwise the child would be - // in the list already, no? + if (!cd.addedByScanner) { + // If an artifact has disappeared from the list of children, the commands + // might need to run again. + canRescue = false; + qCDebug(lcBuildGraph) << "Former child artifact" << cd.childFilePath << + "is no longer in the list of children"; + } if (canRescue) - childrenToConnect.push_back({child, cd.addedByScanner}); + childrenToConnect.push_back(child); } for (const QString &depPath : rad.fileDependencies) { const QList<FileResourceBase *> depList = m_project->buildData->lookupFiles(depPath); @@ -865,10 +869,9 @@ void Executor::rescueOldBuildData(Artifact *artifact, bool *childrenAdded = 0) artifact->knownOutOfDate = artifact->knownOutOfDate || rad.knownOutOfDate; if (childrenAdded && !childrenToConnect.empty()) *childrenAdded = true; - for (const ChildArtifactData &cad : qAsConst(childrenToConnect)) { - safeConnect(artifact, cad.first); - if (cad.second) - artifact->childrenAddedByScanner << cad.first; + for (Artifact * const child : childrenToConnect) { + safeConnect(artifact, child); + artifact->childrenAddedByScanner << child; } qCDebug(lcBuildGraph) << "Data was rescued."; } else { |