Commit Graph

203 Commits

Author SHA1 Message Date
hjk
5996e58ffa ProjectExplorer: Allow Devices to be added without using the wizard
This re-organizes the buttons on the main device page a bit: The
topmost one still starts the wizard selection, below that are direct
individual buttons to add specific devices.

Change-Id: I52b2803febf658259dde9589544656fd4c8fc889
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-03-24 13:20:19 +00:00
hjk
2766b4004b Utils: Continue Environment/EnvironmentChange consolidation
Make Environment a stack of changes that gets "expanded" to
a full environment before things are actively accessed.

Later this expansion should be done lazily if possible.

Task-number: QTCREATORBUG-28357
Change-Id: If1c7bfdb9f58b81e71c51ed87ee75d6964a47019
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-03-24 07:45:35 +00:00
Marcus Tillmanns
29873068eb Utils: Store Device::osType in settings
Change-Id: I41348be752598b7a8d1f1979764e7111cccc95a9
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-03-23 12:33:58 +00:00
Marcus Tillmanns
44074accc7 Terminal: Use QtcProcess to start terminal window
Previously DesktopDevice::openTerminal used custom code to open a
terminal window. This patch changes it to use QtcProcess with
TerminalMode::On.

This also removes the need for "openTerminal.py" on macOS.

Change-Id: Iec978bdd19487ff8e59dcd88c35c2d01b0681022
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-03-21 15:09:15 +00:00
hjk
3868711995 RemoteLinux: Merge SshProcessInterface and LinuxProcessInterface
Change-Id: I961f65551a4c3146e8bab220b7c37a76c3f9fb38
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-03-20 13:06:30 +00:00
hjk
024897521c RemoteLinux: Disable sourcing /etc/profile and ~/.profile by default
[ChangeLog][RemoteLinux] Target-side shell profiles are not sourced by
default anymore.

Change-Id: Ide5029d02a0d149c4e532ee523f1dd49e7080c7b
Reviewed-by: hjk <hjk@qt.io>
2023-03-17 14:18:09 +00:00
hjk
3507229a00 RemoteLinux: Use SshParameter::userAtHost()
... instead of rolling its own.

Change-Id: I99cf1714e871b3af2c825d3b3f131982383a10b7
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-03-15 15:07:23 +00:00
Jarek Kobus
a43c20969c QtcProcess: Remove TerminalMode::Pty enum value
Make Pty::Data optional. When set, the PtyProcessImpl
implementation is implied.

Change-Id: I7990e9d9016223e6597d876a5d0c4ed177365874
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-03-15 13:52:45 +00:00
Marcus Tillmanns
2d15be91bf ProjectExplorer: Consolidate ProcessList
* Combined local and ssh process list retrieval into LocalProcessList
* Combined QnxProcessList into LocalProcessList
* Renamed LocalProcessList to ProcessList

Change-Id: I230c575375e306c638e4ca3034fa2d7ed243a44c
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2023-03-14 14:40:19 +00:00
hjk
08bacd3f19 Avoid a few double lookups when expanding environment values
Change-Id: Ie84caee89a48d8006e6324c5a82901d01a5fac6c
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-03-03 11:37:05 +00:00
hjk
21de068c14 RemoteLinux: Avoid some explicit uses of environment iterators
Task-number: QTCREATORBUG-28357
Change-Id: Ic8eb7592853749a7d511acc9a528059765c4ed75
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-03-02 16:02:33 +00:00
Marcus Tillmanns
1da18a4b62 Utils: Integrate ptyqt into qtcprocess
Integrating PtyQt directly into QtcProcess allows us to
start Pseudo terminal processes using the existing QtcProcess
functionality such as starting remote process on e.g. docker
or remote linux devices.

This is needed for the new Terminal plugin.

Change-Id: Iaeed5ff9b341ba4646d955b2ed9577a18cd7100f
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-03-02 14:10:11 +00:00
Jarek Kobus
8b09ad8898 QtcProcess: Introduce PtyData
That's going to be used by PtyProcessImpl.

Change-Id: Ifc1a7886ceed73272c9e415414db49452175a334
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-03-02 14:10:06 +00:00
Marcus Tillmanns
47cdeb779a RemoteLinux: Fix terminal opening
Enforce setting a shell to start based on whether environment variables
might be set.

