Commit Graph

15 Commits

Author SHA1 Message Date
Jarek Kobus
9a4164a4de CMakeProcess: Don't use QTimer for checking the canceled state
Create a QFutureWatcher instead and connect to its canceled()
signal.

Replace some includes with forward declarations.

Change-Id: Ie82bf8902ef8c8d87011809bd14b7db3d4f52179
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2022-05-16 12:37:18 +00:00
Jarek Kobus
8eb12ea614 CMakeProcess: Fix stopping the CMake process
Calling QtcProcess::terminate() doesn't guarantee that
process will be terminated, especially on Windows we may
ofter wait for it forever. Replace the call to terminate()
with close(). After calling close(), the process will sooner
or later be terminated (or finally killed) - that's the job
for ProcessReaper.

Since the current code relies on receiving the finished() signal
after calling a stopping method, we need to call the expected
handler (handleProcessDone()) after calling the QtcProcess::close(),
as afterwards we can't expect receiving any signal for the possibly
running process anymore.

Refactor the code so that we connect do QtcProcess::done() signal
instead of connecting to QtcProcess::finished() signal. This
guarantees that the handler will also be called when process
failed to start. Handle this case in done() handler, too.

Rename CMakeProcess::terminate() into CMakeProcess::stop()
in order to avoid confusion on what method we have chosen to
stop the process in fact. That's the implementation detail.

Get rid of some QFuture related handlings from public API.
Use them directly from inside CMakeProcess d'tor.

Get rid of public state() method, as it seems it's unused.

Increase the responsiveness of small [x] icon of the running
cmake task (reduce the timeout of 500 ms into 50 ms).

Fixes: QTCREATORBUG-27518
Change-Id: I15cac3990079ad1cae0bbe22ac2a6e64cfb659a0
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2022-05-16 10:30:48 +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
Cristian Adam
dfacdbefa8 CMakePM: Add ability to stop CMake run in Settings
Previously the only way to stop the CMake run was to click on "x"
button of the "Configure" progress bar.

Now you can click in Settings on "Stop CMake".

Change-Id: I167b86ba62679f197c194148b122ff0c87e87162
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-01-07 11:13:54 +00:00
hjk
60ab92ec1b CMake: Use line based QtcProcess callbacks in CMakeProcess
This also fixes a potential issue where contents in the local
'rest' strings outlive the process and get part of the next run.

Change-Id: Ia9272bff80213084e430436d677183b4faabd250
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-22 08:57:42 +00:00
hjk
fe7d6f0def Utils: Drop QProcess specific parameters from QtcProcess::finished()
Mid-term plan is to concentrate on use of QtcProcess::result()
instead which is a bit more system-agnostic.

There's quite a bit of potential for downstream cleanup by
re-using QtcProcess::exitMessage() now.

Change-Id: I3806b3f5933d96e64b7cfb18cc6c52823fddcbcd
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-14 13:31:05 +00:00
hjk
bc2af18a41 CMake: Simplify CMakeProcess::finished signature
The parameters were never used, and start to look alien in the
presence of QtcProcess::result().

Change-Id: Ie2d6a051b439b5e9161d565b84efb78dbe17487f
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-06-08 12:38:42 +00:00
Christian Stenger
617a8aee2b CMakePM: Start integrating ctest
Gather some more information of a CMake based project to be
able to provide this later on to the AutoTest plugin.

Task-number: QTCREATORBUG-23332
Change-Id: I2beaf0a6456d57871dcf65832f0a79f37fe5fddc
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-11-09 11:02:37 +00:00
Christian Kandeler
1c6e4fbd32 Merge output formatters and output parsers
Now only one piece of code needs to be written to both linkify output in
an output pane and create tasks for it in the issues pane.
The calling sites are also simplified. For instance, until now, build
steps had to feed their output parsers manually and then push the
created tasks up the signal stack in parallel with the actual output,
which the build manager relied upon for cross-linking the output pane
content. Afterwards, the output would get forwarded to the formatter
(and parsed for ANSI escape codes a second time). In contrast, a build
step now just forwards the process output, and task parsing as well as
output formatting is done centrally further up the stack.
Concrete user-visible improvements so far:
    - File paths in compiler/linker messages are clickable links now.
    - QtTest applications now create clickable links also when run
      as part of a build step, not just in the app output pane.

Task-number: QTCREATORBUG-22665
Change-Id: Ic9fb95b2d97f2520ab3ec653315e9219466ec08d
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-04-23 08:47:08 +00:00
Tobias Hunger
5350288e45 CMake: Fix includes all over the CMake plugin
Keep internals internal, remove some unnecessary includes, add
some that should have been there.

This reduces the number of files that get rebuild when working
on CMake internals from over 1000 to about 200.

This patch also moves some code around that ended up being
in the wrong file.

Change-Id: Icd7366ac760dc85031040720418fbb16336dce9b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-04-20 10:05:24 +00:00
Christian Kandeler
6f32538c5d ProjectExplorer: Split up the IOutputParser class
For symmetry with Utils::OutputFormatter.

Task-number: QTCREATORBUG-22665
Change-Id: I148fed69dba042ad3ef26e080829c31cd3f357fd
Reviewed-by: hjk <hjk@qt.io>
2020-04-16 10:40:33 +00:00
Cristian Adam
bafa0d9495 CMakeProjectManager: Add elapsed timer
Change-Id: I1e7bcd60cae0193b4d16f20175b76550aaefbf9c
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-02-28 12:33:13 +00:00
Tobias Hunger
196b0da08a CMake: Write creators settings into build directory
Write a file qtcsettings.cmake into the build directory. This
file contains all applicable CMake configuration settings that
creator wants to set.

Use "cmake -C qtcsettings.cmake .." to reconfigure on the command
line to make use of this file.

Change-Id: I4a69d082c50bb66e60b4eec1b3155df53e00734d
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-10-18 14:11:13 +00:00
Tobias Hunger
97392daaf3 CMake: Allow cancellation of CMake process
Allow cancellation of cmake runs in tea-leaf and fileapi modes.

At least in those modes cmake can now get stopped when it goes into
an infinite loop.

Change-Id: I4e9bd769292325b9837904cd391ff61dbc477898
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-06-19 10:14:40 +00:00
Tobias Hunger
daaef73682 CMake: Factor out code to run cmake from tealeafreader
Change-Id: I10947596ce08eb0148a5bf258bdf26cfced43db1
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2019-06-07 11:07:07 +00:00