Commit Graph

291 Commits

Author SHA1 Message Date
Marcus Tillmanns
78b1407adf Docker: Don't swallow output when startup fails
Previously error output occurring while the PID marker was
not parsed yet was not passed on to the parent QtcProcess.

Change-Id: Id6cbaa13a7d6c62d7a8612e118092eb2be6e790c
Reviewed-by: hjk <hjk@qt.io>
2023-03-02 16:32:57 +00:00
Marcus Tillmanns
86da87d306 ProjectExplorer: Remove IDevice::terminalCommand
Since Terminals can now be started for device file paths, there
is no need anymore for IDevice::terminalCommand.

Change-Id: I01c831ea7ee29d53efa6880631e8c6d54a4316aa
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-03-02 14:13:19 +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
hjk
81748fa00b Docker: Avoid explicit environment iteration
Task-number: QTCREATORBUG-28357
Change-Id: I0addc68309ab532d5a710916c7d017eccee1f348
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-03-02 13:43:58 +00:00
Marcus Tillmanns
6451538d39 Docker: Don't try to mount existing directories
Change-Id: I1df4e1bf8689edf08c539d71529e4149909502d7
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>
2023-03-01 12:55:02 +00:00
Jarek Kobus
d249e77f77 DockerDevice: Fix compile warning
Amends 682ef157d8

Change-Id: I2ee639aac5d6b2ba55e96d322a6d5818ca0d6735
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-02-27 11:50:02 +00:00
Marcus Tillmanns
682ef157d8 Terminal: Add Terminal plugin
Adds a new Terminal plugin that provides a Terminal pane inside
Qt Creator.

Fixes: QTCREATORBUG-8511
Change-Id: I7eacb3efa2463d7df9f383ae3fc33254fb9019a9
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2023-02-24 10:19:33 +00:00
Alessandro Portale
226799858c Translations: Replace QCoreApplication::translate() with Tr::tr()
Calling <Module>::Tr::tr() is preferred over
QCoreApplication::translate("::<Module>", "..."). This changes
occurrences in .cpp files.

Change-Id: I3311ef0dbf3e7d105a3f181b6b988f3b444468f1
Reviewed-by: hjk <hjk@qt.io>
2023-02-10 16:27:37 +00:00
Marcus Tillmanns
78cf3eb671 Docker: Check writeData
Previously only the process mode was checked to decide
whether we need an interactive docker session when starting
a process.

Change-Id: Ia80c78d861107239d0c86c405e06f30e7770ff8e
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-02-07 13:06:56 +00:00
Marcus Tillmanns
e780ca991c Docker: Use rootPath() for Shell
Change-Id: Ie2578b768d8fcb91c55a33b4eb62e43c127ccee2
Reviewed-by: hjk <hjk@qt.io>
2023-02-07 11:16:02 +00:00
hjk
040ef3b7d3 Docker: Use a optional<Environment> to handle the non-fetched state
Change-Id: I93ef9da6c9c7731b28f9d6fab6413ce9c4f428b4
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-01-27 12:37:51 +00:00
hjk
dab859e776 Utils: Replace Environment.isValid() with .hasChanges()
That's closer to the intended semantics. The "other" use in docker
will be changed to an optional<Environment> as follow-up to
keep this here mechanical.

Change-Id: I43ef9da6c9c7731b28f9d6fab6413ce9c4f428b4
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-01-27 12:37:35 +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
hjk
e7c536011f Prefix Tr::tr contexts with ::
To make outliers better visible in Linguist

Change-Id: Ic35ea2a858b7e3576d9a416fb494fddb616eaaa1
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-01-13 12:00:17 +00:00
Marcus Tillmanns
b16c6495a0 Docker: Make sure temporary paths don't duplicate
Change-Id: I980f2a02c0a521d2d142573d94eb8850c26f0999
Reviewed-by: hjk <hjk@qt.io>
2023-01-11 07:59:22 +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
hjk
66c08a824d Utils: Rename most FilePath::{from,to}Variant uses to {from,to}Settings
Specifies the main purpose more clearly. The remaining ones a "true"
(internal) variants in models and as action data.

