aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/lib/corelib/buildgraph/executor.cpp1
-rw-r--r--src/lib/corelib/buildgraph/inputartifactscanner.cpp7
-rw-r--r--src/lib/corelib/buildgraph/scanresultcache.cpp9
-rw-r--r--src/lib/corelib/buildgraph/scanresultcache.h1
-rw-r--r--tests/auto/blackbox/tst_blackbox.cpp2
5 files changed, 4 insertions, 16 deletions
diff --git a/src/lib/corelib/buildgraph/executor.cpp b/src/lib/corelib/buildgraph/executor.cpp
index d5e45f85b..a763e83bf 100644
--- a/src/lib/corelib/buildgraph/executor.cpp
+++ b/src/lib/corelib/buildgraph/executor.cpp
@@ -646,7 +646,6 @@ void Executor::finishArtifact(Artifact *leaf)
m_logger.qbsTrace() << "[EXEC] finishArtifact " << relativeArtifactFileName(leaf);
finishNode(leaf);
- m_scanResultCache.remove(leaf->filePath());
}
QString Executor::configString() const
diff --git a/src/lib/corelib/buildgraph/inputartifactscanner.cpp b/src/lib/corelib/buildgraph/inputartifactscanner.cpp
index cdf38b247..a505d3b21 100644
--- a/src/lib/corelib/buildgraph/inputartifactscanner.cpp
+++ b/src/lib/corelib/buildgraph/inputartifactscanner.cpp
@@ -290,10 +290,11 @@ resolved:
handleDependency(resolvedDependency);
if (artifactsToScan && resolvedDependency.file) {
if (Artifact *artifactDependency = dynamic_cast<Artifact *>(resolvedDependency.file)) {
- // Do not scan artifacts that are being built. Otherwise we might read an incomplete
- // file or conflict with the writing process.
- if (artifactDependency->buildState != BuildGraphNode::Building)
+ // Do not scan an artifact that is not built yet: Its contents might still change.
+ if (artifactDependency->artifactType == Artifact::SourceFile
+ || artifactDependency->buildState == BuildGraphNode::Built) {
artifactsToScan->append(artifactDependency);
+ }
} else {
// Add file dependency to the next round of scanning.
artifactsToScan->append(resolvedDependency.file);
diff --git a/src/lib/corelib/buildgraph/scanresultcache.cpp b/src/lib/corelib/buildgraph/scanresultcache.cpp
index 93986264a..9e1b3ccf8 100644
--- a/src/lib/corelib/buildgraph/scanresultcache.cpp
+++ b/src/lib/corelib/buildgraph/scanresultcache.cpp
@@ -61,14 +61,5 @@ void ScanResultCache::insert(const void *scanner, const QString &fileName, const
m_data[scanner].insert(fileName, value);
}
-void ScanResultCache::remove(const QString &fileName)
-{
- ScanResultCacheData::iterator i = m_data.begin();
- while (i != m_data.end()) {
- i.value().remove(fileName);
- ++i;
- }
-}
-
} // namespace Internal
} // namespace qbs
diff --git a/src/lib/corelib/buildgraph/scanresultcache.h b/src/lib/corelib/buildgraph/scanresultcache.h
index a5c670c71..f01431047 100644
--- a/src/lib/corelib/buildgraph/scanresultcache.h
+++ b/src/lib/corelib/buildgraph/scanresultcache.h
@@ -83,7 +83,6 @@ public:
Result value(const void* scanner, const QString &fileName) const;
void insert(const void* scanner, const QString &fileName, const Result &value);
- void remove(const QString &fileName);
private:
typedef QHash<const void*, QHash<QString, Result> > ScanResultCacheData;
diff --git a/tests/auto/blackbox/tst_blackbox.cpp b/tests/auto/blackbox/tst_blackbox.cpp
index 051232788..38dc22b40 100644
--- a/tests/auto/blackbox/tst_blackbox.cpp
+++ b/tests/auto/blackbox/tst_blackbox.cpp
@@ -328,7 +328,6 @@ void TestBlackbox::artifactScanning()
QCOMPARE(m_qbsStderr.count("scanning p1.cpp"), 1);
QCOMPARE(m_qbsStderr.count("scanning p2.cpp"), 1);
QCOMPARE(m_qbsStderr.count("scanning p3.cpp"), 1);
- QEXPECT_FAIL(0, "QBS-1052", Continue);
QCOMPARE(m_qbsStderr.count("scanning shared.h"), 1);
QCOMPARE(m_qbsStderr.count("scanning external.h"), 1);
QCOMPARE(m_qbsStderr.count("scanning external2.h"), 1);
@@ -382,7 +381,6 @@ void TestBlackbox::artifactScanning()
QEXPECT_FAIL(0, "QBS-1052", Continue);
QCOMPARE(m_qbsStderr.count("scanning p2.cpp"), 0);
QCOMPARE(m_qbsStderr.count("scanning p3.cpp"), 0);
- QEXPECT_FAIL(0, "QBS-1052", Continue);
QCOMPARE(m_qbsStderr.count("scanning shared.h"), 1);
QEXPECT_FAIL(0, "QBS-1052", Continue);
QCOMPARE(m_qbsStderr.count("scanning external.h"), 0);