CMake: Use shorter names for local sockets in server-mode

Apparently there is a limit to about 100 characters or so on some
versions of Unix (e.g. Darwin), and there is also the tendency to
point TMPDIR into places very far from '/' (e.g. Darwin), which
can result in the local socket path getting trunkated.

So make sure to put the local socket into /tmp on Unix. That works
on Linux and on Darwin.

Change-Id: I40bfaf932c5013cf72addb5621360e97c9583daa
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
Tobias Hunger
2017-01-23 15:47:15 +01:00
parent 5d53289f12
commit 588211e2e8
2 changed files with 18 additions and 9 deletions

View File

@@ -30,6 +30,7 @@
#include <QLoggingCategory>
#include <QTimer>
#include <QVariantMap>
#include <QTemporaryDir>
#include <memory>
@@ -84,6 +85,9 @@ private:
void reportError(const QString &msg);
#if defined(Q_OS_UNIX)
QTemporaryDir m_socketDir;
#endif
std::unique_ptr<Utils::QtcProcess> m_cmakeProcess;
QLocalSocket *m_cmakeSocket = nullptr;
QTimer m_connectionTimer;
@@ -112,6 +116,7 @@ private:
const int m_minorProtocol = -1;
int m_requestCounter = 0;
};
} // namespace Internal