aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/corelib/buildgraph/rulecommands.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Add command and AutotestRunner timeoutJochen Ulrich2019-08-011-2/+12
| | | | | | | Task-number: QBS-1454 Change-Id: I6e2514d10cca0cba0a14456ecd2abfb495539ee4 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Return initializer list where it is possibleDenis Shienkov2019-02-261-1/+1
| | | | | | | | | This fixes this clang-tidy warning: warning: avoid repeating the return type from the declaration; use a braced initializer list instead [modernize-return-braced-init-list] Change-Id: I421e1e47462fe0e97788672684d47943af7df850 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Prevent "dynamic" values from getting assigned to command propertiesChristian Kandeler2018-10-251-1/+3
| | | | | | | | | | Values such as artifact objects are not plain data and we therefore must not attempt to make deep copies of them. Catch attempts to assign them to command properties. Fixes: QBS-1404 Change-Id: I1fa02720a3543cd8e2c734ed9437d31b5a573d57 Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
* corelib: Apply modernize-use-autoAlessandro Portale2018-08-201-2/+1
| | | | | | | Use more auto. Change-Id: I27e1e2345c6bede459a375663be72ec3370a5e39 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Add support for job poolsChristian Kandeler2018-08-081-0/+3
| | | | | | | | | | | | | | | | | | | | | | Commands can now be assigned to an arbitrary job pool and a limit for the number of concurrently running jobs in such pools can be provided in a number of ways: - via the build command line: qbs --job-limits linker:1 - via the settings: qbs config preferences.jobLimit.linker 1 - in a project file: JobLimit { jobPool: "linker"; jobCount: 1 } We provide two job pools ourselves with the cpp module: "compiler" and "linker". [ChangeLog] Added the concept of job pools for limiting concurrent execution of commands by type Task-number: QBS-743 Change-Id: Ib3f361dbc73093e342bf0eba0daf2079a2b3a8ce Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Provide rules with information about the content of Export itemsChristian Kandeler2018-03-141-4/+4
| | | | | | | | | | | | | | | The product variable gets a new property "exports" that provides a "dependencies" array as well as property values the same way that the product variable itself does, but for exported dependencies and properties, respectively. In addition, meta data about these properties is provided via a "properties" array, and structural information can be retrieved via "childItems". This data is intended to be used by modules creating interface files from products. Task-number: QBS-268 Change-Id: I2bb106e1ca1b18abbd6fe60411bc81bda9ee35e7 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Add product name to command descriptionsChristian Kandeler2018-03-121-0/+5
| | | | | | | | | | | | | | | 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>
* Get rid of redundancies between load() and store() methodsChristian Kandeler2018-02-161-52/+11
| | | | | | | | | | It's silly that we have to mention each serializable data member in both the load and the store methods. Instead, whenever possible, forward these methods to a template that calls the right function in the persistence backend based on its parameter. Change-Id: I00e2dee8cdf55405f447cee27190bc97df8673e3 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Move transformer change tracking out of the build graph loaderChristian Kandeler2018-02-161-0/+8
| | | | | | | | | | | | | | | | | | | | 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>
* Introduce dedicated type for command listsChristian Kandeler2018-02-151-10/+9
| | | | | | | Mainly to streamline the serialization calls. Change-Id: Ia54d51a193b2db52dab66d36e526f8516c15f20a Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Fix autotests on Windows by re-adding weird conversion round-tripChristian Kandeler2017-11-301-2/+10
| | | | | | | | | | | Commit dd57e76a43 removed a seemingly nonsensical QScriptValue -> QString -> QScriptValue conversion, but without it, one autotest test inexplicably fails on Windows (namely propertiesInExportItems, which does not appear to be special in any way). Likely a QtScript issue. Let's re-add the magic. Change-Id: I83fbc62c2d5a1643ed8bba56e15531d2c42df3f9 Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* Modernize variable declarationsDenis Shienkov2017-11-301-1/+1
| | | | | | | | Use 'const' and 'auto' keywords more where static_cast is used. Change-Id: I60152b90fe5e44aa1ca513b43f133e604ed6417f Reviewed-by: Jake Petroules <jake.petroules@qt.io> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* corelib: Gather string constants in central placeChristian Kandeler2017-11-291-84/+104
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The same string literals appeared over and over again in the code base, causing redundancy in the sources as well as at run-time. We now give them a name and make sure they get instantiated at most once. String literals that occur only once are converted from QLatin1String to QStringLiteral unless they appear only in contexts that make use of QLatin1String overloads or they are clearly outside of any hot code paths. This seems to result in small, but measurable performance improvements, even if we assume the 1% changes to be noise: ========== Performance data for Resolving ========== Old instruction count: 3266514138 New instruction count: 3209355927 Relative change: -2 % Old peak memory usage: 29649896 Bytes New peak memory usage: 29436264 Bytes Relative change: -1 % ========== Performance data for Rule Execution ========== Old instruction count: 3367804753 New instruction count: 3319029596 Relative change: -2 % Old peak memory usage: 19577760 Bytes New peak memory usage: 19091328 Bytes Relative change: -3 % ========== Performance data for Null Build ========== Old instruction count: 608946535 New instruction count: 604566001 Relative change: -1 % Old peak memory usage: 14606384 Bytes New peak memory usage: 14579936 Bytes Relative change: -1 % Change-Id: Ia055a52e0a4b6fe6fd0f1e7ba4bfa583cba1b0ef Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* STL compatibility: use push_back() instead of operator<<Jake Petroules2017-11-161-1/+1
| | | | | | | ...and operator+= Change-Id: I848610544cacc2d187d601c0db567703c3e68c93 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* STL compatibility: use size() instead of count()Jake Petroules2017-11-151-4/+4
| | | | | | | This is a simple find and replace with manual sanity check. Change-Id: Ia733befe7885dc3c643d5c84e151312bfd86a3c6 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Lower the default response file threshold a bit on Windowsv1.9.1Christian Kandeler2017-09-291-1/+9
| | | | | | | | | It has been observed that values somewhat below 32000 can cause issues as well, so use a "safety offset". Task-number: QBS-1201 Change-Id: Ic82a4b4a9d770d8d92b955d1e70194de5baeae1b Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* Re-run process commands if a relevant environment variable has changedChristian Kandeler2017-06-081-0/+14
| | | | | | | | | | | | Process commands can now declare that they are sensitive to certain environment variables. If such a variable changes its value, we invalidate the respective transformer. [ChangeLog] Added new property "relevantEnvironmentVariables" to the Command class Change-Id: Id866dc676b3b483a5d843e6125c91829f5094eba Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* Replace QSharedPointer/QWeakPointer with std::shared_ptr/std::weak_ptrJake Petroules2017-05-231-1/+1
| | | | | Change-Id: I2915c578968bed425a8d8b617b56df88ed3f2882 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Bump required Qt version to 5.6Christian Kandeler2017-02-271-11/+1
| | | | | | | | | | | It seems natural to use the LTS release as the minimum required version, and we get rid of a number of #ifdefs. [ChangeLog] Building qbs now requires Qt 5.6 Change-Id: I327ebb179a20e6372fa5ae765e0f3753fb9e9efa Reviewed-by: Jake Petroules <jake.petroules@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Remove all usages of Q_FOREACH from the libraryChristian Kandeler2017-02-211-2/+2
| | | | | | | | This will make it easier to experiment with exchanging Qt containers for STL ones, for instance. Change-Id: Ie591fa54b5241ad4841b1ebcfb78b72932cd2b38 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Make loaded extensions available in JavaScript commandsJoerg Bornemann2017-01-191-1/+22
| | | | | | | | | | | | | | When JS commands are created in a function that's defined in a separate JS file then loaded extensions of this file were not visible within the JS command's source code. Determine the current import scope name at the location of the JavaScriptCommand's constructor and pass it to the JsCommandExecutor where it is pushed to the current context. Task-number: QBS-1093 Change-Id: I471e277c6821f38af6f2a06fc34005cf3c296f6c Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Give the two copies command.{cpp,h} non-ambiguous namesJake Petroules2017-01-051-0/+440
The pair in tools/buildgraph becomes rulecommands.{cpp,h} The pair in parser becomes parsercommand.{cpp,h} This resolves a conflict which prevented compilation of the entire set of qbs sources with MSVC and the /Fo option. Change-Id: Ic909d02a230d8e59f3bf4d00fc895bf54739961a Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>