aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/corelib/buildgraph
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@digia.com>2014-06-20 16:41:42 +0200
committerChristian Kandeler <christian.kandeler@digia.com>2014-07-02 11:16:21 +0200
commite655304fed77ad45cb083a4f62ba308d734025a3 (patch)
tree0a94d7c7372d37d81e82d0bbcd68bfd765e35048 /src/lib/corelib/buildgraph
parent7c975c2fda2ef06af0532a73dc287657447e20d6 (diff)
Do not lose rescuable artifact data after an incomplete build.
Task-number: QBS-630 Change-Id: Ib69c541a6c1e228b1ad3c06da51d905194ed10d8 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Diffstat (limited to 'src/lib/corelib/buildgraph')
-rw-r--r--src/lib/corelib/buildgraph/buildgraphloader.cpp11
-rw-r--r--src/lib/corelib/buildgraph/buildgraphloader.h5
2 files changed, 13 insertions, 3 deletions
diff --git a/src/lib/corelib/buildgraph/buildgraphloader.cpp b/src/lib/corelib/buildgraph/buildgraphloader.cpp
index ca186151b..00987dc35 100644
--- a/src/lib/corelib/buildgraph/buildgraphloader.cpp
+++ b/src/lib/corelib/buildgraph/buildgraphloader.cpp
@@ -232,11 +232,14 @@ void BuildGraphLoader::trackProjectChanges(const SetupProjectParameters &paramet
// For products with "serious" changes such as different prepare scripts, we set up the
// build data from scratch to be on the safe side. This can be made more fine-grained
// if needed.
+ QHash<QString, AllRescuableArtifactData> rescuableArtifactData;
foreach (const ResolvedProductPtr &product, changedProducts) {
ResolvedProductPtr freshProduct = freshProductsByName.value(product->name);
if (!freshProduct)
continue;
onProductRemoved(product, product->topLevelProject()->buildData.data(), false);
+ if (product->buildData)
+ rescuableArtifactData.insert(product->name, product->buildData->rescuableArtifactData);
allRestoredProducts.removeOne(product);
productsWithChangedFiles.removeOne(product);
}
@@ -305,7 +308,8 @@ void BuildGraphLoader::trackProjectChanges(const SetupProjectParameters &paramet
foreach (const ResolvedProductConstPtr &changedProduct, changedProducts) {
rescueOldBuildData(changedProduct, freshProductsByName.value(changedProduct->name),
- oldBuildData.data(), childLists);
+ oldBuildData.data(), childLists,
+ rescuableArtifactData.value(changedProduct->name));
}
doSanityChecks(m_result.newlyResolvedProject, m_logger);
@@ -762,7 +766,7 @@ void BuildGraphLoader::replaceFileDependencyWithArtifact(const ResolvedProductPt
void BuildGraphLoader::rescueOldBuildData(const ResolvedProductConstPtr &restoredProduct,
const ResolvedProductPtr &newlyResolvedProduct, ProjectBuildData *oldBuildData,
- const ChildListHash &childLists)
+ const ChildListHash &childLists, const AllRescuableArtifactData &existingRad)
{
if (!restoredProduct->enabled || !newlyResolvedProduct->enabled)
return;
@@ -771,6 +775,9 @@ void BuildGraphLoader::rescueOldBuildData(const ResolvedProductConstPtr &restore
m_logger.qbsTrace() << QString::fromLocal8Bit("[BG] rescue data of "
"product '%1'").arg(restoredProduct->name);
}
+ QBS_CHECK(newlyResolvedProduct->buildData);
+ QBS_CHECK(newlyResolvedProduct->buildData->rescuableArtifactData.isEmpty());
+ newlyResolvedProduct->buildData->rescuableArtifactData = existingRad;
// This is needed for artifacts created by manually added transformers, which are
// already present in the build graph.
diff --git a/src/lib/corelib/buildgraph/buildgraphloader.h b/src/lib/corelib/buildgraph/buildgraphloader.h
index a6b705d1f..0fec2b442 100644
--- a/src/lib/corelib/buildgraph/buildgraphloader.h
+++ b/src/lib/corelib/buildgraph/buildgraphloader.h
@@ -31,6 +31,8 @@
#include "forward_decls.h"
+#include "rescuableartifactdata.h"
+
#include <buildgraph/artifactset.h>
#include <language/forward_decls.h>
#include <logging/logger.h>
@@ -113,7 +115,8 @@ private:
void rescueOldBuildData(const ResolvedProductConstPtr &restoredProduct,
const ResolvedProductPtr &newlyResolvedProduct,
ProjectBuildData *oldBuildData,
- const ChildListHash &childLists);
+ const ChildListHash &childLists,
+ const AllRescuableArtifactData &existingRad);
RulesEvaluationContextPtr m_evalContext;
BuildGraphLoadResult m_result;