Commit Graph

17 Commits

Author SHA1 Message Date
Jarek Kobus
53de9701f4 CommandLine: Use more 1-arg c'tor
Change-Id: If52c4094f94859d51e31862d913b1756e333e512
Reviewed-by: hjk <hjk@qt.io>
2024-05-16 12:45:42 +00:00
Eike Ziller
5af531cd39 Utils: Fix build with MSVC with C++20
Rename process.h back to qtcprocess.h

MSVC's "threads" standard header includes <process.h>, and that ends up
including our process.h from Utils.

There already was a hacky workaround in place for a similar issue with
MINGW, but that doesn't work with MSVC because that doesn't have

Simply use a name that doesn't conflict.

Change-Id: I1159cd2096b4f2dbc4a1728d0131dd6edd30ebd3
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2024-02-28 08:09:05 +00:00
Jarek Kobus
a0f6e8dc04 Utils: Rename qtcprocess.{cpp,h} -> process.{cpp,h}
Follows QtcProcess -> Process rename.

Change-Id: I97235a9a40cb7fd52944515b7ab878d96528f919
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-05-04 05:52:26 +00:00
Jarek Kobus
470c95c94b Utils: Rename QtcProcess -> Process
Task-number: QTCREATORBUG-29102
Change-Id: Ibc264f9db6a32206e4097766ee3f7d0b35225a5c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2023-05-04 05:52:16 +00:00
Eike Ziller
b36287731e Merge remote-tracking branch 'origin/10.0'
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	src/plugins/remotelinux/genericlinuxdeviceconfigurationwidget.cpp
	src/tools/perfparser

Change-Id: Ie5643100e0eb00e0933359dce320169b876f5634
2023-03-29 12:21:50 +02:00
Marcus Tillmanns
9ddd1e1d36 Utils: Improve DeviceShell error handling
In case mktemp or mkfifo fails, the device shell script would
incorrectly print both success and failure messages.

Also cleaning State enum, removing unnecessary values.

Fixes possible crash if creation of master process fails.

Fixes: QTCREATORBUG-28928
Change-Id: I75fef54dc791b2b0a403bab19dab6813b62643ac
Reviewed-by: hjk <hjk@qt.io>
2023-03-21 12:31:44 +00:00
Jarek Kobus
dc2f6b2345 DeviceShell tests: Use QtConcurrent instead of Utils::mapped()
Fix some const correctness and style.

Change-Id: Id284f14530ff454e92e3c77b33e0844fcb429daf
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-03-12 19:35:38 +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
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
Marc Mutz
8eb4d52342 Port from qAsConst() to std::as_const()
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>
2022-10-07 13:47:53 +00:00
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
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
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
Marcus Tillmanns
88651ecb3e deviceshell: Disable tests on old macos versions
The bundled "base64" tool of macos < 10.15 did not support
the "-d" option ( only -D ). We disable the tests running
on the local shell to keep them from failing.

Change-Id: I6af353869033ed15cefedc03e2562621d1ea9904
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-06-28 11:31:11 +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
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