Commit Graph

72 Commits

Author SHA1 Message Date
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
Alessandro Portale
f52f25e150 RemoteLinux: Modernize
modernize-*

Change-Id: Ifdf0e781c63941625ca032a8e1752082f4abc3ce
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-11-28 17:47:02 +00:00
Christian Kandeler
6dbdb2dc9a RemoteLinux: Check SFTP functionality in device test
Uploading files is a typical activity when working with remote devices,
so we should give early feedback if that won't be possible.

Change-Id: I1dc578306b0179f6453bd7163a560880c99b0e13
Reviewed-by: hjk <hjk@qt.io>
2018-10-19 15:32:31 +00:00
hjk
2d9aa5596d RemoteLinux: Remove some unneeded code from GenericLinuxDeviceTester
Change-Id: Iabf995b340a521311f9f946c05e346ef07f4b3bf
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2017-11-10 11:39:13 +00:00
Orgad Shaneh
e3b1c9b912 RemoteLinux: Use Qt5-style connects
The heavy lifting was done by clazy.

Change-Id: I1a03435bbb4281bad4ff64baba0182e0050170d6
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
2016-07-01 11:29:27 +00:00
Ulf Hermann
385237dbbd Use Utils::Port where possible
This solves the ambiguity between 0 and -1 being the "invalid" port.

Change-Id: I3bac11dd4117bb1820fbd58186699925b73df1c5
Reviewed-by: hjk <hjk@theqtcompany.com>
2016-04-20 11:06:34 +00:00
Tobias Hunger
397e7f4843 Update License according to agreement with Free Qt Foundation
* Update files in src/plugins

Change-Id: Ia5d77fad7d19d4bb3498e78661982f68729adb22
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-01-19 15:57:01 +00:00
Eike Ziller
9926fc2ab1 Merge commit '3c85058694ee2e41658d17f524fb48f0b187d2fe'
Conflicts:
	src/libs/utils/tooltip/tipcontents.cpp
	src/libs/utils/tooltip/tipcontents.h
	src/plugins/android/androiddeployqtstep.cpp
	src/plugins/baremetal/baremetalconstants.h
	src/plugins/baremetal/baremetaldevice.cpp
	src/plugins/baremetal/baremetaldevice.h
	src/plugins/baremetal/baremetaldeviceconfigurationwidget.cpp
	src/plugins/baremetal/baremetaldeviceconfigurationwidget.h
	src/plugins/baremetal/baremetaldeviceconfigurationwizard.cpp
	src/plugins/baremetal/baremetaldeviceconfigurationwizardpages.cpp
	src/plugins/baremetal/baremetaldeviceconfigurationwizardpages.h
	src/plugins/baremetal/baremetalplugin.cpp
	src/plugins/baremetal/baremetalplugin.h
	src/plugins/baremetal/baremetalruncontrolfactory.cpp
	src/plugins/baremetal/baremetalruncontrolfactory.h
	src/plugins/cppeditor/cppcodemodelinspectordialog.cpp
	src/plugins/cppeditor/cppdoxygen_test.cpp
	src/plugins/cppeditor/cppdoxygen_test.h
	src/plugins/debugger/breakpointmarker.cpp
	src/plugins/debugger/debuggeritemmodel.cpp
	src/plugins/debugger/debuggeritemmodel.h
	src/plugins/debugger/loadcoredialog.cpp
	src/plugins/genericprojectmanager/cppmodelmanagerhelper.cpp
	src/plugins/projectexplorer/addnewmodel.cpp
	src/plugins/projectexplorer/addnewmodel.h
	src/plugins/projectexplorer/jsonwizard/jsonfieldpage.cpp
	src/plugins/qmlprofiler/abstracttimelinemodel.cpp
	src/plugins/qmlprofiler/abstracttimelinemodel.h
	src/plugins/qmlprofiler/notesmodel.cpp
	src/plugins/qmlprofiler/qml/CategoryLabel.qml
	src/plugins/qmlprofiler/qml/MainView.qml
	src/plugins/qmlprofiler/qml/Overview.js
	src/plugins/qmlprofiler/qml/Overview.qml
	src/plugins/qmlprofiler/qml/TimeDisplay.qml
	src/plugins/qmlprofiler/qml/TimeMarks.qml
	src/plugins/qmlprofiler/qmlprofilertimelinemodelproxy.cpp
	src/plugins/qmlprofiler/sortedtimelinemodel.cpp
	src/plugins/qmlprofiler/sortedtimelinemodel.h
	src/plugins/qmlprofiler/timelinemodelaggregator.cpp
	src/plugins/qmlprofiler/timelinemodelaggregator.h
	src/plugins/qmlprofiler/timelinerenderer.cpp
	src/plugins/qmlprofiler/timelinerenderer.h
	src/plugins/qmlprojectmanager/QmlProjectManager.json.in
	src/plugins/texteditor/findinfiles.cpp
	src/plugins/vcsbase/vcsconfigurationpage.cpp
	src/shared/qbs
	src/shared/scriptwrapper/interface_wrap_helpers.h
	src/shared/scriptwrapper/wrap_helpers.h
	tests/auto/qmlprofiler/abstracttimelinemodel/tst_abstracttimelinemodel.cpp
	tests/system/suite_debugger/tst_debug_empty_main/test.py
	tests/system/suite_debugger/tst_qml_js_console/test.py
	tests/system/suite_debugger/tst_qml_locals/test.py

