Commit Graph

251 Commits

Author SHA1 Message Date
Christian Stenger
5887d13d46 Docker: Fix crash while removing auto detected toolchains
Change-Id: Id0cf4346b97f54247ad81ae0d93a42935dca8a0f
Reviewed-by: hjk <hjk@qt.io>
2022-01-28 07:09:24 +00:00
Christian Stenger
95595db7d1 Docker: Drop handling of critical pattern again
Drop lately introduced handling of critical pattern and
just drop the critical pattern instead for now.
Brings back gdb when auto detecting debuggers.
Amends 22dd26bc76 and 181e74ebc3.

Change-Id: Icde46e9bfa82d5cf1252e46f1e0a84b638927473
Reviewed-by: hjk <hjk@qt.io>
2022-01-27 10:53:48 +00:00
hjk
4e34921451 ProjectExplorer: Rename DeviceProcess::error to errorOccured
That's what QProcess favors nowadays and QtcProcess uses.

Change-Id: Ie9492ae62f23e35a8a70f72196c3d1b6bc50cbdc
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-01-27 10:12:38 +00:00
hjk
0813a08b1e Docker: Re-do auto-detection of Qt
This now properly iterates into subdirectories when selecting the
"Search in selected directories" option for the auto-detection
so it works with Boot2Qt images that don't put Qt in PATH, but
somewhere under /opt

Change-Id: Ifc337c0169d4b98b4e894a5d7e8286f171e0c569
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-01-27 09:08:33 +00:00
Christian Stenger
181e74ebc3 Docker: Fix iterateWithFind()
Amends 22dd26bc76.

Change-Id: I0be8d8236795a9e93ab93f89df56fd14e378e6e6
Reviewed-by: hjk <hjk@qt.io>
2022-01-27 08:24:08 +00:00
hjk
2b6f26dee2 ProjectExplorer: Use a lambda for DeviceFactory::create()
Somewhat slimmer interface on the user code side and follows
existing practice.

Change-Id: I20ed8f5a00591265d32ea9ce93e1f1bbc76d2437
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-01-26 14:51:09 +00:00
hjk
1fc83d2a56 Utils: Wrap various file system iteration flags and filters
... into a single class.

This makes passing them around as a whole easier, and opens a path
to have "generic" filters in form of a lambda or such.

Change-Id: Ibf644b2fedcf0f1a35258030710afff8f5873f88
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-01-26 13:13:41 +00:00
Christian Stenger
01d199ea82 Docker: Register only matching toolchains
Change-Id: I0d5b0f9686b4a8256167fc4f1b2b464885590e20
Reviewed-by: hjk <hjk@qt.io>
2022-01-24 15:09:28 +00:00
hjk
a48a96e05c QtSupport: Introduce a type alias for QList<BaseQtVersion *>
Change-Id: I96b0eccc04da2f4a1a4e5ea9bdceb91b3fa3d724
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-01-24 14:38:20 +00:00
Christian Stenger
22dd26bc76 Docker: Improve iterateWithFind
Handle critical file pattern after we got the results from find
to avoid finding to many false positives.
File patterns like "lldb-[1-9]*" end up using "lldb-?*" inside
find and will basically find anything starting with "lldb-"
which includes lots of additional lldb tools that cannot be
used as debugger at all and slows down the detection unnecessarily.

Change-Id: I0c816ae6b6e472b710ffede532c97c55a9d698fa
Reviewed-by: hjk <hjk@qt.io>
2022-01-24 13:10:45 +00:00
hjk
25f5771aa4 Rename QtSupport::BaseQtVersion to QtVersion
... and the Utils::QtVersion enum to Utils::QtMajorVersion to avoid
conflicts.

Change-Id: Ib688c67388272b7204a91444155f60b8c18a56bd
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-01-24 12:13:19 +00:00
hjk
e695109078 ProjectExplorer: Make ToolchainManager::toolchains() overloads explicit
Saves a few cycles for the plain access.