Change-Id: I8dd3c846e419f29d88283c2f48268ef6685b19fe
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-01-10 09:00:30 +00:00
Marcus Tillmanns
f0540f8392 Docker: Convert isValidMountInfo to expected
Change-Id: I582939990f85c1dc3eed474b3bac0e6b4efe3367
Reviewed-by: hjk <hjk@qt.io>
2023-01-09 09:51:00 +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
Marcus Tillmanns
0aeec80eeb Docker: Add Filepath::localSource()
FilePath::localSource can return a filepath that represents a local version
of a remote file.

It is used to let the debugger select the local version of a file when
debugging a remote target.

Change-Id: Ieb934ef0d454e8ff55e71df41dca825974d85da7
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2022-12-16 12:27:49 +00:00
hjk
5787a22f69 ProjectExplorer: Merge IDevice::{filePath,mapToGlobalPath}
They were doing practically the same. Keep the 'filePath' name for
now until something more fitting comes up.

Change-Id: I96ca4da4b30b7b463583e002f2c19d6e6c5541e6
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-12-15 12:26:00 +00:00
hjk
a2a6073b0c Docker: Use FilePath::from/toVariant to store clangdExecutable
Change-Id: I7e728ab15e9839893f53c068633e9763d6e13d49
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2022-12-13 07:32:42 +00:00
Marcus Tillmanns
bcfaf00d00 ProjectExplorer: Add clangdExecutable to IDevice
Change-Id: I131212326696887d3a5644a35788f6a522dbee45
Reviewed-by: hjk <hjk@qt.io>
2022-12-09 14:00:19 +00:00
Jarek Kobus
8e7e1dd5f2 Mark some virtual overrides final
These methods are being called from c'tor or from d'tor.
Make sure these methods will not get overridden by any possible
subclass, otherwise these calls won't be dispatched properly.

Change-Id: I3652d2f495940f13b48b494ab2cf06abb3d37e7e
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-12-08 10:21:44 +00:00
Jarek Kobus
c5a60d2dc2 Docker: Pass context object to lambda connections
Remove some unneeded lambda () brackets.

Change-Id: I2fcd83ec2e68a7aeb8f51fa39e7e69cc16e26bc8
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2022-12-08 09:50:53 +00:00
Marcus Tillmanns
46eccf229c Docker: Add clangd executable option
Change-Id: I93fbd9a7a6b0189ca31cc05b35df9d1636da29a3
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-12-06 12:19:57 +00:00
Marcus Tillmanns
79c2984222 Docker: Make hostname valid for Urls
Change-Id: I026aee70503699fcada30948195a7ebd4c76aeb0
Reviewed-by: hjk <hjk@qt.io>
2022-12-06 12:02:04 +00:00
Marcus Tillmanns
0f4430ca05 Docker: Don't try to mount empty folder
Change-Id: I90479d21dd29a291e7d391464efaf40d6a50b662
Reviewed-by: hjk <hjk@qt.io>
2022-12-06 11:41:17 +00:00
Jarek Kobus
ac966d7bb9 IDevice: Provide default implementation for signalOperation()
Don't repeat implementation returning nullptr in derived classes.

Change-Id: I437f5d206464bf92706cd135d793438f46455ad6
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-11-29 13:34:31 +00:00
Marcus Tillmanns
75b43de14a Docker: Cleanup docker process interface
Instead of creating the actual command in two places
this change moves everything into one function.

Instead of sending the environment and working directory
into the shell as arguments, we send it via the correct
docker exec cli arguments.

Instead of creating QStringLists and adding them
to a CommandLine we directly add them to the
CommandLine instead.

This also fixes an issue when the working directory
contains spaces.

