Commit Graph

86 Commits

Author SHA1 Message Date
Jarek Kobus
97a66067bb TaskTree: Prepare for de-utils-ization - part 2
Move TaskTree into Tasking namespace.
Move Tasking namespace out of Utils namespace.

Change-Id: Ib4c1d7f54f1808517e54768dfa27209c33517b61
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2023-05-12 08:09:19 +00:00
Jarek Kobus
2bec94ea58 Tasking::Transfer: Rename Transfer into FileTransferTask
Rename TransferTest into FileTransferTestTask.
Rename adapters accordingly.

Task-number: QTCREATORBUG-29102
Change-Id: I50c8b8d64abd7d3063044eaf2e0daceb01e8d388
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-05-10 06:07:30 +00:00
Jarek Kobus
a0f6e8dc04 Utils: Rename qtcprocess.{cpp,h} -> process.{cpp,h}
Follows QtcProcess -> Process rename.

Change-Id: I97235a9a40cb7fd52944515b7ab878d96528f919
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-05-04 05:52:26 +00:00
Jarek Kobus
470c95c94b Utils: Rename QtcProcess -> Process
Task-number: QTCREATORBUG-29102
Change-Id: Ibc264f9db6a32206e4097766ee3f7d0b35225a5c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2023-05-04 05:52:16 +00:00
Jarek Kobus
1d69f943aa Tasking::Process: Rename Process into ProcessTask
Rename QtcProcessAdapter into ProcessTaskAdapter.

Task-number: QTCREATORBUG-29102
Change-Id: I1902c7176da75db60d70125f505084a2ea5ba774
Reviewed-by: hjk <hjk@qt.io>
2023-05-03 12:47:24 +00:00
hjk
432d8e6e63 RemoteLinux: Proper double-remote
There seems something wrong with quoting the sed command for port
access which should be fixed independently.

As it is not crucial for plain deployment / run, make the test optional.

Change-Id: Id82bdc7c25a7fb6e2f8799676b869216a7720cfa
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-04-04 07:01:39 +00:00
hjk
3cd0dad3d4 RemoteLinux: Set up GenericCopy step when sftp and rsync fail
Change-Id: Ia99275c9e1cabe06613a138dec87bd9c2f98b258
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-04-03 07:08:36 +00:00
hjk
e094e738b0 RemoteLinux: Have an extra simple echo test
First test without additional complications through quoting.
Makes debugging easier.

Change-Id: I3ea1a0725474fed09204fda1219cbc535bd2ef7c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-04-03 06:15:41 +00:00
hjk
c6565611d6 RemoteLinux: Don't crash on empty test output
Amends 95609cdd57.

Change-Id: Id316ccf1989ac7853bdb71b22351aec7fd12fe7a
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-03-31 11:16:39 +00:00
hjk
2eebfb130c RemoteLinux: Also check for generic copy in device test
Currently both ssh and rsysnc don't work on double remote, this
allows passing the test with some deployment.

Change-Id: Iad2f125b09d1b326d6399cdc3dff0faa9430e92d
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-03-29 13:08:45 +00:00
Kai Köhne
56baf8c058 Remove GPL-3.0+ from license identifiers
Since we also license under GPL-3.0 WITH Qt-GPL-exception-1.0,
this applies only to a hypothetical newer version of GPL, that doesn't
exist yet. If such a version emerges, we can still decide to relicense...

While at it, replace (deprecated) GPL-3.0 with more explicit GPL-3.0-only

Change was done by running

  find . -type f -exec perl -pi -e "s/LicenseRef-Qt-Commercial OR GPL-3.0\+ OR GPL-3.0 WITH Qt-GPL-exception-1.0/LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0/g" {} \;

