aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/corelib/buildgraph
Commit message (Collapse)AuthorAgeFilesLines
* qt6: Do not use QVariant::Type as it was deprecatedIvan Komissarov2021-02-111-1/+1
| | | | | Change-Id: I0dad1ee403176a665e4e9dead2f94dd032e1d75b Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* qt6: Do not use QVariant::type()Ivan Komissarov2021-02-112-2/+2
| | | | | | | | | ...and use QVariant::userType() instead since type() method was deprecated (variant.metaType().id() or variant.typeId() or variant.userType() should be user instead). Change-Id: I00b93c5e010a0c7b733b3c6dfeae2d744be32ce1 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* buildgraph: fix storing container sizesIvan Komissarov2021-02-101-1/+1
| | | | | | | | The type should match the one used in load() since in qt6 the type is not int anymore Change-Id: I0e7e402dec6f059279de933d5afd0c450cde8ddd Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* qt6: explicitly register Transformer * and JavaScriptCommand * metatypesIvan Komissarov2021-02-101-0/+3
| | | | | | | Otherwise, Qt complains when emitting the signal Change-Id: I1840eff8c041ca21475658cb3113e81298b3a8a6 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* qt6: replace some QStringRefs with QStringViewsIvan Komissarov2020-11-091-2/+2
| | | | | | | | | QStringRef does not exist anymore. Qml parser is not ported yet. Change-Id: Ifb99a529b69c0085363031e852ffd7576f1d93be Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Get rid of goto in InputArtifactScanner::resolveScanResultDependenciesIvan Komissarov2020-10-261-10/+17
| | | | | Change-Id: I9220b1e6344e90401abf4fb91115e77a3a6c996f Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Use make_shared in InputArtifactScanner::scannersForArtifactIvan Komissarov2020-10-261-4/+3
| | | | | Change-Id: Ia38f08fb32b50761e7fb8642019aad39a25c1ef2 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* c++17: fix TypeFilter::const_iteratorIvan Komissarov2020-08-211-1/+7
| | | | | | | | MSVC complains about inheriting from std::iterator and suggests declaring typedefs manually Change-Id: I19cf1d9efd86fccb53827235d3659ef571d4f8b5 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* qt6: explicitly specify template paramer for std::minIvan Komissarov2020-08-031-2/+2
| | | | | | | | It qt6, containers use qsizetype for the size instead of int, so compiler cannot deduce the correct type. Change-Id: Ifcade8926679389389f52610aed0d4561aa1287b Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Fix Qt 5.15 deprecation warningsChristian Kandeler2020-06-162-3/+4
| | | | | Change-Id: I1d6968de823c43e42ca53eb68972ba5e69dc29ed Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
* Fix '-Wclazy-range-loop' warningsIvan Komissarov2020-06-081-1/+1
| | | | | | | The warning says 'c++11 range-loop might detach Qt container' Change-Id: I6b6a91d6b3298702246da94f05d21623d5f13faa Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* clang-tidy: Fix 'cppcoreguidelines-pro-type-member-init' warningsIvan Komissarov2020-04-272-12/+6
| | | | | | | | | | | Also, fix undefined behavior when setting and reading different field of a union (Lexer, Token) - according to the C++ Standard, it is not allowed to use a union to zero members of a struct. Treat these warnings as errors now. Change-Id: I0f6d071217ef55e2c75c51138fcff47048eca62f Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* clang-tidy: Fix 'bugprone-narrowing-conversions' warningsIvan Komissarov2020-04-142-2/+2
| | | | | | | Also, treat those as errors Change-Id: I0771aa656273fd0a01c7787870d9de9b4c631823 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* clang-tidy: Fix 'google-readability-namespace-comments' warningsIvan Komissarov2020-04-071-1/+1
| | | | | | | Also, treat those as errors Change-Id: I33e5adef456b2c3445e00297d48770d99781aedd Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Rule execution: Fix potential infinite loopChristian Kandeler2020-03-051-0/+2
| | | | | | | | | | | | | | | | | | Dependency scanning can generate inverse dependencies. For instance, a Qt C++ file "myobject.cpp" containing the Q_OBJECT macro will typically include a file "myobject.moc", which is generated from the cpp file. When scanning the inputs of "myobject.moc", the artifact will encounter itself as a scan dependency. There is code that prevents a dependency cycle in this case. Let's now consider the case where such a rule has a second output artifact: When scanning the inputs of that artifact, we will encounter the first artifact as a scan dependency. This case was not handled, leading to an infinite loop in rule execution. We fix this by rejecting scan dependencies that have the same transformer as the artifact whose inputs are being scanned. Change-Id: I767ceaad387c2e315738070e01ef9322764afb65 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Artifact Scanning: Prefer scan results from product dependenciesChristian Kandeler2020-03-031-2/+14
| | | | | | | | | | | | | | | | If scanning finds an artifact in more than one product, we so far randomly used one of them. We now prefer artifacts from product dependencies, because the other ones might get lost during change tracking, as we don't keep an "is scan result of" type of information in our RescuableArtifactData. This should fix the linked bug in the vast majority of actual projects. It's also conceptually the right thing to do, because the artifact in the product dependency is much more likely to be the one that was intended to be found. Task-number: QBS-1532 Change-Id: Idd8662bb00570bc57f5861ce83517f0adb845b49 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Apply 'modernize-pass-by-value' fix-itIvan Komissarov2020-01-283-7/+10
| | | | | | | | | Also, treat this warning as error This amends 936eee744db9b2fd1b9b66d168d80a113002aad2 Change-Id: I372c3b11baa08375d581052282f4546b2ba2e057 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* MSVC: Use compiler driver for linkingIvan Komissarov2020-01-243-5/+15
| | | | | | | | | | | | | | | To be able to use cpp.driverFlags and cpp.driverLinkerFlags with clang- cl. This patchset makes possible to use clang-cl with "- fsanitize=address" flag without passing the sanitizer libraries manually to the linker There's also a behavior change in which linker is used - clang-cl uses native linker by default. Old behavior can be restored by setting cpp.linkerVariant to "lld" Fixes: QBS-1522 Change-Id: I9528ce40aa5fdfab987672b15fffd830fa2d6376 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Use RAII for memory management of jobsIvan Komissarov2020-01-103-8/+7
| | | | | | | | | QMap::keys() method allocates memory for a new list which is not desired during the object destruction. Also simplifies dtor and make code more exception-safe Change-Id: Ib76c2426e74ca79e2ab56b993007985ba8999c85 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Fix 'performance-unnecessary-value-param' warningsIvan Komissarov2020-01-074-5/+5
| | | | | | | | | | Use more pass-by-const-ref since there is no point in passing objects by value in these cases Also, treat this warning as error Change-Id: I5382dcd56639f535cf240205cc5c3ac667c4ece3 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Replace std::vector<ResolvedProductPtr> with QVectorIvan Komissarov2020-01-064-12/+12
| | | | | | | | | | std::vector was copied way too much, it's better to use copy-on-write here This amends de2fea7734 Change-Id: I51afddc88ec6862a1a623b0c9a69c810e9e15a55 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Use QList::reserve() in Executor::addExecutorJobsIvan Komissarov2020-01-061-3/+4
| | | | | Change-Id: I6680a2a3ea711b8a7fa01fc1edb8ce1040f603b3 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Replace QList<Internal::ResolvedProductPtr> with QVectorIvan Komissarov2020-01-066-6/+6
| | | | | | | | QList is inefficient with shared_ptr and results in an extra allocation per each element Change-Id: I5d5492d855a233e8aec3f09a67dd4b83fb0d2c13 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Fix 'modernize-make-shared' clang-tidy warningIvan Komissarov2020-01-061-2/+1
| | | | | | | | Also, treat it as error now Change-Id: I4d8499ffa47ec43c2c3bf46deb073f28942d3853 Reviewed-by: Richard Weickelt <richard@weickelt.de> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Avoid an unnecessary copy operationRichard Weickelt2019-12-1911-29/+29
| | | | | | | | | Clang-tidy warns about an unnecessary copy being made because the container is std::vector<SomePtr>, but the loop variable is SomeConstPtr&. Change-Id: I4cc640334fca4a2e58ee8ed8cebc2a3bca13f15b Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Merge branch '1.15' into masterRichard Weickelt2019-12-152-6/+7
|\ | | | | | | Change-Id: I893a0c195de293fead09db63b7fcdf48bbfab61c
| * Remove pass-by-value from RulesApplicatorIvan Komissarov2019-11-252-6/+7
| | | | | | | | | | | | | | | | | | References were assigned to a temporary object This amends 936eee744 Change-Id: I1d2b6c00cd75ddb4759017490fd63ab123be4825 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Fix 'modernize-use-emplace' warningsIvan Komissarov2019-12-024-6/+6
| | | | | | | | | | | | | | | | | | | | std::vector::emplace_back creates an object in a vector and allows to avoid creating temporary object that is than moved into a vector. This simplifies code a bit as it is not necessary to call std::make_pair or use uniform initialization to create a temporary object Change-Id: I0c5500a818f78d07bc753e25f529c06762cb615c Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Apply 'modernize-make-unique' fix-itIvan Komissarov2019-11-282-3/+6
| | | | | | | | | | Change-Id: I93783cfa3267f69237b0ad888d0747e4272cda0a Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Apply 'modernize-use-equals-default' fix-itIvan Komissarov2019-11-259-38/+14
| | | | | | | | | | Change-Id: Iabdc777d2e8492d9903109365b0f3b1a5441ca11 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Fix nullpointer access and heap-use-after-free errorJochen Ulrich2019-11-161-7/+18
|/ | | | | | Task-number: QBS-1485 Change-Id: Id43e997a73ff55c3b438edb553806b61d45a8bdf Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Fix user dependency scannersChristian Kandeler2019-11-052-4/+5
| | | | | | | | | Since commit 9e55ddfa97, we mistakenly passed the output artifact to the scan script, rather than the input artifact. Fixes: QBS-1511 Change-Id: Ieb2a2b3bdf0366ef203e96d578a30a0ef8b1838a Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Merge 1.14 into masterChristian Kandeler2019-09-261-1/+1
|\ | | | | | | Change-Id: Ie432987ee2d3ccaa6e881b1b01f142185eddabd8
| * Fix MSVC warningsOrgad Shaneh2019-09-131-1/+1
| | | | | | | | | | | | | | | | 'return': conversion from 'size_t' to 'int' Change-Id: I18e8fa03a9303855693da3027b722b104cee5d6d Reviewed-by: Richard Weickelt <richard@weickelt.de> Reviewed-by: hjk <hjk@qt.io>
* | Merge 1.14 into masterChristian Kandeler2019-08-261-1/+3
|\| | | | | | | Change-Id: Ic9ee11d628ba278271517aae0af020aec28ecbf7
| * Process Command: Do not needlessly interpret output as textChristian Kandeler2019-08-261-1/+3
| | | | | | | | | | | | | | | | | | ... when redirecting process output. Only do that if there is an output filter function. Otherwise, we break redirection of binary data. Fixes: QBS-1488 Change-Id: Ic5a1d2653fa8fc9c4f0eb5d31b7315d7aba3e030 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* | Add command and AutotestRunner timeoutJochen Ulrich2019-08-018-25/+78
|/ | | | | | | Task-number: QBS-1454 Change-Id: I6e2514d10cca0cba0a14456ecd2abfb495539ee4 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Fix some warnings about null pointersIvan Komissarov2019-06-042-2/+2
| | | | | | | Some of them are false positives, some of them are possible bugs. Change-Id: Ic9c8a2970587e5152659b5b19f6b6d6df67e6809 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Merge 1.13 into masterChristian Kandeler2019-05-231-2/+2
|\ | | | | | | Change-Id: Ic8e80604deb03e48fe264271de2e0add5023af87
| * Transformer: Fix wrong variable nameOrgad Shaneh2019-05-211-2/+2
| | | | | | | | | | | | | | | | Amends commit f4f443a16a342300638d364175cf2958279cf23f. Change-Id: Ied9bd9188e719657228a53b7a7f1baca86c1bd71 Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* | Use std:: containers in ProjectBuildDataIvan Komissarov2019-05-225-25/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It appears, that destruction of complex QHashes/QLists took a bit time in refcounts. Optimize them by using std::unordered_map and std::vector instead. Plus, make structure simplier, instead of 2 hashes, use pair as a key. qbs::Internal::ProjectBuildData::~ProjectBuildData() Before: 11.00 ms 0.1% After: 6.00 ms 0.0% Change-Id: I82d8bec5a465210cfa54762088f47c606c0e48e5 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Apply modernize-loop-convert fix-itIvan Komissarov2019-05-213-26/+20
| | | | | | | | | | | | | | Makes clang-tidy happier Change-Id: Ic29b552572719ea58c7ad385cc6e1d68cef9eedc Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Apply modernize-use-auto fix-itIvan Komissarov2019-05-201-1/+1
| | | | | | | | | | | | | | | | Makes clang-tidy happier Change-Id: I75f3b6409b425b9a7054d7886ab0160a040b25d5 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Fix -Wclazy-inefficient-qlist-softIvan Komissarov2019-05-202-2/+2
| | | | | | | | | | | | | | | | | | QLists were used with types that bigger than sizeof(void*) which lead to extra allocations Change-Id: Id716c6b4919f9a0ad62e1d2972319a600785afc5 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Add missing virtual destructorsIvan Komissarov2019-05-032-0/+2
| | | | | | | | | | Change-Id: I6a20f4475b52858f79c98b5ce3dd088aac7bc46e Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Apply fix-its for the missing override keywordIvan Komissarov2019-05-036-6/+6
| | | | | | | | | | | | | | | | Missing override is a warning in clang Change-Id: I90b899df37e690aebb942bffc65db54d9aa4050f Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Fix uninitialized variablesIvan Komissarov2019-05-0210-21/+21
| | | | | | | | | | | | | | | | | | This fixes most of clang analyzer warnings about uninitialized variables in ctors Change-Id: I879c785594307ed3fe7140588338a6b2a1e4db65 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Use pass-by-value and moveIvan Komissarov2019-03-0725-60/+64
| | | | | | | | | | | | | | This fixes -Wmodernize-pass-by-value Change-Id: I85a732867866e43c39c1d77937fbc645433c96bd Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Fix calls to non-const begin()/end() in range-for loopsIvan Komissarov2019-03-067-19/+30
|/ | | | | | | | This fixes -Wclazy-range-loop Change-Id: I08a435b700017cdbe27fbfdbda6e26840d9a3568 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-2610-21/+21
| | | | | | | | | 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>