Fixes: QTCREATORBUG-28476
Change-Id: I4f5b39a2dd4c86d20717dbb53003f1eb60f6c089
Reviewed-by: hjk <hjk@qt.io>
2022-11-22 13:17:11 +00:00
Marcus Tillmanns
fb4e22ff7c Docker: Add option to enable flags needed for lldb
Change-Id: Ic0ae6d2b8dcfee3df21c22124c7fc2bddbdb61a2
Reviewed-by: hjk <hjk@qt.io>
2022-11-17 13:03:52 +00:00
hjk
f59ca97a84 Utils: Sanitize FilePath::onDevice()
It's one entry in the FilePath world, so it should start with a QString.

Change-Id: Ib2693f52d56103a4c37ba7361b191c2a5c2a72f8
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-11-17 10:13:05 +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
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
Marcus Tillmanns
604f542b20 ProjectExplorer: Allow selection of remote build directories
Change-Id: Ieaf0b01bde6d043782d6d9d4bb745c090c6087c1
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-10-24 07:22:05 +00:00
David Schulz
60a8e987b5 Docker: use docker device os type for file access
Change-Id: I3e3e91491c77d0146f2d52777ba1d05d2f45a9d3
Reviewed-by: hjk <hjk@qt.io>
2022-10-18 12:37:50 +00:00
Marcus Tillmanns
7b0b127e90 Docker: Fix deviceshell fallback commandline
Previously the arguments of the target CommandLine were
re-quoted/escaped which is error-prone and not necessary.

Change-Id: I055d159de7860c7cd9549b61104519b8145c4021
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-10-18 09:58:36 +00:00
Marcus Tillmanns
742f92d246 Docker: Use host.docker.internal
DockerDesktop on Windows and macOS provide the hostname
host.docker.internal to reach the host machine. We use that as its
more likely to work for different setups than trying to figure out
the host ip yourself.

Change-Id: I9f594d0e97e7f35ceb580ac3e3304de999bfea9c
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-10-18 05:39:58 +00:00
David Schulz
c7cef250b3 Docker: fix device path mapping
Amends 1fa3255242

Change-Id: Idd2e0916769cd822b97e1fc851d8f706316cca83
Reviewed-by: hjk <hjk@qt.io>
2022-10-17 10:06:52 +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
Marcus Tillmanns
22c4e9318a Docker: Remove unused function
Change-Id: I683de49c08411087e47be84265cbab62d4d0738e
Reviewed-by: hjk <hjk@qt.io>
2022-10-14 12:06:41 +00:00
Marcus Tillmanns
359ad56e17 Docker: combine escapeMountPath function
Change-Id: Ib04f8245d2da096a9d9fdbdf9b5243ca80d52bfa
Reviewed-by: hjk <hjk@qt.io>
2022-10-14 09:52:22 +00:00
Marcus Tillmanns
9aa1d56f56 Docker: Fix isValidMountInfo
Improves checking if a requested mount is actually valid.

Change-Id: I37638d26ddd46776e6375481cf1d73ed0ad24210
Reviewed-by: hjk <hjk@qt.io>
2022-10-14 09:49:58 +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
bcadbe666b Docker: Fix mount arguments
Previously when trying to mount paths that contained spaces or colons
docker create would fail as the -v/--volume syntax does not support
these.

Switching to "--mount" and using the "type=bind" syntax allows to
escape the necessary characters.

Change-Id: If969173505dbf1b36a67dc8b398c58b78941519a
Reviewed-by: hjk <hjk@qt.io>
2022-10-11 12:24:29 +00:00
Marcus Tillmanns
ae58d373b0 Add FSEngine FilePath Cache
To speed up file dialogs we introduce a 1 minute cache for
the FilePathInfo.

A new version of "IDevice::iterateDirectories" allows implementations to
provide the FilePathInfo directly.

DockerDevice implements fetching the filePathInfo during
iterateDirectories which greatly improves the speed again.

Change-Id: I24ac16adb2478cbf16a22012e72fcb8910dcdac5
Reviewed-by: hjk <hjk@qt.io>
2022-10-11 08:53:02 +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