Also sprinkle a few 'const'.

Change-Id: I238dfd9352ee39caa3aa48cd04a9f1cf827b029e
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-01-20 06:13:09 +00:00
Jarek Kobus
d6f56254d1 Get rid of QtcProcess::workingDirectory() overload
Adapt all callers' code so that it passes the FilePath
instead of QString. As a consequence introduce
TemporaryDirectory::masterDirectoryFilePath() and use
it where easily possible.

Change-Id: I14564949b3b916921e32a2957c84c03d1da43af2
Reviewed-by: hjk <hjk@qt.io>
2022-01-18 17:18:34 +00:00
hjk
f9c97d23c7 Utils: Add optional recursion for file system iteration
Change-Id: Icded897b129aebd7132376cff55717e16dffc040
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-01-18 11:52:29 +00:00
hjk
5cfe69b049 ProjectExplorer: Use a struct for toolchain autodetection parameters
Also, make some functions const and use an alias for QList<ToolChain *>.

Change-Id: I6a1cbcb79bfaa9d252c4b69e00aa93e5d0dabe2f
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-01-18 11:25:34 +00:00
hjk
d4b2f18c5e Docker: Split tryCreateLocalFileAccess() function
... into a parts updating the container access (i.e. shell process)
and the potential local file system access on Linux.

Change-Id: I0d3e7d9e859f15f9e22182fbe7ae1188b0c9ff57
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-01-12 06:51:54 +00:00
hjk
3342d4477c Docker: Switch Linux file handling to docker --exec by default
Also on Linux, where there's actually a choice.

It's slower, but less fragile when it comes to user ids
and/or file system permissions.

Change-Id: I811612fcff65fad50be18bed21150f6ca7fae93c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-01-11 15:00:08 +00:00
hjk
20d19aa5bf RemoteLinux: Implement some of the remote file API
Implementation of remote file API for correct FilePath
work with RemoteLinux.
Added tests for this functionality

Run ssh shell in separate thread.
The linux device instance keeps its own thread for running
SshRemoteProcess. In this way all calls to filepath
interface of linux device coming from different threads
are executed in one thread (SshRemoteProcess is reentrant,
but not thread safe). The redirection to the device thread
is done by invoking SshRemoteProcess' methods through
BlockingQueuedConnection.

Done-by: Artem Sokolovskii
Change-Id: Id8756738d3a4597f175c8ef000c148d0c8536eeb
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-01-04 11:16:14 +00:00
hjk
7677dc4ba0 Utils: Use callbacks when iterating remote file systems
This will make recursion easier and has the potential to avoid creating
big intermediate lists.

