aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/projectexplorer/abstractprocessstep.cpp
Commit message (Collapse)AuthorAgeFilesLines
* ProjectExplorer: Make settings access more directhjk2024-04-121-1/+1
| | | | | | | A step towards aspectification. Change-Id: Iabf5e56e993449dc482d1d2ab6eeb2885243ab3e Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Utils: Fix build with MSVC with C++20Eike Ziller2024-02-281-1/+1
| | | | | | | | | | | | | | | | | 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>
* ProjectExplorer: Show full lines during compilationMarcus Tillmanns2024-02-261-11/+10
| | | | | | | | | | | | Especially on Windows with VC2022 & Ninja, the output would often display lines that ended in the middle until the next batch of output was added. This patch uses the Process facilities to only show full lines. Change-Id: I38fcb2e8cb115637d15181b39374c533db150c1a Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io>
* ProcessParameters: Allow to set the ProcessModeDominik Holland2024-01-241-0/+1
| | | | | | Change-Id: I45db21d8785cfaecd8d524b4acda32e352640282 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> Reviewed-by: hjk <hjk@qt.io>
* TaskTree: Rename workflow policiesJarek Kobus2023-11-071-1/+1
| | | | | | | | | | | | | Make naming consistent with recent changes. "Done" is meant to be an event name when the task / group finishes. "Done" may finish with "Success" or an "Error". This addresses the 26th point in the master task below. Task-number: QTCREATORBUG-28741 Change-Id: Icc882710dc4896626dc9332440aa13a692af54c4 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* TaskTree: Get rid of unneeded done handlers' argumentsJarek Kobus2023-11-071-1/+1
| | | | | | | Task-number: QTCREATORBUG-29834 Change-Id: I236dec27a292a1b006b7001d01ce620960380de9 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* TaskTree: Use common done handlerJarek Kobus2023-11-061-2/+2
| | | | | | | | | | | Instead of specifying two separate done and error handlers, specify just one that takes additional "bool success" argument. Task-number: QTCREATORBUG-29834 Change-Id: Ie4f92236a38b03dac3dd33b2c80a317b62772a12 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* BuildStep: Some cleanupJarek Kobus2023-07-271-3/+0
| | | | | | | | | | | | | | | Remove unused BuildStep API. Remove outdated docs. Cleanup includes. Don't repeat custom cancel messages from build/deploy steps, as in case of cancel action the follow-up message: "Canceled build/deployment." always appears anyway. Change-Id: I50b31e0cc688ee66d76a3a1dbe58eb72702112ad Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* BuildStep: Make it possible to run with task treeJarek Kobus2023-07-141-36/+1
| | | | | | | | | | Move the doRun() implementation from AbstractProcessStep and from AbstractRemoteLinuxDeployStep into BuildStep. Do the same with doCancel(). Task-number: QTCREATORBUG-29168 Change-Id: I767f73dc7408d7c5a9fe9821da92e664cf1ed8f3 Reviewed-by: hjk <hjk@qt.io>
* AbstractRemoteLinuxDeployStep: Refactor tree error handlingJarek Kobus2023-07-141-8/+10
| | | | | | | | | | | | Make it behave like AbstractProcessStep. Move success / failure logging into the recipe. Make starting the task tree look the same in both classes. That's a preparation step before moving running task tree into the base BuildStep class. Task-number: QTCREATORBUG-29168 Change-Id: I2bf3e2476d3942a01efc3b06778410dea40eef5e Reviewed-by: hjk <hjk@qt.io>
* AbstractProcessStep: Use task tree for all subclassesJarek Kobus2023-07-141-59/+22
| | | | | | | | | | Introduce AbstractProcessStep::runRecipe() virtual method with the default implementation. Task-number: QTCREATORBUG-29168 Change-Id: Iac75f4c38f8ee91ad8ac9324bb27881a3722911f Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io>
* AbstractProcessStep: Get rid of done hookJarek Kobus2023-07-141-8/+0
| | | | | | | | | | Not needed anymore. Remove emitting 100% progress on finish of CMakeInstallStep, as that's done automatically by the task tree. Task-number: QTCREATORBUG-29168 Change-Id: If93d989eeb0a551f00754c5d6ef7f180fdbabdd5 Reviewed-by: hjk <hjk@qt.io>
* AbstractProcessStep: Introduce defaultProcessTask()Jarek Kobus2023-07-131-0/+9
| | | | | | Task-number: QTCREATORBUG-29168 Change-Id: Ic10a2edefd1a2ce1ffffd0eb051a720d9462e099 Reviewed-by: hjk <hjk@qt.io>
* AbstractProcessStep: Make isExecutableFile check a part of setupProcessJarek Kobus2023-07-131-8/+7
| | | | | | Task-number: QTCREATORBUG-29168 Change-Id: I47cc43f1465528354802fdc033fc6369e413b526 Reviewed-by: hjk <hjk@qt.io>
* AbstractProcessStep: Make checkWorkingDirectory a part of setupProcessJarek Kobus2023-07-131-21/+15
| | | | | | Task-number: QTCREATORBUG-29168 Change-Id: I5cfedc83a3817c64c67c9797c831084c26f1cab9 Reviewed-by: hjk <hjk@qt.io>
* AbstractProcessStep: Pass reference to the setupProcess()Jarek Kobus2023-07-131-13/+13
| | | | | | | | Conform to the handleProcessDone() and the task tree interface. Task-number: QTCREATORBUG-29168 Change-Id: I25394a877a86434ea5ac26cd85fe50640e55db11 Reviewed-by: hjk <hjk@qt.io>
* AbstractProcessStep: De-virtualize finish() methodJarek Kobus2023-07-131-7/+11
| | | | | | | | | | | Provide a setDoneHook() setter instead. The hook is introduced temporarily, as when all the subclasses are transformed to use the task tree, the done hook is going to be a part of the subclass' recipe. Task-number: QTCREATORBUG-29168 Change-Id: Idbc0f8b8a32c8df2fa5ecb73ed1cbaedad99620d Reviewed-by: hjk <hjk@qt.io>
* AbstractProcessStep: Simplify process done handlingJarek Kobus2023-07-131-61/+17
| | | | | Change-Id: If520052b364789cb830b41a83e9ff3b86082a1e3 Reviewed-by: hjk <hjk@qt.io>
* AbstractProcessStep: Move process done handler from QMakeStepJarek Kobus2023-07-121-12/+31
| | | | | | | | The done handler is going to be used for other processes, too. Change-Id: I3c60ec75656aa45bd57ec3ca8336cf310c78bd3e Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io>
* TaskTree: Prepare for de-utils-ization - part 2Jarek Kobus2023-05-121-1/+2
| | | | | | | | | Move TaskTree into Tasking namespace. Move Tasking namespace out of Utils namespace. Change-Id: Ib4c1d7f54f1808517e54768dfa27209c33517b61 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: hjk <hjk@qt.io>
* Utils: Rename qtcprocess.{cpp,h} -> process.{cpp,h}Jarek Kobus2023-05-041-1/+1
| | | | | | | | Follows QtcProcess -> Process rename. Change-Id: I97235a9a40cb7fd52944515b7ab878d96528f919 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Utils: Rename QtcProcess -> ProcessJarek Kobus2023-05-041-7/+7
| | | | | | | | 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>
* Utils: Replace FilePath::onDevice() by new FilePath::withMappedPath()hjk2023-04-041-1/+1
| | | | | | | | | | | | | | Basically a.onDevice(b) == b.withNewMappedPath(a), matching the order of b.withNewPath(a). Whether the (curretly docker-specific) path mapping is useful /there/, and whether some of the calls are needed at all is dubious. I added some FIXME and changed a few cases directly. Change-Id: I7514736ce922f632f1f737bc496f6783389a42b6 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* ProjectExplorer: Fix potential division by zeroOrgad Shaneh2023-01-311-1/+1
| | | | | | | Reported by Coverity. Change-Id: Ie11625afc862bd7918d5b9bffd73e6726adaac0f Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* ProjectExplorer: Tr::trhjk2023-01-161-8/+10
| | | | | Change-Id: I8f1b463c5cc7a53627f7a9ad261998b92f13e56a Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* Utils: Rename QtcProcess::readAllStandard* to readAllRawStandard*hjk2023-01-101-2/+2
| | | | | | | | | | | | ... and re-use the old QtcProcess::readAllStandard* names for a QString-returning 'decoded' version. For now, only use that in 'full Utf8' cases, to stay bug-compatible, the plan is, however, to employ the QTextCodecs we have already in the channel buffers. That will be one-by-one, though. Change-Id: Id209e0671920d4ea4197918e872f441254112d52 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* Qmake: Enhance remote parsinghjk2023-01-101-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | When parsing remote .pro files the parsers needs to pretend it runs on the remote device. All internal data are now "local on the remote", so that string manipulation in .pro files "just works", and a 'device root' string is passed around to relevant functions which then use it to construct FilePath::toFSPathString()-style paths that our custom FSEngineImpl can then map to the real device. Remote $$system() calls are intercepted by the local parser and redirected using the usual QtcProcess mechanims. Quite a bit of the ProParser needed adjustments, so there's some potential for regression. Task-number: QTCREATORBUG-28242 Task-number: QTCREATORBUG-28161 Task-number: QTCREATORBUG-28355 Change-Id: I6100e7aca4e1db35f5e9689004110aab57e2c595 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Remove GPL-3.0+ from license identifiersKai Köhne2023-01-061-1/+1
| | | | | | | | | | | | | | | 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>
* AbstractProcessStep: Provide API for running TaskTreeJarek Kobus2023-01-051-27/+67
| | | | | | | | As an alternative to calling AbstractProcessStep::doRun(). Change-Id: I53142b7470a3e2aed0e219300fb3e0b4621630db Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: hjk <hjk@qt.io>
* AbstractProcessStep: Merge finish() with processFinished()Jarek Kobus2023-01-051-19/+14
| | | | | | Change-Id: Ied15ec3ee9d3bcc80b03b2589d101c65f2fd062a Reviewed-by: hjk <hjk@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* AbstractProcessStep: Remove two virtual methodsJarek Kobus2022-12-131-24/+4
| | | | | | | | | | | Remove stdOutput() and stdError() virtual methods. Connect to addOutput() signal in subclasses instead and filter for desired channel. Change-Id: Ifd9a2e4ff037776caa706bbdb9634992060172ff Reviewed-by: hjk <hjk@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* AbstractProcessStep: Remove processStarted() virtual methodJarek Kobus2022-12-061-27/+27
| | | | | | | | | | | | | | | | | | | | Add concealedParameters / setConcealedParameters instead, to be used in AndroidBuildApkStep. Use concealed parameters also on start failure and on done. By default, concealedParameters() equals processParameters() (i.e. no sensitive data to hide) unless the implementation decides to replace some sensitive data (e.g. password) with asterisks. In this case the reimplementation needs to store separate instance of ProcessParameters and redirect the pointer of concealedParameters() into own structure. This is being done through a call to setConcealedParameters(). Change-Id: I8b1573b007c0f8a10c9592ccaf25e6f088f04691 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* AbstractProcessStep: Don't read std channels on doneJarek Kobus2022-12-021-18/+6
| | | | | | | | | | | | | | | | | Since we are connected to process' readyRead signals and perform readAll inside handlers, there is no need to do it again inside process' done handler. It's guaranteed that before process emits done() signal it emits readyRead signals if new data appeared on any channel. Remove processReadyReadStdOutput() and processReadyReadStdError() helpers. Change-Id: I7e921335e6410a26efd9619cbed8f5e6852d2cf2 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* AbstractProcessStep: Merge virtual functionsJarek Kobus2022-12-021-33/+18
| | | | | | | | | | | | | Merge processSucceeded with processFinished into one virtual function. Leave default implementation empty, so that reimplementations don't need to call base impl. Move processFinished into private section. Pass just one bool success parameter into processFinished. Change-Id: Ide3e262de0c0c5583c9fec2426fa460b6b74a49d Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* ProjectExplorer: Ensure working dir is reachableMarcus Tillmanns2022-10-191-6/+15
| | | | | | | | | | | | | | | Previously the working directory might not be reachable by the executable. This change fixes that by calling "ensureReachable", and changing the path to an on-device path of the exectuable. This also fixes the path when the Host is Windows, and the build device is a unix type system by changing the paths from e.g. "c:/..." to "/c/..." Change-Id: I6c86e16c867bb654b6c2a4951d9f62fdb879298e Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* Use SPDX license identifiersLucie Gérard2022-08-261-24/+2
| | | | | | | | | 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>
* AbstractProcessStep: Don't call blocking waitForStarted()Jarek Kobus2022-06-301-8/+6
| | | | | | | | Connect to started() signal instead. Delete the process later when process failed to start. Change-Id: I9901a52c90b018af06348892e2bd97cf967418af Reviewed-by: hjk <hjk@qt.io>
* AbstractProcessStep: Connect to QtcProcess::done() signalJarek Kobus2022-04-281-9/+9
| | | | | | | | Instead of connecting to finished() signal. Change-Id: I2c1266bf699f54053fde37bb7ff22a93131e6b11 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* Don't delete process directly from process' finished handlerJarek Kobus2022-04-051-1/+2
| | | | | | | | | | | | | | | | | AbstractProcessStep::slotProcessFinished() slot is connected to m_process finished() signal. We call there AbstractProcessStep::Private::cleanUp(), and that calls m_process.reset(), so it invokes m_process d'tor directly. SshRemoteProcessRunner::handleProcessFinished() slot is connected to d->m_process finished() signal. We call there SshRemoteProcessRunner::setState(), and that calls d->m_process.reset(), so it invokes m_process d'tor directly. Delete later m_process instead in both cases. Change-Id: I4a0f2a631b676b57e8bcc3a7878620bc76dc74de Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Get rid of no-op calls to QtcProcess::kill()Jarek Kobus2022-03-241-1/+1
| | | | | | | Leave the work for implicit ProcessReaper. Change-Id: Ie01c4e996fda18b7cee77851394174556c6f3857 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Fix canceling compilationJarek Kobus2021-09-211-16/+11
| | | | | | | | | | | | Don't expect that the process being reaped will emit any signal. Before deleting the process inside AbstractProcessStep::doCancel() we do the expected cleanup immediately. We can't expect that the process being reaped will return fine, so we set exitCode to -1 and exitStatus to CrashExit. Fixes: QTCREATORBUG-26271 Change-Id: I0afd7ba8846d0fa57a0531201bbed9bd7a490942 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Move ProcessReaper into lib/utilsJarek Kobus2021-09-061-3/+1
| | | | | | | | | | | | | Reuse ProcessReaper inside process launcher. Automatically reap all internal QProcesses of QtcProcess (either direct child of QtcProcess in QProcessImpl or indirectly inside process launcher). Make ProcessReaper work again on QProcess instead of on QtcProcess, so it may still be reused for non-QtcProcesses. Change-Id: I950cac5cec28f17ae97fe474d6a4e48c01d6aaa2 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: hjk <hjk@qt.io>
* Utils: Drop QProcess specific parameters from QtcProcess::finished()hjk2021-06-141-1/+1
| | | | | | | | | | | 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>
* ProjectExplorer: Show a verbose error message if availablehjk2021-06-071-2/+6
| | | | | | | ... when a start failed, e.g. due to a inacessible working directory. Change-Id: Ibcec1c5323c37f1e8f6c9e55439439b24f3b40b1 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* ProjectExplorer: Fix Coverity warning in AbstractProcessStephjk2021-06-071-4/+3
| | | | | | | | | | | | | | | | | | | | | *** CID 1505141: Null pointer dereferences (FORWARD_NULL) /qt-creator/src/plugins/projectexplorer/abstractprocessstep.cpp: 409 in ProjectExplorer::AbstractProcessStep::slotProcessFinished(int, QProcess::ExitStatus)() 403 if (!process) // Happens when the process was canceled and handed over to the Reaper. 404 process = qobject_cast<QtcProcess *>(sender()); // The process was canceled! 405 if (process) { 406 stdError(d->stderrStream->toUnicode(process->readAllStandardError())); 407 stdOutput(d->stdoutStream->toUnicode(process->readAllStandardOutput())); 408 } >>> CID 1505141: Null pointer dereferences (FORWARD_NULL) >>> Passing null pointer "process" to "cleanUp", which dereferences it. 409 d->cleanUp(process); 410 } 411 Amends 4a26a2c28. Change-Id: If9a66841b05e389a87a1b843ee5ef9e66edf15dd Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Utils: Make QtcProcess::{setW,w}orkingDirectory use FilePathhjk2021-06-031-3/+2
| | | | | | | But keep the old setter for a while to ease transition. Change-Id: If02b79b1fcd31fbf8b06ef26876c41af891127f9 Reviewed-by: hjk <hjk@qt.io>
* Utils: Move QProcess base to QtcProcessPrivatehjk2021-06-021-7/+7
| | | | | Change-Id: I4c6811d42e051fadfcf32edb664ff3bc09e692e6 Reviewed-by: David Schulz <david.schulz@qt.io>
* Utils: Make Environment::setEnglishOutput a proper member functionhjk2021-05-211-1/+1
| | | | | | | | The previous indirection was useful as long as they were overloads for QProcessEnvironment and QStringList, but these are gone now. Change-Id: I5066bd2e72fd06948a5cc7bbac6dda9006db96ed Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* ProjectExplorer: Remove some unneeded #includeshjk2021-05-061-4/+0
| | | | | Change-Id: I08cdf8bb02a1cc394dc0698d1eaa5341ab82aa71 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* ProjectExplorer: Make AbstractProcessStep::doRun() tests work remotelyhjk2021-05-031-6/+6
| | | | | | | By funneling file system accesses through Utils::FilePath. Change-Id: I13a3aac23bd5fc301edf5e5c52e0c7ebd1e6ca6c Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>