From b068cede11f8343e91238d8440f097cab5b0022d Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Fri, 7 Jan 2022 11:35:20 +0100 Subject: [PATCH] Fix processlauncher for tests The socket/name for QLocalServer must be a path that is short enough for unix sockets (<= 104 chars). QLocalServer already ensures that the "name" is an absolute path, by prepending QDir::tempPath() if it isn't. For Qt Creator that worked, but the temporary directory set up for the unittests resulted in a too long combined path. Also, we should avoid directly using QDir::tempPath() and use Utils::TemporaryDirectory to keep all our temporary files at one place. So, make the "name" explicitly an absolute path in our specific temporary directory, and make the name shorter for the test. See 6feed6e656f250b8783f80341e81a5c87ec7ef6c for a similar issue. Change-Id: I07dc4233db1c9d353cd6977da43850256057ba55 Reviewed-by: Jarek Kobus Reviewed-by: Reviewed-by: hjk --- src/libs/utils/launcherinterface.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libs/utils/launcherinterface.cpp b/src/libs/utils/launcherinterface.cpp index 74636a6640b..a77650745a7 100644 --- a/src/libs/utils/launcherinterface.cpp +++ b/src/libs/utils/launcherinterface.cpp @@ -29,6 +29,7 @@ #include "launcherpackets.h" #include "launchersocket.h" #include "qtcassert.h" +#include "temporarydirectory.h" #include #include @@ -72,8 +73,8 @@ private: static QString launcherSocketName() { - return QStringLiteral("qtcreator_processlauncher-%1") - .arg(QString::number(qApp->applicationPid())); + return Utils::TemporaryDirectory::masterDirectoryPath() + + QStringLiteral("/launcher-%1").arg(QString::number(qApp->applicationPid())); } class LauncherInterfacePrivate : public QObject