Commit Graph

251 Commits

Author SHA1 Message Date
hjk
7f2288d9cc ProjectExplorer: Avoid need to fix up portsgatherer command lines
... by creating them with the right device to start with.

Change-Id: Ib2f0f10b67322fe66a609287a629d3d720d83c93
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-05-12 06:23:45 +00:00
hjk
e657bc8781 Utils: Introduce QtcProcess::controlEnvironment()
... and drop QtcProcess::removeEnvironment()

This shifts the meaning of the unqualified QtcProcess::environment()
to always refer to (possibly remote) "main" process this QtcProcess
wraps. The controlEnvironment is now referring to secondary helper
processes (if any...) typically(?) running on the host system.

This helps to avoid local/remote distinctions in some places.

Change-Id: Ib7cd15dd226617484b5358acd7deaed29e751883
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-05-10 09:53:53 +00:00
Marcus Tillmanns
c6b75fc615 Docker: Use generic DeviceShell class
Change-Id: Ic2afc6931f7cdb791d81344df6edbdb117cc090b
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-05-09 09:30:57 +00:00
Marcus Tillmanns
441488dd52 Docker: fix find arguments, support outputForRunInShell called from non-main thread
* Added -mindepth 1 to not return the directory that is being searched in.
* Added parenthesis around -type options to correctly express that files OR directories
  should be searched, without affecting the following parameters.
* Added parenthesis around -readable, -writeable and -executable and added -o between them,
  to correctly indicate that any of the selected type should be searched for.

Change-Id: Ibc77a2a99826663b88015e8f43b5664563384127
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2022-05-04 11:03:50 +00:00
Jarek Kobus
85cb7d2b71 Get rid of IDevice::createProcess()
And most of QtcProcess subclasses.

Change-Id: Ic891defbf49736442243f9ee0f9d28d140e0ba9d
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-05-04 08:28:15 +00:00
Marcus Tillmanns
c8024046f9 Docker: implement process interface
Change-Id: I57dd9e060ee35280b663611ebb5ddef20b7d0eb7
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-05-03 08:26:13 +00:00
hjk
aa3bdcb427 Utils: Add a QString-based write to QtcProcess
Centralize some boiler plate and warn about best-guessed cases.

Keep the QByteArray based access as writeRaw()

Fixes: QTCREATORBUG-27445
Change-Id: I948d80fba78b36cf85cc73664175ab05eb7707d4
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-04-28 08:20:11 +00:00
Jarek Kobus
44c7020651 ProcessInterface: Get rid of state() method
This is fully controlled by QtcProcess itself, so provide
general implementation of state() inside QtcProcess.

Task-number: QTCREATORBUG-27358
Change-Id: Id6f0b771ed933f870b80d6856c6d94896f946516
Reviewed-by: hjk <hjk@qt.io>
2022-04-14 13:49:25 +00:00
Marcus Tillmanns
2c4553366c docker: Correctly initialize Kit during autodetection
* Added returning the Id after detecting CMake so it can be set in the autodetected kit
* Trying to keep autodetect from adding the same Qt installation twice if qmake is linked in /bin and /usr/bin
* Added FIXME for RunControlPrivate::runConfiguration as it is used after free in rare cases
* Fixed IosCompilerDetector to not just run if a device is set
* Fixed QnxCompilerDetector to not just run if a device is set
* Fixed auto-detected debuggers not being set as auto-detected, as they now can be removed from the device screen

Change-Id: Ia7772c454d70e147e4326efacc4a6a888fa26782
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-04-12 14:15:45 +00:00
Marcus Tillmanns
3af260b782 docker-plugin: fix daemon state
Changed daemon state to actually check the docker runtime to determine
if its available or not.

Change-Id: I9e183658dfc7c34e229aec2a332cf303793284e5
Reviewed-by: hjk <hjk@qt.io>
2022-04-07 12:58:48 +00:00
Jarek Kobus
4762d54401 DockerDevice: Connect to QtcProcess::done() signal
Instead of connecting to errorOccurred() and finished() signals.

