MsvcToolChain: reduce severity of task for failed vcvars runs

... if we can use cached environment modifications from previous Qt
Creator runs.

Change-Id: I2c570f3d3fc30adccf27339b2e21c5d00d4caa37
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
David Schulz
2022-11-23 07:28:12 +01:00
parent 4536258c9e
commit decbb93069

View File

@@ -8,6 +8,7 @@
#include "projectexplorer.h"
#include "projectexplorerconstants.h"
#include "projectexplorersettings.h"
#include "projectexplorertr.h"
#include "taskhub.h"
#include <coreplugin/icore.h>
@@ -776,9 +777,19 @@ void MsvcToolChain::initEnvModWatcher(const QFuture<GenerateEnvResult> &future)
QObject::connect(&m_envModWatcher, &QFutureWatcher<GenerateEnvResult>::resultReadyAt, [&]() {
const GenerateEnvResult &result = m_envModWatcher.result();
if (result.error) {
const QString &errorMessage = *result.error;
if (!errorMessage.isEmpty())
TaskHub::addTask(CompileTask(Task::Error, errorMessage));
QString errorMessage = *result.error;
if (!errorMessage.isEmpty()) {
Task::TaskType severity;
if (m_environmentModifications.isEmpty()) {
severity = Task::Error;
} else {
severity = Task::Warning;
errorMessage.prepend(
Tr::tr("Falling back to use the cached environment for \"%1\" after:")
.arg(displayName()) + '\n');
}
TaskHub::addTask(CompileTask(severity, errorMessage));
}
} else {
updateEnvironmentModifications(result.environmentItems);
}