Change-Id: I5097e6ce8d10233993ee30d7e25120e2659eb10b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-01-06 11:15:13 +00:00
Jarek Kobus
6dc1a1e98f LinuxDeviceTester: Avoid non-trivial global variables
Change-Id: I1c3cf646ecbd6619f7c5a6eb117a0aca43d78534
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-11-25 08:55:44 +00:00
Jarek Kobus
b34fc8a420 LinuxDeviceTester: Make it possible to add extra tasks
Change-Id: I8e1308aef73a6f81fcff092ba75c1c88479c2207
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-11-25 08:55:34 +00:00
Jarek Kobus
658c9f6f06 LinuxDeviceTester: Make it possible to test extra commands
Change-Id: I1920457a4d97bf23865ad6c4842fbdbb40c2db23
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-11-25 08:51:48 +00:00
Jarek Kobus
a6015a6216 LinuxDeviceTester: Use Storage for internal inter-process data
Change-Id: If186c2cd83781a1de4c2a9d579611079ee7318b4
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2022-11-24 10:33:25 +00:00
Jarek Kobus
c88a829059 RsyncDeployService: Reuse TaskTree
Change-Id: I411726e47550da5fd3269fcbb3e4f3e19096adeb
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-11-23 15:12:14 +00:00
Jarek Kobus
95609cdd57 Reuse TaskTree inside LinuxDeviceTester
Change-Id: Id0e8df92acf3602dd755f728c79505f266f90eb6
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-11-18 16:05:01 +00:00
Jarek Kobus
3a1f94ec28 Add adapters for FileTransfer and DeviceUsedPortsGatherer
Change-Id: I2ead2129625ae54919cf75e517e9b2180bb4bc47
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-11-18 16:03:32 +00:00
hjk
b323303518 RemoteLinux: Fix deployment when building remotely
By using a generic file transfer method based of FilePath::copyFile()
that doesn't require either of the transfer end point to be the
local host.

Change-Id: Ia2e4273df52f5ce6533046d96be3f6b521b7f0a5
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-10-18 12:21:44 +00:00
Lucie Gérard
a7956df3ca Use SPDX license identifiers
Replace the current license disclaimer in files by
a SPDX-License-Identifier.

Task-number: QTBUG-67283
Change-Id: I708fd1f9f2b73d60f57cc3568646929117825813
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-08-26 12:27:18 +00:00
hjk
23d9ef1adb RemoteLinux: Convert to Tr::tr
Change-Id: I1c541d392992fb37acecbb98f331e01d7b73fbc7
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-07-22 11:11:48 +00:00
David Schulz
153ff77a6b Utils: use cleaned stdout all over the place again
Amends 5ee880ce5e

Change-Id: Ie0202db7d8455372c3697087d9571db6706b45a1
Reviewed-by: hjk <hjk@qt.io>
2022-06-17 13:04:42 +00:00
Jarek Kobus
af8f6dc039 LinuxDeviceTester: Test if required commands are available
Change-Id: Iaad3ec8667c4134ead86ca9e3239e810554b8f43
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2022-06-16 09:28:49 +00:00
Jarek Kobus
0efb8d3346 GenericLinuxDeviceTester: Don't continue testing when echo fails
Change-Id: I4b21e1b914816271d59f9001122aedf1eda342dc
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-06-14 09:19:02 +00:00
Jarek Kobus
7d848364ff Move FileTransfer into ProjectExplorer plugin
Make it ready for providing implementations for other devices.

Change-Id: I14eaf167a7b2c1189f4d23f2e9f556204295b9b3
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-05-30 10:10:33 +00:00
Jarek Kobus
82d84ea958 GenericLinuxDeviceTester: Replace connection test with echo
If the echo command succeeds, the connection is established
properly.
Remove the usage of SshConnection from this test.

Change-Id: I02c6bf9214e01353be938ed6cd87d625b37672ee
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-05-20 15:58:37 +00:00
Jarek Kobus
c31285d317 GenericLinuxDeviceTester: Use FileTransfer for sftp and rsync
Make ProcessArgs::prepareCommand() return false in case
when executable is a relative path and it can't be found.

Amends 13067a7d9c

Change-Id: I0c4cf1580be34894df01245eb2411cdd7a122651
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-05-20 09:19:59 +00:00
Jarek Kobus
6cd736fe6c Remove algorithm.h from buildtargetinfo.h
Change-Id: I777212fb94d46c1c71f017288b7e38dd5db62a91
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-05-18 08:38:05 +00:00
Jarek Kobus
ef2c551121 GenericLinuxDeviceTester: Make some order in implementation
Change-Id: I83a3c2880b055d0d74af402df876748975a7450e
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-05-16 10:34:54 +00:00
Jarek Kobus
257abc627c SftpTransfer: Get rid of FileTransferErrorHandling enum
FileTransferErrorHandling::Ignore wasn't used anywhere.