Fixes: QTCREATORBUG-28738
Change-Id: Ic43f0057bc89410e3146bafa2b109f472e01aa3b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-02-14 14:16:53 +00:00
Jarek Kobus
0d0ce383be RemoteLinux: Reuse StringUtils::joinStrings()
Change-Id: I5be99df99a4b3952374b9f3b719d032d897b691c
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-02-03 12:03:59 +00:00
Marcus Tillmanns
7fbb41c10c RemoteLinux: Cache device environment
Change-Id: Ida735b69179b418c21d3875c3906b9449709623a
Reviewed-by: hjk <hjk@qt.io>
2023-02-01 17:24:17 +00:00
Marcus Tillmanns
fb6fc2bde8 Utils: Add combine with device env option
Adds the option Environment::combineWithDeviceEnvironment. This allows
the linuxdevice to set it to false.

Without this option a deadlock would occur when the QtcProcess tries to
get the device environment and the device shell failed to start.
(e.g. because a required command is missing on the device).

Change-Id: I8f7550d0d90e989a339f27e993a836e67e910e33
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2023-02-01 17:24:07 +00:00
Jarek Kobus
8e3a22329d QtcProcess: Add closeWriteChannel()
Change-Id: I080be230ec420ead2866f9481123125361e57033
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-01-24 08:48:12 +00:00
Jarek Kobus
1dad90ea45 RemoteLinux: Don't call mutable expressions inside QTC_ASSERT
In order to conform to the theory: "Removing all
QTC_ASSERTs and QTC_CHECKs should not change anything".

Change-Id: I3f544f8cdcede99d7efa3ba0ef456180203c45be
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-01-12 09:37:27 +00:00
hjk
4ddd28ae22 Utils: Rename QtcProcess::readAllStandard* to readAllRawStandard*
... and re-use the old QtcProcess::readAllStandard* names for
a QString-returning 'decoded' version.

For now, only use that in 'full Utf8' cases, to stay bug-compatible,
the plan is, however, to employ the QTextCodecs we have already
in the channel buffers. That will be one-by-one, though.

Change-Id: Id209e0671920d4ea4197918e872f441254112d52
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-01-10 12:08:53 +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
hjk
674aad728e RemoteLinux: Hard-code /bin/sh for use in Open Terminal
... when changes to the environment are requested.

Ideally, that should be the user's chosen shell on the device,
but ssh does not support the case of specifying shell variables
without also giving an executable.

Short of playing tricks with /etc/passwd, getent, or env, use
/bin/sh which is guaranteed to exist.

Change-Id: I8d4b87f2a94eb9614d85dcacebd539ac645dc33d
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-12-16 12:50:49 +00:00
hjk
ca6b14cf01 ProjectExplorer: Funnel environment fetching through device access
Easier nowadays. It's synchronous now, so conceptually worse,
but 'env' is not worse than 'ls', and this is used regularly
all over the place also for larger data sets without being a problem.

Change-Id: I2c2b1db8c07ff5c128700d4a1deefd710967568a
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-12-15 14:17:36 +00:00
Eike Ziller
a3fe24d192 Merge remote-tracking branch 'origin/9.0'
Change-Id: I5298a6529921568ec32c0fe0c009c273263b0f5d
2022-12-14 14:25:38 +01:00
Jarek Kobus
218b19fe14 SshProcessInterface: Limit waiting for kill to finish
This is just a workaround for 9.0 and not a proper fix!

It looks like sometimes kill command may freeze. Don't blocking
wait for it for 30 seconds - limit this time to 2 seconds.

Do the same inside SimpleTargetRunner. Pretend the process
finished after 2 seconds, otherwise the SimpleTargetRunner
object gets leaked and we start receiving asserts from
ProcessLauncher about destructing it when still some processes
are being run.

Task-number: QTCREATORBUG-28072
Change-Id: I9766e7ff6f0c2abf2010686027702d30d32c4318
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2022-12-12 10:36:08 +00:00
Jarek Kobus
55ba10be38 RemoteLinux: Pass context object to lambda connections
Change-Id: I025c588e7d32be0f940b74acf9421965073cff5c
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-12-08 13:51:06 +00:00
Eike Ziller
ae67799eb3 Merge remote-tracking branch 'origin/9.0'
Change-Id: I2123e09f75199a63af6e8505fb8889e7f9d025d2
2022-11-16 09:40:34 +01:00
Jarek Kobus
f8a3a4d04e SshProcessInterface: Don't use DeviceShell for control signals
It looks like starting device shell is fragile in some
circumstances.

