diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2018-09-03 14:08:01 +0200 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2018-09-04 07:10:51 +0000 |
commit | 80bd4c413e03e3307b374982132779ddc80f914e (patch) | |
tree | ba399dd3aa492f63f810bae1a6e7296f6ec25fb8 /src/lib/corelib/buildgraph/requestedartifacts.cpp | |
parent | f57ca14b2c2eeac1f7fedd863dc503be4638bee2 (diff) |
Fix invariant in the RequestedArtifacts class
If an artifact map is requested a second time, we need to update the set
of all tags if the artifacts map has changed in the meantime.
This fixes an assertion in the sanity checks.
Change-Id: Iacf8d4376c7a3a356428cc7eb508dbd22e945a8c
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Diffstat (limited to 'src/lib/corelib/buildgraph/requestedartifacts.cpp')
-rw-r--r-- | src/lib/corelib/buildgraph/requestedartifacts.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/lib/corelib/buildgraph/requestedartifacts.cpp b/src/lib/corelib/buildgraph/requestedartifacts.cpp index 200f226ce..7fbaf65f1 100644 --- a/src/lib/corelib/buildgraph/requestedartifacts.cpp +++ b/src/lib/corelib/buildgraph/requestedartifacts.cpp @@ -73,13 +73,12 @@ bool RequestedArtifacts::isUpToDate(const TopLevelProject *project) const return true; } -void RequestedArtifacts::setAllArtifactTags(const ResolvedProduct *product) +void RequestedArtifacts::setAllArtifactTags(const ResolvedProduct *product, bool forceUpdate) { - if (m_requestedArtifactsPerProduct.find(product->uniqueName()) - != m_requestedArtifactsPerProduct.cend()) { - return; - } RequestedArtifactsPerProduct &ra = m_requestedArtifactsPerProduct[product->uniqueName()]; + if (!ra.allTags.empty() && !forceUpdate) + return; + ra.allTags.clear(); const ArtifactSetByFileTag artifactsMap = product->buildData->artifactsByFileTag(); for (auto it = artifactsMap.begin(); it != artifactsMap.end(); ++it) ra.allTags.insert(it.key().toString()); |