Change-Id: I5826fc9f7871b06cd8f423d7e3b1d01a5b6cbdff
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-05-11 08:16:59 +00:00
hjk
1ffaf0139a ProjectExplorer: Introduce a IDevice::filePath
Same function as mapToGlobalPath, but operating on a QString specifying
the local path part. It's the majority use case and arguably the 'right
thing' to use instead of a full FilePath that can refer to arbitrary
devices.

Change-Id: Ifc8bd340e2e8859fe549f5724eb94269f587c418
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-05-10 15:20:06 +00:00
Jarek Kobus
d8ee25ec3d Move setupSshEnvironment() into SshConnectionParameters
As we are going to remove SshRemoteProcess.

Change-Id: I07cf246791f1adb6cfc454935d7e330c2f1d4dc7
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2022-05-09 07:42:02 +00:00
Jarek Kobus
910dd04bf7 GenericLinuxDeviceTester: Don't use SshRemoteProcess for uname
Use QtcProcess with a path on device instead.

Change-Id: If38731f0648412874ebb1319ec53627f65f69108
Reviewed-by: hjk <hjk@qt.io>
2022-05-03 19:32:59 +00:00
Jarek Kobus
8816759a85 GenericLinuxDeviceTester: Connect to QtcProcess::done() signal
Instead of connecting to errorOccurred() and finished() signals.

Change-Id: I507b05cfc979db56ac7101432dd20acb68848d48
Reviewed-by: hjk <hjk@qt.io>
2022-04-06 13:54:45 +00:00
Jarek Kobus
ab11c4373b QtcProcess: Introduce done() signal
Introduce QtcProcess::done() signal. It's similar to
QtcProcess::finished() signal, but also emitted when
process failed to start (so after QProcess::FailedToStart
error occurred).

SshRemoteProcess::finished() signal was already behaving
like this. So, we remove special handling of
FailedToStart error in this class and connect all clients
of SshRemoteProcess to done() signal, instead of finished().

Task-number: QTCREATORBUG-27232
Change-Id: If4240e2172f3f706e812bca669a1d5b24bdc3285
Reviewed-by: hjk <hjk@qt.io>
2022-04-04 13:28:12 +00:00
Jarek Kobus
0dfcc97a3e SshRemoteProcess: Rename done() -> finished()
Change-Id: I9c22d075f50b0a2a171cbda11c7579e4735f3f4e
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-02-28 16:12:27 +00:00
Jarek Kobus
7b5dfcd6cd SshRemoteProcess: Get rid of error arg from done() signal
Prepare for signal rename done() -> finished().

Change-Id: I81a7bd0a4826ce6200f4af47ba5868ceedb42206
Reviewed-by: hjk <hjk@qt.io>
2022-02-28 14:21:47 +00:00
Jarek Kobus
098e3794db Get rid of SshProcess (one process class less)
Introduce static SshRemoteProcess::setupSshEnvironment()
method instead.

Change-Id: I9a49bc68bd96ddf0f58234d28b92a721f7d4bb56
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-02-21 16:17:31 +00:00
Jarek Kobus
f72c4cb8ac Ssh: Re-base SshProcess on top of QtcProcess
Change-Id: I266820e0e2ea12d6e4a5a83a679a7279fab9cd83
Reviewed-by: hjk <hjk@qt.io>
2021-09-13 09:26:09 +00:00
Jarek Kobus
33f1a96005 Control the lifetime of SshProcessManager
Make it possible to control when the SshProcessManager is
being constructed / destructed. Expose public constructor.

Since different singletons depend on each other, we need
to control the order of creation and destruction of them.

The order of creation is like that:

1. QCoreApplication
2. ProcessReaper
3. ProcessLauncher
4. SshConnectionManager

The order of destruction must be opposite to the above.

Change-Id: Ice07eb751cd61c03cb461816fa1b74ab040a53de
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-09-10 14:02:21 +00:00
hjk
ed9f4be3ee RemoteLinux: Use a RemoteLinux.SupportsRSync key
... into the Device::extraData map instead of dedicated accessors.

This weakens the compile time dependencies of the RSyncBuildStep,
LinuxDevice, and GenericLinuxDeviceTester at the price of weaker,
local typesafety for one bool value.

