From a71c0368225c6ef3f0141fdb0f5893da946c0514 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns Date: Thu, 27 Oct 2022 10:19:19 +0200 Subject: [PATCH] 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 Reviewed-by: --- .../boot2qt/qdbdeployconfigurationfactory.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/plugins/boot2qt/qdbdeployconfigurationfactory.cpp b/src/plugins/boot2qt/qdbdeployconfigurationfactory.cpp index 1eedc858a33..90612415764 100644 --- a/src/plugins/boot2qt/qdbdeployconfigurationfactory.cpp +++ b/src/plugins/boot2qt/qdbdeployconfigurationfactory.cpp @@ -34,12 +34,29 @@ QdbDeployConfigurationFactory::QdbDeployConfigurationFactory() addInitialStep(Qdb::Constants::QdbStopApplicationStepId); addInitialStep(RemoteLinux::Constants::RsyncDeployStepId, [](Target *target) { 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) { 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(); }); + // 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