Change-Id: I44d42925dae9c0048338c7d0a6aa26606f314c28
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2021-12-17 06:57:46 +00:00
hjk
16c25d99c8 Docker: Provide a means to select search paths for auto-detection
A combobox in the device dialog to select between the (docker image's)
system path and a semicolon-separated set of user defined paths.

Use it for cmake and gdb detection; qmake and toolchains currently missing.

Change-Id: I3c478ca914a1bf02dcb69ebcb9ea6e358d24aaf9
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2021-12-14 11:15:21 +00:00
David Schulz
442ce3e019 Docker: prevent endless loop after shell stopped
Change-Id: Id2ee7193ab7b646e85f2a84f673cb3022fec4dba
Reviewed-by: hjk <hjk@qt.io>
2021-12-14 09:27:10 +00:00
hjk
353314a777 Docker: Add a way to force file access via docker itself
Use a QTC_DOCKER_DENY_LOCAL_ACCESS environment variable.

On Linux we usually try to access the container file system directly
as part of the host file system. In some cases this fails, and in some
cases we might want to disable it for testing purposes.

Change-Id: Iebc8e7fbbc968cd6dfbc6da2d08d71dd53bfa097
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-12-14 07:45:21 +00:00
Christian Stenger
420b5bf541 Docker: Start making it work on macOS
Change-Id: I450c7b19de1694da456e16e95b698c1476623a97
Reviewed-by: hjk <hjk@qt.io>
2021-12-09 10:16:30 +00:00
hjk
e64ce914f9 Utils/Ssh: Move SshRemoteProces::isRunning() to QtcProcess base
... and use it on a few places.

Change-Id: Id2cea709e355a46821a720e593740ac032888ced
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2021-12-06 13:44:23 +00:00
Leena Miettinen
6739266a8e Docker: Fix UI text
Task-number: QTCREATORBUG-26458
Change-Id: I6dcdbf199259259416e4bfb11c3488f8594b0c0b
Reviewed-by: hjk <hjk@qt.io>
2021-10-25 15:18:14 +00:00
David Schulz
12bc192422 Docker: mount python dumpers to device
Change-Id: Ic0d67b4a18247439f5797a0dcf74df945ef6f61e
Reviewed-by: hjk <hjk@qt.io>
2021-10-25 08:56:16 +00:00
David Schulz
d84de31384 Docker: Map command executables to device path
Change-Id: Ia8edf686a546f57b42ed0141e2986eded6f96ec1
Reviewed-by: hjk <hjk@qt.io>
2021-10-25 07:33:03 +00:00
David Schulz
6e6753a064 Docker: use mapped working directory for remote processes
Change-Id: Ibbc89f963ca42510cf072b242a5cdfdc0d4c23ff
Reviewed-by: hjk <hjk@qt.io>
2021-10-13 09:35:57 +00:00
David Schulz
7e9f955a58 Docker: Use only path part of FilePath when mapping to device
Otherwise neither normalizedPathName nor startsWithDriveLetter works as
intended when used with a non local path, but these are required to take
the correct code path in FilePath::mapToDevicePath.

Change-Id: I25e8f1a6a01a3e4056633ff3afec883cfbeb0e46
Reviewed-by: hjk <hjk@qt.io>
2021-10-13 09:35:51 +00:00
hjk
d75005fbd2 Docker: Use mapToDevicePath() in startContainer()
Change-Id: Iad91144413a176bee036e03192713f5bf4695dcb
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-10-12 11:24:38 +00:00
hjk
34b42a4772 Utils: Introduce FilePath::mapTo{Device,Global}Path
Re-directing via IDevice::mapTo{Device,Global}Path

Change-Id: Ica957839479967790bbd93e90eced66aa0b122a8
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-10-12 11:24:29 +00:00
hjk
033d2c5cc3 Docker: create container before running image
Change-Id: Iea4a4ec446a2df6fc299be24615bca605fca83e9
Reviewed-by: hjk <hjk@qt.io>
2021-10-07 08:41:41 +00:00
David Schulz
704a758f69 Docker: use PathListEditor for mounts
Change-Id: I5ed0ebf5ecdad17c1800f15906063d3413307da3
Reviewed-by: hjk <hjk@qt.io>
2021-10-06 09:57:02 +00:00
David Schulz
0f480cee70 Docker: allow windows style paths in settings
Makes sure to convert it to unix style path on the target and use the
correct capitalisation on the host

Change-Id: I0c6dff47c34c1844a8198c3215ea857fdb6375c7
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-10-06 09:56:53 +00:00
Christian Stenger
b7815a4187 Docker: Use shell if possible
Using the shell for short running processes that do not
modify the container environment is recommended as it
avoids starting up another process.

Change-Id: I32a1f348bfa56ee4094599cff1af17525a6d2a98
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-10-06 07:26:47 +00:00
hjk
7a20a8e70a Docker: Split early return in tryCreateLocalFileAccess()
For easier debugging.

Change-Id: I427ec3ce10b3eae50a3fa67d5bba9951e9de4c14
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-09-30 10:04:24 +00:00
Eike Ziller
19abb9f877 Merge remote-tracking branch 'origin/6.0'
Change-Id: I9d25a7ac39b3619856fc8d8a6be6f91a403b3969
2021-09-30 09:03:12 +02:00
hjk
bb9bfa1cd4 ProjectExplorer: Allow devices to report tasks in validate
And use it to report a hard error when docker devices don't have
a shared directory set. While this is possibly too harsh in the
long run it fits the current situation where we want to use the
container for building projects.

Change-Id: I1430716b5722fba537bb964463ce25c7001be6a4
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-09-29 13:09:38 +00:00
David Schulz
958ce4f308 Docker: assert and return false if runInShell fails
Change-Id: I0e285e84db1b5442fb4b761597d25e798ac4e94f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-09-29 08:28:20 +00:00
David Schulz
82b250d901 Docker: add option to disable file path mapping
Can be used to easily reproduce the current windows state that has no
way to map the remote file system to a local path on other systems like
linux.

Change-Id: I32cd1852dd0b4fc0890a503c244f34065c29e18c
Reviewed-by: hjk <hjk@qt.io>
2021-09-24 04:23:06 +00:00
hjk
478ce99942 Docker: Don't try to re-start running container
Change-Id: If8594ce467c44be7a67aa2a7e783028306731af1
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-09-23 06:10:05 +00:00
hjk
1e18678383 Docker: Extend log messages
Add some indication which container the log messages belong to.

Change-Id: Iafdc7f9c77e58649f2922aefd2a109cf17db78ff
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-09-23 05:30:17 +00:00
hjk
9c66b493e1 Docker: Add some more information why certain operations fail
Change-Id: I7f561fbf089fff5ba0151f72789aad4c216b15fe
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-09-23 05:03:05 +00:00
Christian Stenger
f2c501a5bf Docker: Tweak handling of DISPLAY
Passing the DISPLAY variable differently on Windows allows to
even run a gui application on the docker image if there is an
XServer (e.g. vcxsrv) running on the Windows host that can be used.

Change-Id: I36f849c4efc6e53ef92fcea96b4b256fd92a01c6
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-09-22 12:53:29 +00:00
hjk
a16144b89d Docker: Override entrypoints when starting our shell
Some images have convenience entrypoints set, these get into the way
when we want to run a shell deterministically.

Change-Id: Ifedb9924456b80a9a3cdca64b5431c457b052f1a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-09-22 08:13:30 +00:00
Christian Stenger
64e438ed83 Docker: Implement directoryEntries alternative
Use 'find' on a docker image to search for diretory entries
if it is available.
If the find call fails we still may fallback to using 'ls'.
This silences currently active soft asserts regarding the
usage of sort or file filters when we are able to use 'find'.
Only support the most common and currently used options and
bark if some unsupported option is in use.

Task-number: QTCREATORBUG-26258
Change-Id: I9a082ea7aca1b6db7dcb668cfe40ed0ed48cd567
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-09-16 06:18:59 +00:00
Eike Ziller
3d4d7c7e14 Merge remote-tracking branch 'origin/5.0'
Conflicts:
	src/plugins/clangtools/clangtoolssettings.cpp
	src/plugins/clangtools/executableinfo.cpp
	src/plugins/clangtools/executableinfo.h

Change-Id: Id8caf63e3e594792467d3447870086bd2d8f73b9
2021-09-13 17:03:55 +02:00
David Schulz
0caa8cbd60 Docker: reset process working directory if it needs a device
Change-Id: Ided00a328279b7b82814dcbb79434063ed7ec5f6
Reviewed-by: hjk <hjk@qt.io>
2021-09-13 12:00:20 +00:00
Christian Stenger
4ed03777d3 Docker: Fix condition
Change-Id: I28c845ebd5a04e13cb109af03f6094306da64394
Reviewed-by: hjk <hjk@qt.io>
2021-09-09 09:52:13 +00:00
hjk
bbe506d29b Docker: Show error when container environment retrieval failed
Change-Id: I2e2226493969e322c9dab44ceb5106b1a207369b
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io>
2021-08-25 05:38:54 +00:00