forked from qt-creator/qt-creator
Docker: Fix cmdbridge init when docker is remote
If the user has specified a remote path for the "docker" executable it is not possible to simply bind the cmdbridge as its on a different device. We fall back to copying the cmdbridge in this case. Task-number: QTCREATORBUG-31364 Change-Id: I03b5594c1c942fe6539a45a32d2a31e24f2a493b Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -604,8 +604,12 @@ DockerDevice::DockerDevice(std::unique_ptr<DockerDeviceSettings> deviceSettings)
|
|||||||
return make_unexpected(cmdBridgePath.error());
|
return make_unexpected(cmdBridgePath.error());
|
||||||
|
|
||||||
auto fAccess = std::make_unique<DockerDeviceFileAccess>(d);
|
auto fAccess = std::make_unique<DockerDeviceFileAccess>(d);
|
||||||
expected_str<void> initResult = fAccess->init(
|
expected_str<void> initResult;
|
||||||
rootPath().withNewPath("/tmp/_qtc_cmdbridge"));
|
if (!cmdBridgePath->isSameDevice(Docker::Internal::settings().dockerBinaryPath())) {
|
||||||
|
initResult = fAccess->deployAndInit(Core::ICore::libexecPath(), rootPath());
|
||||||
|
} else {
|
||||||
|
initResult = fAccess->init(rootPath().withNewPath("/tmp/_qtc_cmdbridge"));
|
||||||
|
}
|
||||||
if (!initResult)
|
if (!initResult)
|
||||||
return make_unexpected(initResult.error());
|
return make_unexpected(initResult.error());
|
||||||
|
|
||||||
@@ -873,7 +877,7 @@ QStringList DockerDevicePrivate::createMountArgs() const
|
|||||||
for (const FilePath &m : deviceSettings->mounts())
|
for (const FilePath &m : deviceSettings->mounts())
|
||||||
mounts.append({m, m});
|
mounts.append({m, m});
|
||||||
|
|
||||||
if (cmdBridgePath)
|
if (cmdBridgePath && cmdBridgePath->isSameDevice(settings().dockerBinaryPath()))
|
||||||
mounts.append({cmdBridgePath.value(), FilePath("/tmp/_qtc_cmdbridge")});
|
mounts.append({cmdBridgePath.value(), FilePath("/tmp/_qtc_cmdbridge")});
|
||||||
|
|
||||||
for (const MountPair &mi : mounts) {
|
for (const MountPair &mi : mounts) {
|
||||||
|
Reference in New Issue
Block a user