Boot2Qt: Fix default deployment method

This fix addresses two problems:

1) If no boot2qt device exists yet, no deploy step is created.
This is hard for the user to debug.
2) As the device supports rsync, an RsyncDeployStep would be created.
This is not optimal when the build device is remote, as the fallback
would not check if the target file is up-to-date first.

Therefore this fix adds another possible deploy step that will always
be created if either no device is available, or the build device is a
remote device.

Additionally this change adds an RSync deploy step if neither a remote
build device is set nor a target device.

Change-Id: I8959408e13d690d484ade9e837e7fa65eb106676
Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
Marcus Tillmanns
2022-10-27 10:19:19 +02:00
parent cb11763641
commit a71c036822

View File

@@ -34,12 +34,29 @@ QdbDeployConfigurationFactory::QdbDeployConfigurationFactory()
addInitialStep(Qdb::Constants::QdbStopApplicationStepId); addInitialStep(Qdb::Constants::QdbStopApplicationStepId);
addInitialStep(RemoteLinux::Constants::RsyncDeployStepId, [](Target *target) { addInitialStep(RemoteLinux::Constants::RsyncDeployStepId, [](Target *target) {
auto device = DeviceKitAspect::device(target->kit()); auto device = DeviceKitAspect::device(target->kit());
return device && device->extraData(RemoteLinux::Constants::SupportsRSync).toBool(); auto buildDevice = BuildDeviceKitAspect::device(target->kit());
if (buildDevice && buildDevice->rootPath().needsDevice())
return false;
return !device
|| (device && device->extraData(RemoteLinux::Constants::SupportsRSync).toBool());
}); });
addInitialStep(RemoteLinux::Constants::DirectUploadStepId, [](Target *target) { addInitialStep(RemoteLinux::Constants::DirectUploadStepId, [](Target *target) {
auto device = DeviceKitAspect::device(target->kit()); auto device = DeviceKitAspect::device(target->kit());
auto buildDevice = BuildDeviceKitAspect::device(target->kit());
if (buildDevice && buildDevice->rootPath().needsDevice())
return false;
return device && !device->extraData(RemoteLinux::Constants::SupportsRSync).toBool(); return device && !device->extraData(RemoteLinux::Constants::SupportsRSync).toBool();
}); });
// This step is for:
// a) A remote build device, as they do not support real rsync yet.
// b) If there is no target device setup yet.
addInitialStep(RemoteLinux::Constants::DirectUploadStepId, [](Target *target) {
auto device = DeviceKitAspect::device(target->kit());
auto buildDevice = BuildDeviceKitAspect::device(target->kit());
if (buildDevice && buildDevice->rootPath().needsDevice())
return true;
return false;
});
} }
} // namespace Internal } // namespace Internal