From 452e1ca232ea13aa0c0c11eb48db68ea0303e38f Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns Date: Thu, 17 Nov 2022 07:37:05 +0100 Subject: [PATCH] Docker: Ensure workdir for processes is reachable When starting a process, make sure that the working directory is reachable. Change-Id: I911239d03afd916411d7fb03da806211349ff7e4 Reviewed-by: David Schulz Reviewed-by: Qt CI Bot --- src/plugins/docker/dockerdevice.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/plugins/docker/dockerdevice.cpp b/src/plugins/docker/dockerdevice.cpp index 1ebe044a913..05f053438a3 100644 --- a/src/plugins/docker/dockerdevice.cpp +++ b/src/plugins/docker/dockerdevice.cpp @@ -222,8 +222,14 @@ CommandLine DockerProcessImpl::fullLocalCommandLine(bool interactive) QStringList args; if (!m_setup.m_workingDirectory.isEmpty()) { - QTC_CHECK(DeviceManager::deviceForPath(m_setup.m_workingDirectory) == m_device); - args.append({"cd", m_setup.m_workingDirectory.path()}); + FilePath workingDir = m_setup.m_workingDirectory; + + if (DeviceManager::deviceForPath(workingDir) != m_device) { + QTC_CHECK(m_device->ensureReachable(workingDir)); + workingDir = workingDir.onDevice(m_device->rootPath()); + } + + args.append({"cd", workingDir.path()}); args.append("&&"); }