Commit Graph

20 Commits

Author SHA1 Message Date
Marcus Tillmanns
852ded54d0 DeviceShell: Test no-script fallback
Change-Id: I97f6df6face701b247b6be3320d89511a1310857
Reviewed-by: hjk <hjk@qt.io>
2022-09-22 13:36:03 +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
c37e273f27 Merge remote-tracking branch 'origin/8.0'
Conflicts:
	src/plugins/qmldesigner/designercore/include/qmlstate.h
	src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp

Change-Id: Iefff97499db72727c1b8058d53b1279fd8853ad9
2022-09-20 15:43:56 +02:00
Marcus Tillmanns
1404c36e2b Deviceshell: Fix use after free
Change-Id: I6caa22e53bee2db332ced7301534683d7a064905
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-09-20 10:45:31 +00:00
Marcus Tillmanns
d4e385de06 Deviceshell: Base64 not found fallback
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>
2022-09-01 13:30:46 +00:00
Lucie Gérard
a7956df3ca Use SPDX license identifiers
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>
2022-08-26 12:27:18 +00:00
Jarek Kobus
74ea4dc07d Drop Qt5: Utils: Get rid of QOverload
Change-Id: I864bfb18668fd325badd34003adf494c7924f86b
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-07-20 10:30:25 +00:00
Marcus Tillmanns
07cb8876db deviceshell: Fix racecondition and long running tests
When writing to stdout and stderr from two processes, their output could become
interleaved. To work around that, we write stdout and stderr to different files
and later combine them together in the shell script.

Since tst_deviceshell tests could run for a long time if /usr folder
is too big, added a check that first tests the runtime once.

Since we currently only support linux containers, limit the tests to
only run if the container platform is linux as well.

Change-Id: I4b313596cdf9acc839d54d7cc77c66fd53ac23bf
Reviewed-by: hjk <hjk@qt.io>
2022-07-18 08:06:06 +00:00
Marcus Tillmanns
3958087124 deviceshell: fix hang on multithreaded access
When outputting a commands stdout / stderr / exitcode,
the shell was free to interlace different outputs.

This could trip the parsing of the output, leading
to the shell missing the exit code of a command.

When that happened, the caller might wait indefinitely
for a result that would never come.

To workaround, the shell script now writes each command output
to a temporary file first, which is then written to stdout
by a single subshell, that way guaranteeing that the output
of multiple commands will not interleave

Change-Id: I9d8e7e788f5922c612ff533e5ba063f61a22aa8c
Reviewed-by: hjk <hjk@qt.io>
2022-06-29 07:28:46 +00:00
Jarek Kobus
3b0add4b16 DeviceShell: Merge done() and errorOccurred() signals into one
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>
2022-06-20 13:07:32 +00:00
Marcus Tillmanns
16c10cc913 DeviceShell: Don't use 'command' to test for base64
On (debian based) linux the "command -v base64" did fail to find
the base64 exectuable. Instead we now use "which".

Change-Id: I9b57527d93952b08bcb9abc7484a7e6891aa664c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-06-09 08:17:16 +00:00
Orgad Shaneh
dd7dd3462a Utils: Fix MSVC warning
incompatibility between int and quint64

Change-Id: If85eb13e4c6ff68a9b02dc036a971f03bab73d1b
Reviewed-by: hjk <hjk@qt.io>
2022-06-08 12:19:11 +00:00
Eike Ziller
4ded73583d DeviceShell: Fix compile issues
- fix warning deviceshell.cpp:222:59: warning: suggest braces around
  initialization of subobject
- add missing dependency to app_version to tests

Change-Id: I6d61f26cbc6f51b28175257ab7d0f4d2b491fecb
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-06-07 13:36:25 +00:00
Jarek Kobus
ec63e694d8 DeviceShell: Don't store a shell script on remote side
Execute a script directly on remote side instead.
Storing it always into /tmp/shell.sh may potentially break
when 2 or more shells are being started for one device at
the same time.

Change-Id: I2b8c94ef531fa4916383355a312421a3a18bfcad
Reviewed-by: hjk <hjk@qt.io>
2022-06-07 13:21:06 +00:00
Marcus Tillmanns
0135c47849 device: Use multiplex script to allow multithread support
Previously the runInShell and outputForRunInShell methods were
exclusively processed single threaded, meaning all calls
were processed sequentially. With the multiplexed
helper script we can now run multiple processes simultaneously.
( see tst_manual_deviceshell )

Additionally the new script allows us to capture both
stdout and stderr from commands which was not possible previously.

Change-Id: I52f4fb46d872dc274edb9c11872d2f6543741b34
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-06-07 09:22:14 +00:00
Jarek Kobus
0a8dbaf153 Utils lib: Remove unneeded includes from cpp files
It's a result of a team work consisting of yellow triangle and me.

Change-Id: I8b4812766da70e0785ae71bf0cb71357379e2514
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-05-19 12:37:20 +00:00
Marcus Tillmanns
f849702bd7 Utils: Add missing header include
Change-Id: Id6f48a9ecbcc1c14824d782b08bf4875ff32d1d7
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-05-09 14:36:52 +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
fea67b17f9 Utils: Add deviceshell generic class
Change-Id: Ibfb16a0f13f9fe119d27055db5897213127dd104
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-05-09 09:02:01 +00:00