diff --git a/src/plugins/qtsupport/baseqtversion.cpp b/src/plugins/qtsupport/baseqtversion.cpp index b670482729a..6165d543033 100644 --- a/src/plugins/qtsupport/baseqtversion.cpp +++ b/src/plugins/qtsupport/baseqtversion.cpp @@ -1813,6 +1813,15 @@ bool BaseQtVersionPrivate::queryQMakeVariables(const FilePath &binary, const Env QByteArray output; 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()) { // Note: Don't rerun if we were able to execute the binary before.