aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/corelib/buildgraph/productinstaller.cpp
diff options
context:
space:
mode:
authorJake Petroules <jake.petroules@qt.io>2017-11-17 00:58:19 -0800
committerJake Petroules <jake.petroules@qt.io>2017-11-17 23:14:10 +0000
commitdf14679c509bd1056d6d0722a4eff69f43367796 (patch)
treeedfd30343280ce1e813d7d8894f63c09c9cf580f /src/lib/corelib/buildgraph/productinstaller.cpp
parent7cbe9c436ff9d657eb116b43a97600806645a139 (diff)
Allow "conflicting" artifacts referencing the same file, to be installed
Installing artifact A to the same location from two different products (or multiple instances of a multiplexed product) is currently an error, "Cannot install files X and Y to the same location..." We only want this error message when installing artifacts pointing to *different* file paths, to the same location (since the source is ambiguous). We do NOT want it when installing different artifacts pointing to the same file, to the same location, since the outcome cannot be affected. This reduces unnecessary noise: for example, when installing headers from a multiplexed product, the user does not need to do extra work to ensure the files are installed by only one of the instances. Change-Id: Ia7a81faef5b3f27a2394b0218285c03ef3c889a3 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/lib/corelib/buildgraph/productinstaller.cpp')
-rw-r--r--src/lib/corelib/buildgraph/productinstaller.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/lib/corelib/buildgraph/productinstaller.cpp b/src/lib/corelib/buildgraph/productinstaller.cpp
index 03ae90759..75c75f70d 100644
--- a/src/lib/corelib/buildgraph/productinstaller.cpp
+++ b/src/lib/corelib/buildgraph/productinstaller.cpp
@@ -222,11 +222,18 @@ void ProductInstaller::copyFile(const Artifact *artifact)
}
if (m_targetFilePathsMap.contains(targetFilePath)) {
- handleError(Tr::tr("Cannot install files '%1' and '%2' to the same location '%3'. If you "
- "are attempting to install a directory hierarchy, consider using "
- "the qbs.installSourceBase property.")
- .arg(artifact->filePath(), m_targetFilePathsMap[targetFilePath],
- targetFilePath));
+ // We only want this error message when installing artifacts pointing to different file
+ // paths, to the same location. We do NOT want it when installing different artifacts
+ // pointing to the same file, to the same location. This reduces unnecessary noise: for
+ // example, when installing headers from a multiplexed product, the user does not need to
+ // do extra work to ensure the files are installed by only one of the instances.
+ if (artifact->filePath() != m_targetFilePathsMap[targetFilePath]) {
+ handleError(Tr::tr("Cannot install files '%1' and '%2' to the same location '%3'. "
+ "If you are attempting to install a directory hierarchy, consider "
+ "using the qbs.installSourceBase property.")
+ .arg(artifact->filePath(), m_targetFilePathsMap[targetFilePath],
+ targetFilePath));
+ }
}
m_targetFilePathsMap.insert(targetFilePath, artifact->filePath());