By default QProcess::readChannel() returns StandardOutput,
and since no one modifies it, it will always be the same.
No need for an assert.
Change-Id: Id55f75e5cce4f1b8eaef2ec3094d7b103c2f0238
Reviewed-by: hjk <hjk@qt.io>
Mark ProcessLauncherImpl canceled when the kill
request has been sent to the process launcher.
If ProcessLauncherImpl is canceled, ignore the
finished reply sent from process launcher.
Recheck the state inside stopProcess() method
after calling terminate() - in this way in case of
ProcessLauncherImpl we avoid calling unimplemented
waitForFinished().
Change-Id: Ibad148f6c7e63ef619e53eb41bbeeb7693be3d25
Reviewed-by: hjk <hjk@qt.io>
The initial implementation is a copy of QbsProcess
with some small adaptations. Start a LauncherProcess
in Creator's main function, just after the creation of
the application object.
Change-Id: I016df3ed664d7914c73f4a35742d5a63d5faaca0
Reviewed-by: hjk <hjk@qt.io>
Abstract part of QProcess interface into ProcessInterface
pure virtual class. The current API of ProcessInterface
is a part of QProcess API used currently to implement
QtcProcess. Provide 2 implementations for it: QProcessImpl
which uses QProcess and ProcessLauncherImpl which is currently
empty implementation with assertions that no method is being
called. Provide an additional switch to QtcProcess c'tor
for selecting the preferred implementation, by default it
selects QProcessImpl. This change doesn't influence any behavior.
Change-Id: Ia5328401affe127f3d36870be8478202d4143480
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
Keep SynchronousProcess as type alias for a transition period.
Change-Id: I2540b6cecc17eb46f40ed57d27589011693728f1
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
To QtcProcess, as penultimate step to fully merge the two.
Change-Id: Iaab3bc3e50165f732838335bd185632f33a97900
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
- Pass everything through the codec.
- Always emit even incomplete last lines when the process finishes.
- Don't store raw output when line-wise processing is requested.
Change-Id: I5cc30ad0d7ab79387bfb00b48ff957468a1bd004
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
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>
The m_process member is strictly speaking only needed for processes
handled "fully locally", i.e. without diversion through any device.
Better set it only when needed, even if only to avoid even unused
locally illegal paths like "docker://123/tmp/x" as working directory.
Change-Id: Ia9e686855ff0c213eb3be03def8c4cecc7ee37ae
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Complains about template argument (QString) and type of value
(const QString) not being the same.
make_optional is usually used with template parameter deduction anyhow,
but in this case we can just return the value.
Change-Id: Icc5c6bb4505d09ab6a864fb7a7c6ec97e34b42b7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
And drop the function from the QtcProcess interface, as this was the
only user.
Change-Id: I5a21cdaacb3f91f78058e80cbe1cb1572e9bf331
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Some functions do not work and should therefore not be used.
Line-based processing of the output interferes with the internal
automatic usage of the ChannelBuffers.
Remove the respective functions and move the line parsing over
to the client.
Change-Id: Iaaa58c181e35e132fae863ddb808547142c99221
Reviewed-by: hjk <hjk@qt.io>
To make clear that this is not just any finish.
Also change FinishedError to FinishedWithError, to create
symmetry.
Also adapt enum member description to reality.
Change-Id: I13e05391eb86fdb24e2ae660f14dfddb282e1104
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
... and add a QtcProcess::systemEnvironmentForBinary(filePath)
redirecting to IDevice::systemEnvironment() of the device implicitly
given by filePath. A device implied by e.g. a qmake binary or a compiler
binary is a common scenario.
Change-Id: Ieb2c724ae66f1a1752132e4e4648a604390ca369
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Make functionality dependent on an (intentionally ugly)
setProcessUserEventWhileRunning call.
Also, back-paddle a bit on API combination of QtcProcess and
SynchronousPrceoss for now and prevent the QtcProcess-and-
runBlocking and SynchronousProcess-and-start combinations.
Goal is still to have all in QtcProcess in the end, but this
may take a while.
Change-Id: Ic146ec5db0ab8dc9613e5b2af5f4dc90bc7465ca
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
The PCH header is undefining CALLBACK after loading Windows headers,
but we need to add it back when using Windows headers that need it.
The new definition needs only to be done when the PCH is used,
otherwise it could lead to re-definition warnings.
Amends 7880950eca
Change-Id: Iae57ac4bbbfdd45b5f9b50a2242103bec6eea5bc
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Makes run() more similar to what start() looks like.
Also add some asserts to make sure run() and related functions are
only called on SyncronousProcesses, as these are currently the only
ones where this works.
Change-Id: Idee6076c3f40a484db5c17f5bb348698cc83d220
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Move the remnaining two members into QtcProcessPrivate, its
only user.
Change-Id: I8e0c23e1a56b36b750b5b4bd4e88d762260e42a1
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
The data was present in the ChannelBuffer
Change-Id: Ica645ba58bb2e86d0ef4cf5387f0a228f132e07d
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This was requiring parameters the process object already knows.
This is a slight behavior change in most cases, it now includes
always the command line arguments, which previously only happened
in gcctoolchain.cpp and iarewtoolchain.cpp.
Change-Id: Id25a68c397e2f1d8bf52ab29210e215b1de46c6d
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
The result is fully stored in the object anyway. Using the extra
SynchronousProcessResponse structure only causes copies of
the data and complicates access on the user side in
a lot of cases.
The result bits are now also accessible individually.
There's obvious room for follow-up changes on the topic, e.g.
ShellCommand::runCommand's parameter list could shrink to
just a SynchronousProcess parameter.
Change-Id: I45aa7eb23832340be06905929280c012e1217263
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
to ProcessArgs and rename the files to commandline.*.
fileutils was a strange place for CommandLine, and this
reduces the dependencies needed for sdktool.
Change-Id: I9d7e8ffe8a3560f5d12934457b086f9446976883
Reviewed-by: hjk <hjk@qt.io>
Instead, make its behavior implicit if none is given.
Change-Id: I3c1a054751a0afe22d0f40a2fed6dd00b5aef205
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This reverts a bit of fe8fbf1a4a which was over-shooting API-wise.
Change-Id: Iac4c2b9fa550f7ec0b0aa8deea8c3fc6b6ddcfba
Reviewed-by: Christian Stenger <christian.stenger@qt.io>