aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/corelib/buildgraph/processcommandexecutor.h
Commit message (Collapse)AuthorAgeFilesLines
* Add command and AutotestRunner timeoutJochen Ulrich2019-08-011-2/+4
| | | | | | | Task-number: QBS-1454 Change-Id: I6e2514d10cca0cba0a14456ecd2abfb495539ee4 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* corelib: Apply modernize-use-overrideAlessandro Portale2018-08-201-4/+4
| | | | | | | Add overrides to function, except for destructors. Change-Id: I1a1337b01dfef81b74ba56c5f00bf4d4cfc10935 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Add product name to command descriptionsChristian Kandeler2018-03-121-1/+1
| | | | | | | | | | | | | | | The pure file name that the description usually contains does not always provide enough context: It's not necessarily clear from a file name which product it belongs to, and some files can be built as part of more than one product. Because we print the full product name, including the multiplexing information if necessary, we also remove the JS code that provided this kind of disambiguation for GCC compiler and linker rules only. [ChangeLog] Command descriptions now also contain the product name. Change-Id: I9702a6cff3faffb086e5c93e02fffa6e65fb1043 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Move transformer change tracking out of the build graph loaderChristian Kandeler2018-02-161-1/+1
| | | | | | | | | | | | | | | | | | | | The checks that determine whether to re-run prepare scripts and/or commands due to property or environment changes do not belong into the build graph loader. Instead, we now do them on demand during the build process. Advantages: - The code is at its "natural" place, making it easier to understand and less fragile. - There are a lot fewer unnecessary build data invalidations, speeding up both re-resolving and rebuilding in case only some rules/commands have changed. - Re-running commands due to property or environment changes no longer implies re-running prepare scripts. - We now catch property changes on generated artifacts, which was not possible before, because the build graph loader only had access to the source artifacts of the re-resolved project. Change-Id: I36b022cf631fa9e8293feec4d6f416c2686539c1 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Use nullptr to initialize the pointersDenis Shienkov2017-11-201-1/+1
| | | | | | Change-Id: I59d743f585410cb5c00d36a7b6f9a3e9d696d19e Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Use a dedicated launcher process to run all ProcessCommandsChristian Kandeler2017-01-251-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On Linux (and very likely other Unices as well), QProcess::start() incurs a certain overhead, because forking off the child process duplicates some of the parent process' resources. This overhead appears to be proportional to the amount of memory allocated by the parent process, presumably due to page table entries getting copied. This has consequences for qbs, particularly when being used from an IDE such as Qt Creator, which has a higher memory footprint than the command line tool. When using a high job count, as is typical on machines with lots of CPU cores or in a distributed compilation environment, the following problems were observed: - High CPU load in the starting process (Qt Creator). Profiling showed that most of the time was spent in fork() and related functions. - As a result, the number of parallel jobs stalled at a value well below the requested one, slowing down the build. - In some cases, QProcess::start() failed altogether, emitting a message such as "fork() failed: Could not allocate memory". We solve these issues by outsourcing the starting of ProcessCommands to a dedicated launcher tool with modest memory requirements. For each qbs process, we have one instance of this tool running while a build job is going on. Communication with qbs happens via QLocalSocket. The protocol is encapsulated in a QProcess replacement, so almost no changes to existing code were necessary. No performance regressions were observed when using lower job counts. This patch will also enable us to properly support the incredibuild tool in IDEs such as Qt Creator, which you do not want to start via ibconsole. [ChangeLog] Improved scalability of parallel builds on Linux by starting Process commands via a dedicated launcher process. Change-Id: I8966c00a2d67a94c3a380f0e089d61eda122209e Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Change style of #includes of Qt headersJake Petroules2017-01-041-3/+3
| | | | | | | | | | | | | | | | By using q<lowercase>.h headers, we become more bootstrap-friendly, as no full syncqt is required any more. In the same go, prefix all includes with the module name. This helps grep-based analysis of which parts of Qt are used and where. It's also consistent with Qt's public headers (where syncqt enforces the style). Testdata and examples are excluded from the change, as they are not relevant for bootstrapping. Change-Id: I9539b1d795e87fca6e5fc6c91acbb775b79208d9 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Update license headersIikka Eklund2016-08-291-14/+23
| | | | | | | | | | Patch-set 1 includes *.h Every source file needs to have up-to-date license headers in order to pass ci. Change-Id: Ib6cf3ac47dfba6dff262fded44bc952aef3bda8b Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* Merge remote-tracking branch 'origin/1.5'Joerg Bornemann2016-06-081-1/+1
|\ | | | | | | | | | | | | | | Conflicts: doc/reference/items/transformer.qdoc share/qbs/modules/cpp/GenericGCC.qbs Change-Id: I45560834560019b18274c373c45651eb8aadd206
| * Replace 'the Qt build suite' with 'Qbs' in copyright notices.Jake Petroules2016-06-061-1/+1
| | | | | | | | | | | | Change-Id: I885d94bb14b325dc36767a840ebdb0be1fb59dd2 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* | Use Qt5-style connectsOrgad Shaneh2016-06-071-2/+1
| | | | | | | | | | | | | | The heavy lifting was done by clazy. Change-Id: Ibb13c517567b1b32bbda6d26225454d1b003934d Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
* | Add a new command line echo mode that also prints environment variables.Jake Petroules2016-05-231-0/+1
|/ | | | | Change-Id: I88213103519ae4f69fedb4fe535c9c44e3b61d03 Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
* ProcessCommandExecutor: Clean up process output handling.Christian Kandeler2015-11-231-0/+2
| | | | | | | | | - Get rid of code duplication. - Simplify code flow. - Fix potentially erroneous overwriting of error status. Change-Id: Ic7e3babe707e6d9e5c8c478de0891a5adecc0875 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* Allow more fine-grained error reporting in ProcessResult.Christian Kandeler2015-11-171-2/+2
| | | | | | | | We achieve this by forwarding QProcess::ProcessError instead of QProcess::ExitStatus. Change-Id: Id4b9ac7facbb92281e0a11da635131145114be9d Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* Print the command that was actually executed in command echo mode.Jake Petroules2015-07-131-0/+2
| | | | | | | | Previously, it would display the command that was entered ("cmd") vs the command that was actually used ("C:\Windows\System32\cmd.exe"). Change-Id: Ia3487f2a0fee4c439d82598f3e2e81650efafa80 Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
* update license headersJoerg Bornemann2015-03-021-2/+2
| | | | | Change-Id: I36d825db3a5ef32c162c3063aab1e8a1f2696f4f Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
* Replace --show-command-lines with --command-echo-mode.Jake Petroules2015-02-251-2/+0
| | | | | | | | | | This allows users to hide command output entirely without changing the logging level. It is also used by the generator command to hide the dry run command "executions" it performs when creating the build graph for project generation. Change-Id: I27a64c8138521001f5b62473b4a3b4ff46d8ba25 Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
* Merge branch '1.3' into 'master'Christian Kandeler2015-01-281-6/+6
|\ | | | | | | | | | | | | | | | | Conflicts: doc/reference/jsextensions/jsextensions-general.qdoc src/lib/corelib/language/evaluatorscriptclass.cpp src/lib/corelib/language/evaluatorscriptclass.h Change-Id: Ic9b77b56e8fc8bf93e0a553930757de8c93fed22
| * Update LicenseEike Ziller2015-01-261-6/+6
| | | | | | | | | | Change-Id: I092fca9f950de1ba38826c33b155f86feae2770b Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
* | add option to show command lines in build outputJoerg Bornemann2014-11-071-0/+3
|/ | | | | | | | | | With "qbs build --show-command-lines" one can suppress command descriptions and show actual command lines instead. Change-Id: I98328254bad7fb85036abb0525c5ad7e734110c7 Task-number: QBS-615 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* License update.Eike Ziller2014-10-161-7/+8
| | | | | | | Add LGPLv3 option. Change-Id: I8a63ad5e46a2701032b2103f791df4dec5b707e8 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* factor ExecutableFinder out of ProcessCommandExecutorJoerg Bornemann2014-10-101-5/+0
| | | | | | | | The functionality of finding the right executable in the build environment is useful in other contexts too. Change-Id: Iea73ccbc6eda1f0e58e4aadca3a2c23c7211168d Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* Remove left-over function declaration.Christian Kandeler2014-04-161-1/+0
| | | | | Change-Id: I9c7be07b195eee08736394801f6b0aabc0f24231 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Allow long-running commands to be canceled.Christian Kandeler2014-04-151-1/+2
| | | | | | | | | | At the moment, canceling a build waits for the current command to finish, which means that a badly behaving process or piece of JavaScript code can block qbs indefinitely. Task-number: QBS-552 Change-Id: I8ac23f068dd6083905a9681097da6b970c0b646b Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Move Qt profile setup into a dedicated library.Christian Kandeler2014-01-101-0/+89
Otherwise all changes to the implementation will have to be duplicated in IDEs. Change-Id: I61e6d4fa1ee9b724eb5d9de9f233dc915a6c8bc3 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>