Fixes: QTCREATORBUG-28072
Change-Id: I1a51d1fb939bd42884a55e1492de808bee89219f
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-11-15 15:49:18 +00:00
Jarek Kobus
adac83367c LinuxDevice: Fix stopping remote app when run in terminal
Before, the SshProcessInterface was trying to run kill
command (on remote host) for the running processId. However,
in case of terminal process the returned processId is an id
of ssh running through creator process stub, not the id of
remote process. The fix is to redirect a call to sendControlSignal
into the internal terminal process.

Change-Id: I57509fd61a54c335ab0a34f8ca0dffb3d75da696
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2022-11-15 11:11:39 +00:00
Eike Ziller
68388a38dd Merge remote-tracking branch 'origin/9.0'
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri
	src/plugins/qmldesigner/components/edit3d/edit3dwidget.cpp

Change-Id: I154a9ababa9e166cb06e98652d481fe6234f6399
2022-11-03 13:44:37 +01:00
Eike Ziller
d9503cdf89 Fix lupdate error
GenericTransferImpl doesn't have a translation context and RemoteLinux
was changed to Tr::tr anyway.

Amends b323303518

Change-Id: I048cae28684e223ab1547a5e07d1aaf9bb46c73e
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-10-31 15:11:12 +00:00
Tim Jenssen
aa33927651 Merge remote-tracking branch 'origin/9.0'
Conflicts:
	src/plugins/qmldesigner/components/componentcore/modelnodeoperations.cpp
	src/plugins/qmldesigner/components/stateseditornew/propertychangesmodel.cpp
	src/plugins/qmldesigner/components/stateseditornew/propertymodel.cpp
	src/plugins/qmldesigner/qmldesignerprojectmanager.cpp
	src/plugins/qmldesigner/qmldesignerprojectmanager.h

Change-Id: Ib029a830ee99190bc4ea2ad75d9300bfa86b42d9
2022-10-25 19:02:15 +02:00
Christian Kandeler
13f40f5471 Utils: Add sorted() function
For simpler calling code.

Change-Id: Ia0a16a28770fd172f74d06a626148248bf5d3c0c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-10-25 14:29:45 +00:00
Marcus Tillmanns
d46a079744 Utils: Fix copyFile to include permissions
Also adds line breaks to info output.

Change-Id: I314ab87a47d7bd7541acb6a1553238fcfc27099d
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-10-25 13:31:10 +00:00
Jarek Kobus
866a658b42 Get rid of unneeded includes of RunControl
Removed also some other includes that were marked
with yellow triangles. In some cases includes of
runcontrol.h were substituted with other includes,
like qtcassert.h.

Change-Id: Ica40f68198c7f8f70e6047acb2eddc8ef017e43d
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-10-25 09:49:13 +00:00
hjk
ada6989079 RemoteLinux: Allow use as build device unconditionally
Works out-of-the box for plain C++ "Hello World" & CMake.

Change-Id: I696886582ad2db98e40dd31ad5d9bf8f7d30aabb
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-10-19 06:01:55 +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
Marcus Tillmanns
a1e960a27c Utils: Fix iterateWithFind
The change of runInShell to take QString + QStringList meant
that the caller was no longer able to fine tune the argument
escaping. This lead to "find -exec ... \;" being escaped incorrectly.

Changing back to CommandLine fixes this.

Change-Id: I55b09bd745c09912a2a0b4e43432824a99c0dd4e
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2022-10-14 12:52:03 +00:00
hjk
1fa3255242 Utils: Split off file access interface from IDevice
The file accessing functions form now a class hierarchy by themselves,
the devices return a suitable point.

The previous implementation was mildly confusing by the special handling
of the DesktopDevice, fallbacks and remote cases in the same function
leading to unnecessary boilerplate when adding new functions and
codepaths that sometimes passed the FilePath API twice.

Implemented are a "DesktopDeviceFileAccess" taking care of the
previous !needsDevice() branches and a "UnixDeviceFileAccess"
covering the current docker and RL uses.

As a side-effect this unifies to a large degree the current docker
and RL code paths with were occasionally deviating from each other
while they shouldn't.

