aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2016-11-14 12:41:08 +0100
committerChristian Kandeler <christian.kandeler@qt.io>2016-11-14 12:13:37 +0000
commit0649b77b020b02436a843ee72a5941f2f875c846 (patch)
treeca4ac862a375d9ba0763a04c8bfa92de70e3ecd3
parentd0516e847335e7f432f137bf4774a05b0c007569 (diff)
Fix bug that causes re-linking on every build on Linux1.6
Introduced by d0516e8473. Change-Id: I5bf9e9acab9485ba47c4f5b02e7b0c4ae2493266 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
-rw-r--r--src/lib/corelib/buildgraph/executor.cpp2
-rw-r--r--tests/auto/blackbox/testdata/generated-artifact-as-input-to-dynamic-rule/p.qbs9
-rw-r--r--tests/auto/blackbox/tst_blackbox.cpp3
3 files changed, 12 insertions, 2 deletions
diff --git a/src/lib/corelib/buildgraph/executor.cpp b/src/lib/corelib/buildgraph/executor.cpp
index e774f71e7..db74d1715 100644
--- a/src/lib/corelib/buildgraph/executor.cpp
+++ b/src/lib/corelib/buildgraph/executor.cpp
@@ -453,6 +453,8 @@ void Executor::executeRuleNode(RuleNode *ruleNode)
for (const Artifact * const parent : artifact->parentArtifacts()) {
if (parent->transformer->rule != ruleNode->rule())
continue;
+ if (!parent->alwaysUpdated)
+ continue;
if (parent->timestamp() < artifact->timestamp()) {
changedInputArtifacts += artifact;
break;
diff --git a/tests/auto/blackbox/testdata/generated-artifact-as-input-to-dynamic-rule/p.qbs b/tests/auto/blackbox/testdata/generated-artifact-as-input-to-dynamic-rule/p.qbs
index 725966c3b..f26d92262 100644
--- a/tests/auto/blackbox/testdata/generated-artifact-as-input-to-dynamic-rule/p.qbs
+++ b/tests/auto/blackbox/testdata/generated-artifact-as-input-to-dynamic-rule/p.qbs
@@ -26,7 +26,7 @@ Product {
Rule {
inputs: ["mytype.out"]
- outputFileTags: ["mytype.final"]
+ outputFileTags: ["mytype.final", "dummy"]
outputArtifacts: {
var file;
var inFile = new TextFile(input.filePath, TextFile.ReadOnly);
@@ -37,11 +37,16 @@ Product {
} finally {
inFile.close();
}
- return [{ filePath: file, fileTags: ["mytype.final"] }];
+ return [
+ { filePath: file, fileTags: ["mytype.final"] },
+ { filePath: "dummy", fileTags: ["dummy"], alwaysUpdated: false }
+ ];
}
prepare: {
var cmd = new JavaScriptCommand();
+ var output = outputs["mytype.final"][0];
cmd.description = "generating " + output.fileName;
+ cmd.output = output;
cmd.sourceCode = function() { File.copy(input.filePath, output.filePath); };
return [cmd];
}
diff --git a/tests/auto/blackbox/tst_blackbox.cpp b/tests/auto/blackbox/tst_blackbox.cpp
index 6fea9abf6..1766cf2b7 100644
--- a/tests/auto/blackbox/tst_blackbox.cpp
+++ b/tests/auto/blackbox/tst_blackbox.cpp
@@ -4058,6 +4058,9 @@ void TestBlackbox::generatedArtifactAsInputToDynamicRule()
QVERIFY2(!regularFileExists(oldFile), qPrintable(oldFile));
const QString newFile = relativeProductBuildDir("p") + "/new.txt";
QVERIFY2(regularFileExists(newFile), qPrintable(oldFile));
+ QVERIFY2(m_qbsStdout.contains("generating"), m_qbsStdout.constData());
+ QCOMPARE(runQbs(), 0);
+ QVERIFY2(!m_qbsStdout.contains("generating"), m_qbsStdout.constData());
}
static bool haveWiX(const Profile &profile)