Change-Id: I67540b648f8b162496f4aa606b04d50c7c9125c6
2015-02-12 17:29:21 +01:00
Montel Laurent
063251ebbc Port to new connect api
Change-Id: I873a36601d54065b61d0666558b93dc839ad0dfc
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-01-30 10:40:25 +00:00
Eike Ziller
3c85058694 Update License
Change-Id: I711d5fb475ef814a1dc9d2822740e827f3f67125
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
2015-01-16 12:37:56 +01:00
Eike Ziller
8295b503be License update
Change-Id: I3c22ef2685d7aa589f5d0ab74d693653a4c32082
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
2014-10-09 11:41:44 +02:00
Robert Loehning
746c5d8863 Incremented year in copyright info
Change-Id: Ib5423fdd064e4546f848c0b640b0ed0514c26d3a
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2014-01-08 08:29:47 +01:00
Friedemann Kleint
50f522b2f7 Remove most trailing newlines from translated messages.
They are a hassle for translators and reviewers alike.

Change-Id: I07c1b61e8b6719e54fdc1f69cf63f573119a6776
Reviewed-by: hjk <hjk121@nokiamail.com>
Reviewed-by: Robert Loehning <robert.loehning@digia.com>
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2013-10-22 08:05:09 +02:00
Christian Kandeler
5bca241afb Device support: Make device testing a "well-known" concept.
This entails the following:
    - Rename AbstractLinuxDeviceTester to DeviceTester and
      move it up into ProjectExplorer. The class stays
      unchanged, as there was nothing Linux-specific about it.
      The same goes for the associated dialog.
    - Move the createDeviceTester() function from LinuxDevice
      to IDevice and introduce IDevice::hasDeviceTester() to
      enable generic code to make use of this feature.
    - Move device testing out of the list of opaque
      device-specific actions; instead, the device settings widget
      now uses the device tester directly, if applicable.
Rationale:
    - Device testing, just like remote process listing (if not more so),
      is a general concept that implementors of device classes will
      probably want to implement (and they should be encouraged to do so).
      Without the mechanism provided here, they would all need to put
      basically the same code into the actionIds(), displayNameForActionId()
      and executeAction() functions.

This patch is the natural extension of b90e3bbd8b.

Change-Id: I94f2badb4ceeda9f5cd3b066c13626bb4f65505d
Reviewed-by: hjk <hjk121@nokiamail.com>
Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
2013-07-02 15:02:48 +02:00
Robert Loehning
298531e370 Incremented year in copyright info
Change-Id: Ic6a9ff0359625021ebc061d22db6811814534205
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2013-01-29 16:27:03 +01:00