aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/corelib/corelib.qbs
Commit message (Collapse)AuthorAgeFilesLines
* Add Rust-like MutexIvan Komissarov2023-11-091-0/+1
| | | | | | | | | | | | | This change implements a Rust-like Mutex class that prevents unlocked access to the underlying data. As seen recently, it is easy to make a mistake and lock the wrong mutex. Also, this prevents micro-optimizations where shared state is accessed without locking corresponding mutex in hope that there is some other barrier. Change-Id: I52c7a2fa68cc97be07a490c35aa76fe717032fdf Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Loader: Split up ProductsHandlerChristian Kandeler2023-07-111-2/+4
| | | | | | | | | | We now have two non-persistent classes for resolving a single product (one for each stage), and another module that contains the scheduling logic. The latter will become responsible for thread management in the future. Change-Id: I1ae7aa8c4dc165628fbc6561f8e9a29ec5cb87bb Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
* Loader: Merge the remains of ProjectTreeBuilder into ProjectResolverChristian Kandeler2023-05-311-2/+0
| | | | | | | | This will enable us to get rid of redundant data structures and the two- phase product handling. Change-Id: I8a9f5e06b216f7b8cd8842acfbcf77edc30fadb4 Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
* Loader: Move product handling into its own classChristian Kandeler2023-05-251-0/+2
| | | | | | | And split up the large handleProduct() function into sensible chunks. Change-Id: I39d086547087729d6db4980f4b0a2d991a584646 Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
* Loader: Move product collection into its own classChristian Kandeler2023-05-231-0/+2
| | | | | Change-Id: I249bc3d77ff007517aa352e333585fd8ec5f7ef0 Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
* Loader: Refactor dependency resolvingChristian Kandeler2023-05-191-0/+4
| | | | | | | | | | | | Namely: - Move code into its own class. - Split up the larger functions into sensible chunks. - Add more documentation. - Introduce loaderutils.{h,cpp} for shared functions and data structures. Change-Id: Ib41bdd1a7c087b2757f6363a3c58e87022b4f00b Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
* Implement Pimpl class using std::unique_ptrIvan Komissarov2023-05-101-0/+2
| | | | | | | | | | | | | | | | | | | | ... and propagate_const from KDAB tools. The propagate_const class fixes the issue that d-pointer in const-methods is not const. Such Pimpl class has several advantages over the raw pointer. - the d-tor is trivial and removes the burden for the author/reviewer to remember to check if pointer is deleted correctly. - constness is now propageted correctly to the d-pointer in const methods. - makes the intention clear that we're using the PIMPL idiom Change-Id: Ibc42cdaeb6d3303fea81ac6edd63bea0da2ac08d Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Remove Loader classChristian Kandeler2023-05-091-2/+0
| | | | | | | It was just an unnecessary indirection in the end. Change-Id: I956ed4858dcc2b528be1e1fce9ab24862b99ff62 Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
* Introduce loader/ subdirectoryChristian Kandeler2023-05-041-32/+38
| | | | | | | | Project loading functionality is implemented in various source files these days, so it makes sense to group them together. Change-Id: Iba42b0246c40610d2a03bf6cc7ed7d3bec9d5536 Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
* Fix build for configuration that enables tests, but disables unit testsChristian Kandeler2023-04-241-8/+13
| | | | | | | | | It's probably not worth adding an extra export macro for that, so just enable QBS_AUTOTEST_EXPORT if any tests are enabled. Amends b3509323a4552eb1c4a43218cb715904400d0d62. Change-Id: I3573ae59de98f192d6ae3630b973857f911b3eaa Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
* Rewrite ModuleLoaderChristian Kandeler2023-04-201-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | =================== Problem description =================== The ModuleLoader class as it exists before this patch has a number of serious problems: - It instantiates modules over and over again everywhere a Depends item appears. The different instances are later merged in a hopelessly obscure and error-prone way. - It seriously pollutes the module scopes so that sloppily written project files appear to work even though they shouldn't. - Dependencies between products are handled twice: Once using the normal module instantiation code (with the Export item acting like a Module item), and also with a parallel mechanism that does strange, seemingly redundant things especially regarding transitive dependencies, which appear to introduce enormous run-time overhead. It is also split up between ModuleLoader and ProjectResolver, adding even more confusion. - The code is messy, seriously under-documented and hardly understood even by its original authors. It presents a huge obstacle to potential contributors. ================= Patch description ================= - Each module is instantiated once per product. Property values are merged on the fly. Special handling for dependencies between products are kept to the absolutely required minimum. - There are no more extra passes for establishing inter-product dependencies. Instead, whenever an unhandled dependency is encountered, processing the current product is paused and resumed once the dependency is ready, with the product state getting saved and restored in between so no work is done twice. - The ModuleLoader class now really only locates and loads modules. The new main class is called ProjectTreeBuilder, and we have split off small, self-contained pieces wherever possible. This process will be continued in follow-up patches (see next section). ======= Outlook ======= The ProjectTreeBuilder ist still too large and should be split up further into small, easily digestible parts with clear responsibilities, until the top-level code becomes tidy and self-documenting. In the end, it can probably be merged with ProjectResolver and Loader. However, this first requires the tight coupling between ProjectTreeBuilder/ModuleProviderLoader/ProbesResolver/ProjectResolver to be broken; otherwise we can't produce clean interfaces. As this would involve touching a lot of otherwise unrelated code, it is out of scope for this patch. ================= Benchmarking data ================= We first present wall-time clock results gathered by running "qbs resolve --log-time" for qbs itself and Qt Creator on macOS and Windows. The numbers are the average of several runs, with outliers removed. Then the same for a simple QML project using a static Qt on Linux (this case is special because our current way of handling plugins causes a huge amount of modules to be loaded). Finally, we show the output of the qbs_benchmarker tool for resolving qbs and Qt Creator on Linux. The data shows a speed-up that is hardly noticeable for simple projects, but increases sharply with project complexity. This suggests that our new way of resolving does not suffer anymore from the non-linear slowdown when the number of dependencies gets large. Resolving qbs on Windows: Before this patch: ModuleLoader 3.6s, ProjectResolver 870ms With this patch: ProjectTreeBuilder 3.6s, ProjectResolver 840ms Resolving Qt Creator on Windows: Before this patch: ModuleLoader 17s, ProjectResolver 6.8s With this patch: ProjectTreeBuilder 10.0s, ProjectResolver 6.5s Resolving qbs on macOS: Before this patch: ModuleLoader 4.0s, ProjectResolver 2.3s With this patch: ProjectTreeBuilder 4.0s, ProjectResolver 2.3s Resolving Qt Creator on macOS: Before this patch: ModuleLoader 32.0s, ProjectResolver 15.6s With this patch: ProjectTreeBuilder 23.0s, ProjectResolver 15.3s Note that the above numbers are for an initial resolve, so they include the time for running Probes. The speed-up for re-resolving (with cached Probes) is even higher, in particular on macOS, where Probes take excessively long. Resolving with static Qt on Linux (QBS-1521): Before this patch: ModuleLoader 36s, ProjectResolver 18s With this patch: ProjectTreeBuilder 1.5s, ProjectResolver 14s Output of qbs_benchmarker for resolving qbs on Linux: Old instruction count: 10029744668 New instruction count: 9079802661 Relative change: -10 % Old peak memory usage: 69881840 Bytes New peak memory usage: 82434624 Bytes Relative change: +17 % Output of qbs_benchmarker for resolving Qt Creator on Linux: Old instruction count: 87364681688 New instruction count: 53634332869 Relative change: -39 % Old peak memory usage: 578458840 Bytes New peak memory usage: 567271960 Bytes Relative change: -2 % I don't know where the increased memory footprint for a small project comes from, but since it goes away for larger projects, it doesn't seem worth investigating. Fixes: QBS-1037 Task-number: QBS-1521 Change-Id: Ieeebce8a7ff68cdffc15d645e2342ece2426fa94 Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Switch JavaScript back-endChristian Kandeler2023-02-071-19/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Newer clang versions seem to expose serious bugs in QtScript, whose complexity makes it difficult to track them down. We therefore switch to the more light-weight QuickJS, which offers all the features we need (most notably property access interception), as well as good performance. To save some porting effort, we removed the long-deprecated loadFile() and loadExtension() functions. During the porting procedure, we noticed and fixed thread safety issues in artifact access from JS commands. We consider this change important enough to bump the major version, so the next release will be 2.0. Detailed benchmarking data is below. In summary, we see a modest speed- up at the cost of a similarly modest increase in memory consumption (with the exception of project resolving on macOS, which has become a bit slower). Importantly, the increase does not rise with project size, as the comparison of qbs vs Qt Creator shows. Output of qbs_benchmarker on Linux with qbs as test project: ========== Performance data for Resolving ========== Old instruction count: 12870602895 New instruction count: 11923459780 Relative change: -8 % Old peak memory usage: 61775848 Bytes New peak memory usage: 67583424 Bytes Relative change: +9 % ========== Performance data for Rule Execution ========== Old instruction count: 4074062223 New instruction count: 3887473574 Relative change: -5 % Old peak memory usage: 35123704 Bytes New peak memory usage: 38398392 Bytes Relative change: +9 % ========== Performance data for Null Build ========== Old instruction count: 1104417596 New instruction count: 1011033948 Relative change: -9 % Old peak memory usage: 24461824 Bytes New peak memory usage: 25325920 Bytes Relative change: +3 % Output of qbs_benchmarker on Linux with Qt Creator as test project: ========== Performance data for Resolving ========== Old instruction count: 67166450352 New instruction count: 60772791018 Relative change: -10 % Old peak memory usage: 327011616 Bytes New peak memory usage: 343724176 Bytes Relative change: +5 % ========== Performance data for Rule Execution ========== Old instruction count: 71684351183 New instruction count: 67051936965 Relative change: -7 % Old peak memory usage: 374913688 Bytes New peak memory usage: 387790992 Bytes Relative change: +3 % ========== Performance data for Null Build ========== Old instruction count: 8383156078 New instruction count: 7930705668 Relative change: -6 % Old peak memory usage: 180468360 Bytes New peak memory usage: 182490384 Bytes Relative change: +1 % Real-world data building Qt Creator (using qbs --log-time, several runs, removing outliers): macOS: Resolving: 43s -> 47s Rule execution: 17s -> 14s Windows: Resolving: 18s -> 16s Rule execution: 22s -> 17s Fixes: QBS-913 Fixes: QBS-1103 Fixes: QBS-1126 Fixes: QBS-1227 Fixes: QBS-1684 Change-Id: Ie5088155026e85bbd1e303f1c67addb15810a3cb Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* RIP QMake buildIvan Komissarov2022-12-161-9/+0
| | | | | | | | | | We have been supported CMake build for quite some time so users should have plenty of time to adapt. Ubuntu, Brew and macports also use CMake for building QBS. Change-Id: Ib78177f4a7ca8cdea1a2f3a8eac8bfe804674f32 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Make handling of deprecated items and properties configurableChristian Kandeler2022-10-041-0/+2
| | | | | | | | | | | | | | | | | | | As of now, a newly deprecated property leads to users getting bombarded with warnings, even though they did not yet have a chance to adapt their project. Now the warnings appear by default one minor version before removal, which together with our convention of keeping deprecated properties for at least two minor versions gives users enough time to adapt without getting spammed. There is also a mode for switching to the previous behavior (for early detection), as well as the possibility to trigger errors instead of warnings, which should be helpful in CI configurations. To support the case where the user cannot do anything about them, the warnings can also be suppressed altogether. Change-Id: I295f816758f0f111fcb0351581a4328be3af5668 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
* Create Host service and update FileInfoRaphael Cotty2022-02-011-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In order to use PathProbe and BinaryProbe in module providers, the qbs properties used in the probes will be replaced by the Host and the FileInfo services. The new Host service implements these host related properties: architecture, os, platform, osVersion, osBuildVersion, osVersionParts, osVersionMajor, osVersionMinor, osVersionPatch, nullDevice The FileInfo service implements these properties: pathSeparator, pathListSeparator Task-number: QBS-1612 Change-Id: Icecde3d82a531a5b143ce150ffd544ee674e6f4d Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
* Factorize out probe code from module loaderRaphael Cotty2022-01-221-0/+2
| | | | | Change-Id: I349589aa5d92f221e43c61722e53a80d59f183b0 Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
* Fix size_t -> uint conversion warnings with Qt 6Orgad Shaneh2021-11-081-0/+1
| | | | | | | | | | Example: codelocation.h(88): warning C4267: 'return': conversion from 'size_t' to 'uint', possible loss of data Change-Id: I06fa98d1e6d8eec85720bd6c5150a505ea98bdd1 Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
* Long live qbs-pkgconfig!Ivan Komissarov2021-09-231-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patchset introduce a static library for parsing .pc files. Code is based on the original pkg-config source code https:// gitlab.freedesktop.org/pkg-config/pkg-config and is written in pure C++ (except for the places where we need access to filesystem as std::filesystem is not available for all platforms - in that case, Qt classes are used) Parsing .pc files manually allows to have more control over dependencies between modules, e.g. to generate a standalone module per one .pc file and merge properties using Qbs itself, not via pkg-config. Library is almost feature-complete and all tests copied from pkg-config pass. Some functionality is omitted (e.g. prefix variables (what is this?) or validating dependencies since Qbs does this as well) Bechmark shows that parsing ~100 files takes about 10-15ms. Running pkg-config on the same set of files takes ~4 seconds: RESULT : TestPkgConfig::benchSystem(): 14 msecs per iteration (total: 57, iterations: 4) Fixes: QBS-1615 Change-Id: I5bfdfa588aa04d9d69fd738dd2beea14174c0242 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Remove `import qbs` from all project filesDenis Shienkov2021-08-041-1/+0
| | | | | | | | | | | | | | ... because we don't need in this inclusion at all. But for some cases it is impossible to remove that inclusions (and even to move on next lines) because then the some tests are failed by unknown reason. For those tests were added the following comments on the inclusion lines: `// FIXME: Don't remove this import because then the test fails!` Change-Id: I9153fd0e38b94af08168e499ee46a23889ee4d73 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Always build with project file updates supportIvan Komissarov2021-07-271-9/+1
| | | | | | | | Since QtGui dependency was removed, there is no reason not to Change-Id: Ib8975451f3c36a77e22a077bba18b5659f414767 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Move module providers code to the separate classIvan Komissarov2021-05-191-0/+2
| | | | | | | | | | | | | ModuleLoader is too big and more logic will be added to module providers, so it make sense to extract some code to a separate class. Unfortunately, it is hard to break the dependency between types completely - it is tempting to pass ModuleLoader::ProductContext into new class functions. Alternative would be to pass all necessary data via function parameters which will make the code less readable. Change-Id: Ida61192348ef7db89b21f0d58f05e61969e2d01c Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Replace "product" variable by "exportingProduct" in Export itemsRaphael Cotty2021-05-071-1/+1
| | | | | | | | | | | | "product" variable in an Export item will point to the "importingProduct" in 1.21. This patch prepares the change by replacing "product" by "importingProduct" when necessary. Task-number: QBS-1576 Change-Id: I215d46484754e76771039a750dc4beb33d8a0c9c Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Remove QTextCursor API from ChangeSetIvan Komissarov2021-03-171-1/+0
| | | | | | | | | | | It appears that neither Qbs not QtCreator use that API. Also, remove QtGui dependency in corelib and enable project files updates by default. Change-Id: I2eb90d0a7bc74bca4f1007eb63164111f52adb1b Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* qt6: depend on the "core5compat" moduleIvan Komissarov2020-11-091-0/+4
| | | | | Change-Id: I312357b074630210c17c982396660d6fb3569e49 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Re-create QML parser from grammar fileRichard Weickelt2020-11-011-0/+1
| | | | | | | | | | | | | | | This has not been done for years. In the meantime the generated code has been modified without backporting the changes to the grammar file. In preparation of potential future updates of the QML grammar, we need to make sure that we can reproduce the parser files and minimize manual post-processing. Small manual changes to qmljsgrammar_p/.cpp (license and namespace) are still necessary because unlike for qmljsparser_p.h, the template is hard-coded in qlalr. Change-Id: Ie920d4c0ca319a7d07bb83b0f3944531a4d7b7fa Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
* Initial CMake portIvan Komissarov2020-08-171-1/+4
| | | | | | | | | | | | | | | | | | | This change allows to build Qbs using CMake build tool Tested platforms - Linux (gcc) - macOS (clang) - Windows (msvc2017) Missing features (compared to Qbs build) - Documentation build - Bundled QtScript support - Static build - .pc file for qbscore - qbs module for qbscore Change-Id: I09b5dadd6723d5a47e5ef2a9a38d3300488718f2 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Autodetect clang-cl by using ProbeIvan Komissarov2020-02-171-0/+2
| | | | | | | | This allows to build projects without calling "qbs setup-toolchains" first by simply calling "qbs build qbs.toolchainType:clang-cl" Change-Id: I86d135ddf2cb588f322709e4e7a265cb6fd7772f Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Bundle Qt libraries on all platformsRichard Weickelt2019-10-101-1/+0
| | | | | | | | | | | | | | | | | | | | This patch allows us to deploy a self-containing Qbs package on all host platforms that are supported by the official Qt binary packages. Although not all (Linux) distributions make use of it, this will be helpful to - provide at least some binary convenience packages for the most important distributions, - perform building and testing in different environments, for instance build Qbs in one stage and then run autotests for desktop, iOS, android in parallel on multiple machines, - avoid windeployqt which does not work when cross-building for Windows on a Linux hosts. Change-Id: I63de4ea2240b37d8bd465cbbf4ddff3d01eeac7e Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Fix static buildChristian Kandeler2019-10-101-1/+0
| | | | | | | | Make sure we link in the generator plugins. Fixes: QBS-1491 Change-Id: I8c48a73f972c4089cfc8c097a67e2945837e9ed4 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Introduce the session commandChristian Kandeler2019-09-181-0/+1
| | | | | | | | | | Offers a JSON-based API for interaction with other tools via stdin/ stdout. This allows for proper qbs support in IDEs that do not use Qt or even C++. Change-Id: Ib051a40b7ebe1c6e0c3147cca9bd96e7daec1fde Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* baremetal: Share common generators codeDenis Shienkov2019-07-311-0/+17
| | | | | | | | | | | Common code which are used for the 'iarew' and 'keiluv' generators was moved to the corelib/generators library. Besides, this code also can be used in future for the XML-based generators. Change-Id: I79a21e3e078d563600d7f365785731fe9e847045 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Fix build errors when cross-building Qbs with MinGW on LinuxRichard Weickelt2019-05-241-1/+1
| | | | | | | | | | Linux file systems are case-sensitive while Windows file systems are usually not. That results in build errors when includes or libraries are incorrectly cased. Such errors wouldn't be noticed on Windows, but only when cross-building Qbs with MinGW on Linux. Change-Id: I3a340f907deaaf75b91369330d35918d70de56ca Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Introduce module providersChristian Kandeler2019-01-231-0/+1
| | | | | | | | | | | | | | | | | | | | | | If a dependency is not found, we now search for a matching module provider that can generate one for us. We also provide a generic fall-back provider which uses pkg-config to locate the dependency (but could be extended to incorporate other methods in the future). This is the most important part of this change for practical purposes, as it makes hundreds of popular libraries available for use in qbs projects without users having to write any boilerplate code. In a future patch, a module provider could also be used to implement the functionality of the qtprofilesetup library, relieving users of the need to create a profile for building Qt applications. [ChangeLog] The Depends item now falls back to pkg-config to locate dependencies whose names do not correspond to a qbs module. Fixes: QBS-1107 Change-Id: Ifd4f05c237cf58cd9fe707c3da648d3dbb33e82b Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Add support for job poolsChristian Kandeler2018-08-081-0/+2
| | | | | | | | | | | | | | | | | | | | | | 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>
* Install missing header fileChristian Kandeler2018-07-201-1/+1
| | | | | | Task-number: QBS-1370 Change-Id: Ib541db1c783a6b7878d1712fd735dbb4779d2d96 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Fix Windows build with QtScript-less QtJoerg Bornemann2018-06-081-1/+3
| | | | | | | | As we're building our own QtScript statically, we must override the export macros of QtScript. Change-Id: I9395e59cfcc1905b7b248b81277ec5fcfed9059f Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Add support for system-level settingsChristian Kandeler2018-06-011-0/+3
| | | | | | | | | | | | | In addition to the traditional per-user settings, there is now also a system-wide settings file affecting all users. The file's platform- specific default location can be overridden at build time. The qbs-config tool can write these settings via the new --system option. [ChangeLog] Introduced the concept of system-level qbs settings Change-Id: Ie6f675a74e96ce1fa7b2dd0712f6106071e848a6 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Merge "Merge remote-tracking branch 'origin/1.11'"Joerg Bornemann2018-05-091-1/+1
|\
| * Merge remote-tracking branch 'origin/1.11'Joerg Bornemann2018-05-091-1/+1
| |\ | | | | | | | | | Change-Id: I407596d75413e43aa61e7d1fe8591f4a0f388340
| | * qbs build: Fix core lib's Export itemChristian Kandeler2018-05-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | We overwrote the defines from QbsLibrary.qbs, breaking static builds. Task-number: QBS-1230 Change-Id: Ia146e39f6278bf21c2415008c91520399065b20d Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* | | qbs build: Add convenience properties for building staticallyChristian Kandeler2018-05-091-1/+1
|/ / | | | | | | | | | | | | | | So that we can easily test this functionality in the absence of a statically built Qt. Change-Id: I9c8f296222bc3155cb95219d4ababfd34e1e7e7b Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* | Initialize the JS extension classes explicitlyChristian Kandeler2018-05-081-1/+0
| | | | | | | | | | | | | | | | | | Otherwise, they will not be linked into the target binary when building qbscore statically. Task-number: QBS-1229 Change-Id: I5bca5146e40c55124969c6f3c02afe6e76763cf4 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* | API: Make transformer data availableChristian Kandeler2018-04-201-1/+4
| | | | | | | | | | | | | | | | | | Expose transformer information such as the input and output lists and the associated commands to interested parties. In particular, generators might have a need for that. Change-Id: I18f60e3a6fcb7792638b5786dde50e8722d7f417 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* | Make sure we can build qbs without item modelsJoerg Bornemann2018-04-191-0/+2
| | | | | | | | | | | | | | Have separate files for the Settings representation. Change-Id: I01c646652d2572d107ffc5bc2ea347ff9c058532 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Add QtScript git submoduleJoerg Bornemann2018-04-091-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds QtScript as a git submodule to build the qbsscriptengine library. QtDeclarative support has been stripped out. We don't need that. Windows CE and Symbian platform support has been removed. JIT has been disabled, which improves resolve/rule execution by 8%. [ChangeLog] Bundled QtScript as a submodule. Task-number: QBS-913 Change-Id: Idfbaf06eb2cef3985e5eae955f231686499f7754 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* | Remove most load() and store() methodsChristian Kandeler2018-02-161-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | For all serializable types whose load() and store() methods simply forward these calls to their members, the methods are removed. Instead, the serialization is now done by the persistence facility itself, which detects such classes by the presence of a member template with a fixed name (using SFINAE). If the template is present, it is called, otherwise we fall back to calling load() and store() methods. Change-Id: I42dbbdd622e0ea0db28325acc506e41c472e0f0c Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* | Track accesses to product.artifactsChristian Kandeler2018-02-161-0/+2
| | | | | | | | | | | | | | | | ... and take the data into account when deciding whether to re-run rules and commands. Change-Id: Ib0f733028617eaa91cbf902c5537f30375900646 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* | Move transformer change tracking to a dedicated set of filesChristian Kandeler2018-01-311-0/+2
| | | | | | | | | | | | | | | | We want to call it from a different context in a follow-up patch. No functional changes. Change-Id: I868a7e5eafc6e7b6cf6ac140b2199ef252d9af1f Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* | Implement change tracking for the product.dependencies arrayChristian Kandeler2018-01-291-0/+2
| | | | | | | | | | | | | | | | We added change tracking for the elements of the array in 898d09d479, but the array itself was not covered. Change-Id: I7d4083e8bf77f52e1f4a3b5da85ba13cf52fe750 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* | Re-use product, module and project script valuesChristian Kandeler2018-01-261-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These script values were set up from scratch not only for every rule, but also when creating the dependencies array. As a result, a rule traversing the dependencies of a product recursively would potentially create a huge amount of identical script values for modules appearing more than once in the dependency graph, such as the qbs module. See the benchmark data below for how the performance degraded with the size of the project. Instead, we now re-use these values, which stay valid throughout the lifetime of the script engine. For prepare scripts, that's the same as the lifetime of the executor. As a side effect, this also gives us change tracking for accesses to product and module properties via the dependencies array. These were completely unobserved before. Benchmarker result using qbs as the test project: ========== Performance data for Rule Execution ========== Old instruction count: 3265471304 New instruction count: 2733833913 Relative change: -17 % Old peak memory usage: 19023592 Bytes New peak memory usage: 19871640 Bytes Relative change: +4 % Benchmarker result using Qt Creator as the test project: ========== Performance data for Rule Execution ========== Old instruction count: 318848392341 New instruction count: 75056789023 Relative change: -77 % Old peak memory usage: 248922136 Bytes New peak memory usage: 258454408 Bytes Relative change: +3 % Change-Id: Id69062eea4dd8f9c7153599610c52bf4ea986464 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>