QtSupport: Catch some setup errors coming via stdout

Some setups pass error messages via stdout, fooling the detection logic
into believing everything is fine. We roughly know what to expect
from qmake -query, so we can at least filter out some cases.

Change-Id: I799a0bc708d44e062c8ad298c0d8fc576328e5b5
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2021-07-09 13:30:27 +02:00
parent 3c1e787215
commit 84befc2ae1

View File

@@ -1813,6 +1813,15 @@ bool BaseQtVersionPrivate::queryQMakeVariables(const FilePath &binary, const Env
QByteArray output; QByteArray output;
output = runQmakeQuery(binary, env, error); output = runQmakeQuery(binary, env, error);
if (!output.startsWith('Q')) { // Is it always "QT_SYSROOT="?
// Some setups pass error messages via stdout, fooling the logic below.
// Example with docker/qemu/arm "OCI runtime exec failed: exec failed: container_linux.go:367:
// starting container process caused: exec: "/bin/qmake": stat /bin/qmake: no such file or directory"
// Since we have a rough idea on what the output looks like we can work around this.
*error = QString::fromUtf8(output);
return false;
}
if (output.isNull() && !error->isEmpty()) { if (output.isNull() && !error->isEmpty()) {
// Note: Don't rerun if we were able to execute the binary before. // Note: Don't rerun if we were able to execute the binary before.