forked from qt-creator/qt-creator
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:
@@ -8,6 +8,7 @@
|
|||||||
#include "projectexplorer.h"
|
#include "projectexplorer.h"
|
||||||
#include "projectexplorerconstants.h"
|
#include "projectexplorerconstants.h"
|
||||||
#include "projectexplorersettings.h"
|
#include "projectexplorersettings.h"
|
||||||
|
#include "projectexplorertr.h"
|
||||||
#include "taskhub.h"
|
#include "taskhub.h"
|
||||||
|
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
@@ -776,9 +777,19 @@ void MsvcToolChain::initEnvModWatcher(const QFuture<GenerateEnvResult> &future)
|
|||||||
QObject::connect(&m_envModWatcher, &QFutureWatcher<GenerateEnvResult>::resultReadyAt, [&]() {
|
QObject::connect(&m_envModWatcher, &QFutureWatcher<GenerateEnvResult>::resultReadyAt, [&]() {
|
||||||
const GenerateEnvResult &result = m_envModWatcher.result();
|
const GenerateEnvResult &result = m_envModWatcher.result();
|
||||||
if (result.error) {
|
if (result.error) {
|
||||||
const QString &errorMessage = *result.error;
|
QString errorMessage = *result.error;
|
||||||
if (!errorMessage.isEmpty())
|
if (!errorMessage.isEmpty()) {
|
||||||
TaskHub::addTask(CompileTask(Task::Error, errorMessage));
|
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 {
|
} else {
|
||||||
updateEnvironmentModifications(result.environmentItems);
|
updateEnvironmentModifications(result.environmentItems);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user