aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2019-05-06 14:03:03 +0200
committerChristian Kandeler <christian.kandeler@qt.io>2019-05-09 08:53:14 +0000
commitd0a51796a6ae74496612366a07b0eb3299977284 (patch)
tree1d2caffdad48fca9464bb767aac25c7c2497316b
parent6b2e09b08ef7b21133186985e71933216dfe8dd8 (diff)
QbsProjectManager: Skip run environment retrieval if project is parsing
...or building. We must not access the internal state of qbs::Project while a parse or build is going on, as that could lead to race conditions. This can potentially leave the run configuration with an incomplete environment temporarily, but eventually we'll get the correct one once the project has finished parsing. Fixes: QTCREATORBUG-22386 Change-Id: Iee3c36aadae9e3a6070993436890eb1ee89354e6 Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
-rw-r--r--src/plugins/qbsprojectmanager/qbsrunconfiguration.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/plugins/qbsprojectmanager/qbsrunconfiguration.cpp b/src/plugins/qbsprojectmanager/qbsrunconfiguration.cpp
index c68ef96122..03cff5f4eb 100644
--- a/src/plugins/qbsprojectmanager/qbsrunconfiguration.cpp
+++ b/src/plugins/qbsprojectmanager/qbsrunconfiguration.cpp
@@ -26,9 +26,11 @@
#include "qbsrunconfiguration.h"
#include "qbsnodes.h"
+#include "qbspmlogging.h"
#include "qbsprojectmanagerconstants.h"
#include "qbsproject.h"
+#include <projectexplorer/buildmanager.h>
#include <projectexplorer/deploymentdata.h>
#include <projectexplorer/localenvironmentaspect.h>
#include <projectexplorer/project.h>
@@ -123,8 +125,13 @@ void QbsRunConfiguration::addToBaseEnvironment(Utils::Environment &env) const
return;
}
BuildTargetInfo bti = buildTargetInfo();
- if (bti.runEnvModifier)
+ if (bti.runEnvModifier) {
+ if (project()->isParsing() || BuildManager::isBuilding(target())) {
+ qCDebug(qbsPmLog) << "qbs project in flux, cannot modify environment";
+ return; // Intentionally skips the cache update below.
+ }
bti.runEnvModifier(env, usingLibraryPaths);
+ }
m_envCache.insert(key, env);
}