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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
When a QtcProcess is the first thing using a dockerdevice
the container was not started and the call would fail.
Adding updateContainerAccess to withDockerExecCmd
makes sure that the container is started.
Change-Id: I7e05df1aa5e05dc55606970214109b13b142181e
Reviewed-by: hjk <hjk@qt.io>
Some containers may use their entrypoint to setup their environment.
Simply overwriting it from our side would disable such setup and
make the containers useless.
Change-Id: I3385858c49aa8217c3191acdb85343ffd6163cf9
Reviewed-by: hjk <hjk@qt.io>
Since the dumper path was changed after the first "startContainer"
call, subsequent startContainer calls would set the wrong source
directory.
Change-Id: I6e8304c080b4b55fc67eda0a9544a1b8f34ab7a1
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
"Fixes" one Q_SKIP and makes the implementation OS-agnostic.
FilePath::osType() actually depends on the host system for not fully
qualified file paths, and that doesn't seem to be the right thing to do
in all cases. The caller may actually have more context to decide
whether this is needed (e.g. in pathchooser.cpp in the context of
"return value from a GUI element, i.e. 'host' implied).
Change-Id: Iff80c17094d2deec79d34d0527223fbcf8294935
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Also fixes an issue where "Open Shell In Container" would fail if
the container has not been started yet.
Previously only "An Error occurred" was displayed to the user if
starting the terminal failed.
With this fix it gives more info about what went wrong, and a
specific error message is created if the openTerminal.py script
is not executable.
Change-Id: I49ae0d9b2aa7d5a27a9b100830b4fdefa5a279b8
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
If no base64 is installed on the target, the shell script
cannot work. Previously this would lead to the shell functions
being unavailable.
This change adds a fallback path. In case no base64 is found,
the shell will create a process for each run request instead.
This is much slower than the shell script, but acceptable as
a fallback.
Change-Id: I70591d7e610c4e1c3c258a8e4bef354221d05cb9
Reviewed-by: hjk <hjk@qt.io>
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>
The StringAspect needs to return a possible default value if
no value was set by the user. Otherwise it would write an
empty string when ::apply was called.
Also a small improvement for docker error logging is added
Change-Id: I85f80253894d2c3e726da714616e5275039febcc
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
We change DockerSettings to have a single owner.
Since DockerDevices are destroyed after the plugin
is unloaded, we have to make sure to remove the
settings from devices during plugin teardown.
For this we store a list of created devices in
the factory, and call their shutdown function when
the plugin unloads.
Change-Id: Ic9c7d8ad9437c48d68f20c9a8f8ad7449b3cb972
Reviewed-by: hjk <hjk@qt.io>
Don't connect to QtcProcess::errorOccurred() signal, as it's going
to be removed soon. Rely on done() signal instead.
Change-Id: I28260f8eb77911a23de80512881cf7220f1bc1fc
Reviewed-by: hjk <hjk@qt.io>