Change-Id: I0dd1d35aa48bfb7769623ff5735a7abd644d180f
Reviewed-by: hjk <hjk@qt.io>
2022-04-07 10:45:39 +00:00
Marcus Tillmanns
0ee47fc734 docker-plugin: Split out dockerdevice utility classes
Moved DockerDeviceWidget and KitDetector into their own files

Change-Id: I16d52a4f27f611b6278e2144c4718bd370f99b63
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-04-06 12:32:03 +00:00
Marcus Tillmanns
eb696b4f85 docker: Show error when docker application cannot be found/started
Change-Id: I752ec9fe7bf0db5d26828a175363ef08c5c9bf02
Reviewed-by: hjk <hjk@qt.io>
2022-04-04 15:29:00 +00:00
Christian Kandeler
929e40a9f2 Fix some warnings
Change-Id: Idc12465aa6a3a3d158f17961f902578ca16d0d7b
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-04-01 08:23:25 +00:00
Eike Ziller
b6f679d777 Merge remote-tracking branch 'origin/7.0'
Conflicts:
	src/plugins/webassembly/webassemblytoolchain.cpp

Change-Id: Ia75c783e3ecab1f97de2b5c73a0979c49da82009
2022-03-18 16:07:51 +01:00
hjk
a23c4ce014 Docker: Fix searching compilers in custom directories
Previously, detection (mostly) only used path.

Change-Id: If382205c2ff39cabfe21953e877e152dc952a84c
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-03-18 08:21:51 +00:00
Eike Ziller
9fd2a059f6 Merge remote-tracking branch 'origin/7.0'
Conflicts:
	src/plugins/android/androiddevice.cpp
	src/plugins/docker/dockerdevice.cpp

Change-Id: Id16ba0d9993c9f608242622aceae0a2a6691e05e
2022-03-17 08:48:28 +01:00
hjk
cc51e32b2d Docker: Add a warning when the mount path list is empty
The common use case shares project sources between host and docker
container, in that case, not sharing anything will not be useful.

Change-Id: I44b12089579ead008023caf5134c613fc145b8c7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-03-16 08:53:39 +00:00
Christian Stenger
cd7a0bbef5 Docker: Inform user early if adding device fails
When retrieving the list of images there is no indicator when
something failed, so add one.

Change-Id: I2e0cde4ba33527e1b2abeecb5b3a06507dabf472
Reviewed-by: hjk <hjk@qt.io>
2022-03-15 05:43:02 +00:00
Eike Ziller
3f0c8b2149 Merge remote-tracking branch 'origin/7.0'
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri

Change-Id: I1ce9876150239751a1187bc0c4b8fc5fef1ab40d
2022-03-14 14:02:14 +01:00
hjk
2eca1c0ffc Docker: Add history to "Search in Selected Directories"
Also set focus to the line edit when this item gets selected,
and remove the arbitrary /usr/bin;/opt default.

Slightly better UX.

Change-Id: Icdc4e81d6cebd7aed1dd4999c4007a60c8ea53a2
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-03-14 12:05:27 +00:00
hjk
d439a7a25f ProjectExplorer: Dissolve DeviceProcess
Move remaining device member to subclasses where needed.

Change-Id: I1a872315579c7f6529e8937d57511a9e99e06926
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-03-02 15:36:02 +00:00
Jarek Kobus
8e0ae8ba96 QtcProcess: Limit the inclusion of qtcprocess.h
Move the rest of QtcProcess enums to processenums.h.
Move ExitCodeInterpreter into processenums.h.
Remove superfluous Utils:: prefix.

Change-Id: Iaa596f353d33d6930085a621b114cc15a35caa80
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-03-02 13:30:39 +00:00
hjk
fc3b9b5ab3 Docker: Remove traces of direct file access
Change-Id: Id0c11a584a5b75626bb04023893d76fbe2216ade
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-02-28 13:44:48 +00:00
Jarek Kobus
8af62eb256 DeviceProcess: Minimize the usage of DeviceProcess
DeviceProcess doesn't provide any public API, so
replace all usages of it with QtcProcess.
Keep using DeviceProcess only for reimplementations.

