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 <david.schulz@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
Marcus Tillmanns
2022-11-17 07:37:05 +01:00
parent 49546c4f48
commit 452e1ca232

View File

@@ -222,8 +222,14 @@ CommandLine DockerProcessImpl::fullLocalCommandLine(bool interactive)
QStringList args; QStringList args;
if (!m_setup.m_workingDirectory.isEmpty()) { if (!m_setup.m_workingDirectory.isEmpty()) {
QTC_CHECK(DeviceManager::deviceForPath(m_setup.m_workingDirectory) == m_device); FilePath workingDir = m_setup.m_workingDirectory;
args.append({"cd", m_setup.m_workingDirectory.path()});
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("&&"); args.append("&&");
} }