Change-Id: I4ff59d4be2a07d13e2ca5e9ace26a84160a87c9d
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-10-13 10:38:35 +00:00
hjk
b1471fe61f Utils: Combine some of the iterateWithFind overloads
Change-Id: I668447d0049f2e35cd0c76d2c5708779196167ec
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2022-10-12 08:59:32 +00:00
Marcus Tillmanns
d74c5301ff Linuxdevice: Add FilePathInfo functions
::filePathInfo and iterateDirectory(..., IterateDirWithInfoCallback, ...)
allow for faster info retrieval by the fsengine, making the listing
of large directories like /bin a lot faster.

Change-Id: I2a21e019e05f5bb08459483747ba2be4530929f4
Reviewed-by: hjk <hjk@qt.io>
2022-10-11 13:09:26 +00:00
hjk
2e38cb6848 Utils: Add an offset parameter to the content writing FilePath function
Use QFile::seek to implement locally and a dd seek based poor man's
implementation on RL and docker.

Change-Id: I241d1c34c00e991845d132ad8edefa1377ba1311
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-10-10 16:08:28 +00:00
hjk
5dde520a43 Utils: Return a bit more data from DeviceShell::runInShell
Pass on stderr data and exit code to the caller, it's typically
in a better condition to handle errors.

Use it to notify the user about non-available 'find' arguments
and fix the fallback to ls-based operation.

Change-Id: I535535de2ffa09cad1dd6e9b07eb69f807dbae2f
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2022-10-10 08:39:55 +00:00
Marc Mutz
8eb4d52342 Port from qAsConst() to std::as_const()
We've been requiring C++17 since Qt 6.0, and our qAsConst use finally
starts to bother us (QTBUG-99313), so time to port away from it
now.

Since qAsConst has exactly the same semantics as std::as_const (down
to rvalue treatment, constexpr'ness and noexcept'ness), there's really
nothing more to it than a global search-and-replace.

Task-number: QTBUG-99313
Change-Id: I88edd91395849574436299b8badda21bb93bea39
Reviewed-by: hjk <hjk@qt.io>
2022-10-07 13:47:53 +00:00
hjk
90de29d530 RemoteLinux: Re-enable categorized logging for shell access
Task-number: QTCREATORBUG-28242
Change-Id: Iea56465576ade76b92948766c94e458d45e81191
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-10-07 13:33:52 +00:00
hjk
cb5815c619 RemoteLinux: Use common FileUtils::iterateUnixDirector function
This now uses 'find' when available.

Change-Id: I5ebf05a808f69559c25cd33eb6d36ab931fb076f
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-10-07 11:40:33 +00:00
hjk
4f2b15679d RemoteLinux: Allow remote linux build devices as opt-in
... by setting QTC_ALLOW_REMOTE_LINUX_BUILD_DEVICES=1

Registering compilers and cmake on such devices already
works manually. [Note: The remote file dialog is extremely
slow when browsing remote directories]

After that, opening a CMakeLists.txt on the device works,
but not much more.

Change-Id: I19025930699f6aec57d26a36b3fb04109fbf03e8
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-10-04 11:42:46 +00:00
Eike Ziller
3011548066 Merge remote-tracking branch 'origin/8.0'
Conflicts:
	src/libs/utils/deviceshell.cpp
	src/plugins/clangcodemodel/clangdclient.cpp
	src/plugins/qmldesigner/components/materialbrowser/materialbrowserview.cpp
	src/plugins/remotelinux/linuxdevice.cpp

Change-Id: Idc2edf428c98e9cbc891f1833b271ce2def9a835
2022-09-21 11:16:29 +02:00
Marcus Tillmanns
5ebb467cc6 Deviceshell: Cleanup shellProcess destruction
Change-Id: I71507d9e74979fca461784575257e7bafd1b4838
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-09-21 08:51:47 +00:00
Eike Ziller
5d55cfdae5 Merge remote-tracking branch 'origin/8.0'
Conflicts:
	share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorEditor.qml
	share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/icons.ttf
	src/libs/utils/fileutils.cpp
	src/plugins/qmldesigner/components/edit3d/edit3dwidget.cpp
	src/plugins/qmldesigner/designercore/include/abstractview.h
	src/plugins/qmldesigner/designercore/include/nodemetainfo.h
	src/plugins/qmldesigner/designercore/metainfo/nodemetainfo.cpp
	src/plugins/qmldesigner/designercore/model/model_p.h
	src/plugins/remotelinux/linuxdevice.cpp
	tests/auto/utils/fileutils/tst_fileutils.cpp

Change-Id: I26a21e2523d3d725fdb8c548a531cdbdaeaeca20
2022-09-19 09:54:06 +02:00