Commit Graph

63 Commits

Author SHA1 Message Date
Jarek Kobus
8fa1a1f587 Handle belowNormalPriority inside process launcher on Windows
Remove setCreateProcessArgumentModifier() from the ProcessInterface
API and replace it with belowNormalPriority flag.

Change-Id: I6bcb92e56c3a68af7fa3e3a1c8b8eb13e3a2e5a7
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2021-08-09 13:23:37 +00:00
Jarek Kobus
25f585227f Refactor openMode/keepWriteChannelOpen/closeWriteChannel
Change-Id: I4090533875ce1da864b6f8554ce59dbc1392a142
Reviewed-by: hjk <hjk@qt.io>
2021-08-09 07:51:26 +00:00
Jarek Kobus
81cbb0a33c Return the write size
Amends 535d312e93

Change-Id: Icdc0eec0d017a65b64b6c20233c67caf2e81c16a
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2021-08-07 00:04:49 +00:00
Jarek Kobus
535d312e93 Implement writing to process inside process launcher
Change-Id: I7321a941024d431cc52b3f6ae0b1ef38d851db8c
Reviewed-by: hjk <hjk@qt.io>
2021-08-06 14:32:21 +00:00
Jarek Kobus
e41b6a0a29 Make process reusable when killing the running one
Try to mimic the behavior of QProcess inside process launcher
as much as possible. After calling QtcProcess::kill() we send
StopProcessPacket to the process launcher - when we receive
it there we start reaping of the process itself and report
back the finished packet with a failure.

Remove canceled state from the LanucherHandle, as after
canceling the process we still need to handle the finished
(or others) signals - like in case of QProcess.

Change-Id: Id66b06449de06675a0ab6778e93e9782afea09d4
Reviewed-by: hjk <hjk@qt.io>
2021-08-05 18:53:41 +00:00
Jarek Kobus
ba037a707e Implement readyRead inside process launcher
Change-Id: I3a27edef2307053b8c4c7d8f1dbf7e0400e27416
Reviewed-by: hjk <hjk@qt.io>
2021-08-05 18:53:22 +00:00
Jarek Kobus
48c1f56ebe Refactor waiting for logic
Instead of waiting for certain state we wait for
certain signal to be placed into the buffer.
No need for m_finished flag anymore, since we are
only interesting if the buffer contains the finished
signal. This will enable to implement waiting for
ready read properly, since no state is changed
in this case.

Change-Id: I4209da385b2e37de6f1897357e35c0ed0c9e4096
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-08-05 14:50:49 +00:00
Jarek Kobus
17f907da9b Implement setStandardInputFile() in ProcessLauncherImpl
Change-Id: I4d77c86ecb750573ce5421ca7300eb27f9f76108
Reviewed-by: hjk <hjk@qt.io>
2021-08-02 13:48:46 +00:00
Jarek Kobus
eca63813d5 Simplify waitForState() implementation
Change-Id: I7bbb06411d0c30ab931cb17b5a1b5940b51e978e
Reviewed-by: hjk <hjk@qt.io>
2021-08-02 07:50:16 +00:00
Jarek Kobus
7e747e25bb Pipe readyRead() through the CallerHandle
In this way the output and error channels
get handled while waitingFor* is being executed.

Change-Id: I8d3d81bd99fcfb7ddea7e98337e859446380055f
Reviewed-by: hjk <hjk@qt.io>
2021-07-16 09:55:48 +00:00
Jarek Kobus
f7cf48bc28 Refactor process launcher
Move launcher process into a separate thread.
Implement blocking API by using wait condition
on the caller's side. Replay all collected
signals from the launcher's thread when leaving
waitingFor* state. In case we were not waiting
for anything deliver the signals asynchronously
from launcher's thread to the caller's thread.

Change-Id: Id44fe5f7ceaac407004984a1dfb6ea65f197d297
Reviewed-by: hjk <hjk@qt.io>
2021-07-16 07:52:58 +00:00
Jarek Kobus
d8286adc7c Implement ProcessLauncher::processId()
Implement the reply confirmation for the started signal.
After qtcreator_processlauncher starts a new process
we connect to its started() signal and post a reply through
the socket to the LauncherInterface with the information about
the new PID. ProcessLauncherImpl now emits the started signal
with a delay, just after the confirmation has been received.

Change-Id: I2689e8e97b17466bd1f6b32c01909c12d80fcdef
Reviewed-by: hjk <hjk@qt.io>
2021-07-12 15:13:03 +00:00
Jarek Kobus
58d00f37d4 Initial import of processlauncher copy from qbs project
Change-Id: I9d646dd1a820e4e69c808998d9f12ff2f5dabe6d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2021-07-08 12:12:10 +00:00