Potentially this could go into the direction of re-using bits
of "device feature" discovery and use. Nothing planned, though.

Change-Id: I9aa6dce8066b82d344f64f38707f17416e273957
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-04-09 11:19:36 +00:00
Christian Kandeler
016ad4a978 SSH: Fix for Microsoft-provided sftp.exe
The sftp.exe shipped with Windows 10 does not emit a prompt to stdout
when invoked via QProcess and thus cannot be used to establish an SFTP
session. However, batch mode can be made to work, so we now use that in
our device tester.

Fixes: QTCREATORBUG-22471
Change-Id: Ia55e66c6f342720c9a0f0c1943f6d9d969842bad
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2019-10-01 08:51:33 +00:00
Christian Kandeler
b70d39a091 RemoteLinux: Let user specify the rsync flags
Task-number: QTCREATORBUG-22352
Change-Id: I11c16b5f7c58093bb89a9493a8742f338dbdd9c1
Reviewed-by: hjk <hjk@qt.io>
2019-05-24 16:37:44 +00:00
hjk
6f37348b4c Replace static_casts by QOverload where possible
Mainly to get rid of the QProcess::finished deprecation warning.

Also adjust coding style in the surrounding connects when needed.

Change-Id: I12f9b248c7974b892c4a069356e578e80f8c59e9
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-02-26 15:18:14 +00:00
Christian Kandeler
8662d0a9c0 RemoteLinux: Make it clear that rsync is not strictly needed
... by adding some soothing output to the device tester.

Fixes: QTCREATORBUG-21749
Change-Id: I6d2125d50716192a7fcd09f41269a32b41ad9be6
Reviewed-by: James McDonnell <jmcdonnell@blackberry.com>
2019-01-15 17:32:16 +00:00
Christian Kandeler
a0a97c2edc RemoteLinux: Use an SshProcess for rsync
Otherwise, if connection sharing is disabled and public key
authentication fails, the askpass tool is not invoked.

Change-Id: Iea8316675b8f270c924f822f340f6282b21450d5
Reviewed-by: hjk <hjk@qt.io>
2018-12-21 08:05:48 +00:00
Christian Kandeler
8098588a97 RemoteLinux: Do not use SftpTransfer in device tester
When the -b switch is used, sftp does not invoke the askpass tool, so
this mode is not suitable for an initial device test. Use SftpSession
instead.

Change-Id: I0ad6e79e821851b6fae2cd11c6194c1956a73d02
Reviewed-by: hjk <hjk@qt.io>
2018-12-20 12:29:42 +00:00
Christian Kandeler
1dfa7279d4 RemoteLinux: Add an rsync deploy step
Using rsync enables proper incremental deployment and is particularly
helpful when larger files are involved.
We check whether rsync works as part of the device test. If it does, it
becomes the default deploy step, otherwise we fall back to SFTP.

Change-Id: I6ab938ccd5acd7e0cbe07b90b6938dccad19bba5
Reviewed-by: hjk <hjk@qt.io>
2018-12-17 13:42:25 +00:00
Christian Kandeler
cc812e841b RemoteLinux: Use SSH connection sharing in device tester
No need to connect more than once during the testing process.

Change-Id: I2401a2c1e5b940b6b12e86182d37a099e94680dd
Reviewed-by: hjk <hjk@qt.io>
2018-12-14 16:17:00 +00:00
Christian Kandeler
d7178b88c4 SSH: Use OpenSSH tools
... instead of our own SSH library.

Advantages:
    - Full compatibility with OpenSSH behavior guaranteed.
    - Minimal maintenance effort.
    - Less code to build.
    - Big chunk of 3rd party sources can be removed from our repository.

One the downside, Windows users now need to install OpenSSH for
RemoteLinux support. Hoewever, people doing embedded development
probably have it installed anyway.

[ChangeLog] Switched SSH backend to OpenSSH

Fixes: QTCREATORBUG-15744
Fixes: QTCREATORBUG-15807
Fixes: QTCREATORBUG-19306
Fixes: QTCREATORBUG-20210
Change-Id: Ifcfefdd39401e45ba1f4aca35d2c5bf7046c7aab
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-12-13 15:10:11 +00:00