diff options
| author | Christian Kandeler <christian.kandeler@theqtcompany.com> | 2015-08-19 15:02:39 +0200 |
|---|---|---|
| committer | Christian Kandeler <christian.kandeler@theqtcompany.com> | 2015-08-24 08:57:11 +0000 |
| commit | ec64e4f7f69c4b24f0bf28ed94f7dd6bdb424848 (patch) | |
| tree | 105608471d99ef77b657bb07a844cc13810c9f73 | |
| parent | 549274d305d1b756c4316c6510f2bb32c5f937e5 (diff) | |
| download | qbs-ec64e4f7f69c4b24f0bf28ed94f7dd6bdb424848.tar.gz | |
Executor: Initialize all nodes in the project to "untouched".
Not just the nodes in the products we want to build.
Otherwise, in an IDE like Qt Creator the following scenario is possible:
- User does a normal build and cancels it.
- User then builds a single product.
- Now there are potentially nodes outside of this product
in state "buildable".
- In finishNode(), these get added to the list of leaf nodes
and we will erroneously visit them.
Task-number: QBS-835
Change-Id: I46d98e80cc2ebc8e88316201a56bb671af5d70de
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
| -rw-r--r-- | src/lib/corelib/buildgraph/executor.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/lib/corelib/buildgraph/executor.cpp b/src/lib/corelib/buildgraph/executor.cpp index 35a166e17..8a028f0dd 100644 --- a/src/lib/corelib/buildgraph/executor.cpp +++ b/src/lib/corelib/buildgraph/executor.cpp @@ -998,14 +998,18 @@ bool Executor::visit(RuleNode *ruleNode) */ void Executor::prepareAllNodes() { - foreach (const ResolvedProductPtr &product, m_productsToBuild) { - foreach (BuildGraphNode *node, product->buildData->nodes) { - node->buildState = BuildGraphNode::Untouched; - Artifact *artifact = dynamic_cast<Artifact *>(node); - if (artifact) - prepareArtifact(artifact); + foreach (const ResolvedProductPtr &product, m_project->allProducts()) { + if (product->enabled) { + QBS_CHECK(product->buildData); + foreach (BuildGraphNode * const node, product->buildData->nodes) + node->buildState = BuildGraphNode::Untouched; } } + foreach (const ResolvedProductPtr &product, m_productsToBuild) { + QBS_CHECK(product->buildData); + foreach (Artifact * const artifact, ArtifactSet::fromNodeSet(product->buildData->nodes)) + prepareArtifact(artifact); + } } void Executor::prepareArtifact(Artifact *artifact) |