Change-Id: I35a14251a81dd0dde426f56ca2e809b527cc863c
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-02-28 13:10:42 +00:00
Eike Ziller
d295d16ab5 Merge remote-tracking branch 'origin/7.0'
Change-Id: I809383e6c060701a2751197a8bf16add92bfaf0d
2022-02-28 09:21:18 +01:00
hjk
32590af686 Docker: Accept more ways to identify a docker FilePath
Accept (percent-encoded) repo:tag, the image id or the device id as
host() part of a docker FilePath.

Task-number: QTCREATORBUG-26856
Change-Id: I27d374be31d54bab77d129e19884b7f7fd93daa0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-02-25 15:33:56 +00:00
hjk
4af9842a51 Docker: Remove local file access
I gave up on the idea, and even leaving the dead code in only
complicates the codebase.

Change-Id: If144c69adc8e9aa9b2c88050909e7a20b7218f18
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-02-23 10:29:02 +00:00
Eike Ziller
8259df00d0 Merge remote-tracking branch 'origin/7.0'
Conflicts:
	src/plugins/mcusupport/mcupackage.cpp
	src/plugins/mcusupport/mcusupportoptions.cpp
	src/plugins/mcusupport/mcusupportoptions.h
	src/plugins/mcusupport/mcusupportoptionspage.cpp
	src/plugins/mcusupport/mcusupportplugin.cpp
	src/plugins/mcusupport/mcusupportsdk.cpp

Change-Id: Ib423e9f23877176f01b188104b0a179ed32c4770
2022-02-22 14:06:41 +01:00
Jarek Kobus
48960b5cfc QtcProcess: Extract QtcProcess specific enums into separate header
Change-Id: Ib3498f189000fd8f5501130c0d280b0f5ae83849
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2022-02-18 10:51:55 +00:00
Leena Miettinen
eb8d84f6de Docker: Fix UI text caps and punctuation
Task-number: QTCREATORBUG-27055
Change-Id: I6b5c2bbd36e34d4444b798e2e5040bff674ad02a
Reviewed-by: hjk <hjk@qt.io>
2022-02-17 12:09:23 +00:00
Eike Ziller
49ecd64b9c Merge remote-tracking branch 'origin/7.0'
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri
	src/plugins/docker/dockerdevice.cpp
	src/plugins/mcusupport/mcupackage.cpp
	src/plugins/mcusupport/mcupackage.h
	src/plugins/mcusupport/mcusupportoptions.cpp
	src/plugins/mcusupport/mcusupportoptions.h
	src/plugins/mcusupport/mcusupportoptionspage.cpp
	src/plugins/mcusupport/mcusupportsdk.cpp
	src/plugins/mcusupport/mcusupportsdk.h

Change-Id: I8c8f5953a21729ba9178dbc44ed613eed131a0c8
2022-02-16 10:59:04 +01:00
hjk
91fcec3d79 Docker: Remove unused DOCKER_RUNFLAGS
Change-Id: I42ba6ca949d7397be73b2ede6d9380f6f93e7434
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-02-15 12:21:12 +00:00
hjk
c87a066087 Docker: Fix endless ping-pong between runnProcess and start
Amends 95c9579c58.

Change-Id: Icee747a578e000a0477dc314500687316f4ecd6b
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-02-15 09:31:57 +00:00
hjk
f7a585fad9 FileUtils: Add some helper to handle ls-style output
Unix-ish device implementations would otherwise repeat that code.

Change-Id: I1265fe1a69e55409ab2875d0b6f6113ec92edd79
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-02-15 08:57:19 +00:00
hjk
95c9579c58 ProjectExplorer: Normalize DeviceProcess::start() signature
Change-Id: I2915be34d4a1eed64567874dcf0263b7583cc142
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-02-14 15:10:12 +00:00
Eike Ziller
45b5341cd9 Merge remote-tracking branch 'origin/7.0'
Change-Id: Iab67dffe64bee391bd921ed8832bb17b36ec861b
2022-02-14 09:58:04 +01:00
hjk
e2cb64471a Utils: Move QtcProcess constructor setup data to shared setup data
This includes replacing DeviceProcess terminal handling with base
member.

Change-Id: Id1541bfce33c71dddc71b4816ad0b174dce3879c
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-02-11 17:33:48 +00:00
Christian Kandeler
fde7b90ee9 Fix some warnings
Change-Id: I2991f0ab84b26c93c0dbe2ec79f7638d299e3d39
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-02-11 12:14:27 +00:00
Christian Stenger
4c7a5b07c1 Docker: Fix and enable open shell in container
So far this had been restricted to Unix, but it works on
all platforms.

Change-Id: I578623341c906eca80a0dbc5fcc9b15e820d3597
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-02-11 08:57:52 +00:00
hjk
3bdab2f05e Docker: Simplify and fix "Open Shell in Container"
Change-Id: Icce72712a006f524b8a8328904d89f2b0e2b8a3d
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-02-10 10:02:33 +00:00
hjk
0b131fae72 Docker: Use repo + tag for image identification
Makes configurations a bit better exchangable (sdktool...).

Change-Id: Ia566a516afea2205c973527e02ce5664634ebbdc
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-02-09 15:02:25 +00:00
hjk
cfbf083089 Docker: Allow use of local access only as compile time switch
That's sufficient for testing/working on the feature and removes
accidental use by users.

Change-Id: Ic0fb3076f769ab9ab7ff74973f0129402db7f142
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-02-09 12:23:54 +00:00
hjk
75ef67615d ProjectExplorer: Remove IDeviceFactory::setCanCreate
That's implicit now by using setCreator()

The Android case looks odd as this is (and was) effectively static
information at startup. This will be addressed in a follow-up patch,
for now keep it functionally equivalent.

Change-Id: I4e6082f88dcd21379186340189acb581caef172a
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-02-04 12:10:07 +00:00
hjk
9ff851a204 Docker/RL: Be more lazy with output decoding
Conversion to QString is often not needed.

Change-Id: I22fe0ec89419f784d2fe02245094fbe6da719f75
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-02-04 08:35:48 +00:00
hjk
7c128638ea Docker/Linux: Fix outputForRunInShell
... in case there is embedded NUL in the output.

Change-Id: Ic899bcf8d01cceed4ea6e16d4991fb80b7ac70ca
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-02-04 08:35:21 +00:00
Christian Stenger
eb2fc79a3f Docker: Fix handling of ui applications on macOS
Using graphical applications inside a docker image needs
the same handling on macOS as on Windows.

Change-Id: Ic9fb6a8330164f7acdaab4146a70e7e308192f4e
Reviewed-by: hjk <hjk@qt.io>
2022-02-03 14:13:22 +00:00
hjk
2be0fc2537 ProjectExplorer: Use CommandLine instead of Runnable
Lighter and sufficient for all use cases.

Change-Id: Ic6749a1a9e3e6906ce71b87b237cc94a6d8a4cbf
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-02-03 10:15:44 +00:00
hjk
9ec997b376 ProjectExplorer: Base DeviceProcess on QtcProcess
... instead of having a member.

Change-Id: I75e8d7600eb17c7528fe9525d2e1aa871b282ad9
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-01-31 07:44:24 +00:00
hjk
330dfa7e84 ProjectExplorer: Use a QtcProcess member in DeviceProcess
All derived class have one one way or the other. Mid-term plan
would be to actually base DeviceProcess on QtcProcess and to
potentially dissolve it completely later.

Change-Id: Ie3bc48dcdc30bc2da5557ad26babf6959a3efa04
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-01-31 07:44:16 +00:00