summaryrefslogtreecommitdiff
path: root/src/lib/buildgraph/buildgraphloader.cpp
Commit message (Collapse)AuthorAgeFilesLines
* introduce class BuildGraphNodedynablasterJoerg Bornemann2013-11-271-47/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To support different types of nodes in the build graph, we introduce the base class BuildGraphNode. Artifact now derives from BuildGraphNode. A - yet unused - RuleNode class is introduced that represents a rule in the build graph. Change-Id: Ie1ad5e7a9e65bfd5f99d3e824737516053de0f94 ***new artifacts hash in ProductBuildData Change-Id: I50521ec64f734bfb3662759076fa5e7912ac084e ***automoc fixup Change-Id: Ie2bb228ae38d63deccc600d67d283bc3beda9fec slightly nicer rule debug output Change-Id: I60ddef73cd7f0a67055f2d56e6dbe7fa45ddd450 create RuleNode objects and add them to roots Change-Id: I51a0f89b98cda524d34888ab758d7bd397d82f00 ***execute rule nodes on build Change-Id: I291c32868cd982e37393d6bc8d696f2b63fbff50 ***ArtifactSet::fromNodeSet Change-Id: I7586bcfbe43406c22b1ee1a1fd826beaa247164f ***update after rebase Change-Id: I5f73afc80b746b11eeb83aeadf29c2358accbab8 ***phonytarget Change-Id: I587b7e072e54b866e8d5ea37c874e6a8baa550e0 update after rebase Change-Id: I6017c0cbe9244fea04d513f53e3a2a85092bf962 skip nodes early We must skip Building and Built nodes. m_leaves can contain duplicates now. Change-Id: If275106a47c403a455103f4deeb20049548007f5 debug message Change-Id: I90e238eef72a8a02fb0a9f2c77715f5f15c1442d disable phony thingy Change-Id: I7bb60b850b96b65ab738c11e96c3a84cbe58d2f7 connect each output of a rule to the rule itself Change-Id: I159d76c4b63094058cc9a07ccc2d0b67c7ce06e6 TagScanner Change-Id: I4741e48cd674c0ca830ee1b4d05b59a8c542694f TagScanner deps Change-Id: If3e43a7ac25616cd151229684a085ac8ee787645 update after rebase Change-Id: I58d49a5ed1049a17733fc2154588f12c1cda53e6 only root tag scanners in product Change-Id: Ia94732a5632156a5ec3c5518c9596cd4cefac105 run TagScanners Change-Id: I869a183f2da23a43957a6df45dc5a1b30b10af92 TagScannerRunner Change-Id: Id3c5fac73e6fb84e56d6ab1d48a959f3677f7a67 crash fix Change-Id: Ie3c26dbed41ab4615915a08913c495868c3a8910 more TagScanRunner Change-Id: I80b79f101c0f4d802fb4f6515c0848e369fed066 handle removal of filetags Change-Id: Icdd8d05c2e26953f7b12d968aa5dfcc23928b9ba Qt4 build fix Change-Id: Ie5fcb64e36ddc5004003183bea7243536bc8ab15 do not waste space with type information Change-Id: I7b9354e6fceead228ba335723b9addeb701bef56 update nodes that must get new transformers Change-Id: I06cd7ffe606ae643393350c5959ef6475343929f update after rebase Change-Id: If080e664972f2950c12fd800a3e4b521e65dca3a only run tag scanners on changed sources And do not call RulesApplicator in bgloader. Change-Id: I5140c91c79a842dab933ad7b328100bdec13cb10 Conflicts: src/lib/buildgraph/buildgraphloader.cpp sketch of moc tagscanners impl Change-Id: I7736c2da1b1742bc3556ef660c163e6c32cbd4c9 Conflicts: share/qbs/modules/Qt/core/core.qbs MocTagScanner Change-Id: I87199e8f355b8b20cf2387f4d4190a20bddae0db fix lib.qbs Change-Id: Ibcb5bc290d3839b04828f8c9b155577634bcc9e4 moctagscanner split Change-Id: Iace5d48483c02b5d33d9ccd54ac07162bfc09d27
* API: Allow to remove files from a product.Christian Kandeler2013-11-251-29/+6
| | | | | | | Task-number: QBS-20 Change-Id: Ia8b8c4745e8e68ec219e16876fb630d02453425b Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Merge remote-tracking branch 'origin/1.1'Joerg Bornemann2013-11-221-0/+24
|\ | | | | | | | | | | | | | | | | Conflicts: src/lib/language/moduleloader.cpp src/lib/language/tst_language.cpp src/lib/language/tst_language.h Change-Id: Iaaf4e015a234cdd9f51630ad218daec1b83b2a84
| * Take the qbs.install* properties into account when change tracking.Christian Kandeler2013-11-211-0/+24
| | | | | | | | | | | | | | | | | | | | | | These are currently ignored, because we only look for properties that were requested in prepare scripts. This does not typically happen for installation parameters, but since they end up in the output artifacts, changes to them still require re-setting up the respective build data. Task-number: QBS-359 Change-Id: I571cb4c1a02ea790ddde2f244136c6a0fd6fb627 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* | Merge remote-tracking branch 'origin/1.1'Joerg Bornemann2013-11-141-7/+15
|\ \ | |/ | | | | Change-Id: I7475c4a71c15c83c59400c44ef96d73d15caea58
| * Fix bug in rescuing build data.Christian Kandeler2013-11-111-7/+13
| | | | | | | | | | | | | | | | | | | | We tried to get information about an artifact's children from the artifact itself. However, that artifact could have gotten disconnected along the way and not know anything about its children anymore. We must therefore save such information in an extra data structure. Change-Id: Id2043f97e857bf8779184e88b1425fdcf85e3f2e Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
| * Take rules into account when tracking changes.Christian Kandeler2013-11-111-0/+2
| | | | | | | | | | | | | | | | | | This will cause rebuilding if, for example, a rule in a module that the product uses gets its source code changed (and the rule is actually being used). Change-Id: I009685c85fcc8fa0ae3ecc7c32194685a1558104 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* | Rethrow exceptionTobias Hunger2013-11-131-1/+1
|/ | | | | | | ... instead of throwing a copy Change-Id: Ic4a5701d72158d3ef67106493b22d528c890654a Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* Take dependencies into account when tracking changes.Christian Kandeler2013-10-221-0/+15
| | | | | | | They are currently ignored. Change-Id: I94b89f9b7c6838106670d553429b297823ac861f Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Tell users which build graph we are talking about...Christian Kandeler2013-10-111-3/+4
| | | | | | | | ... when complaining about a project file mismatch. Task-number: QBS-382 Change-Id: I25ad56acace014fb03bb7eb55433823ba14d8978 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Do some build graph sanity checks.Christian Kandeler2013-09-301-1/+2
| | | | | | | Check some invariants after resolving, restoring and change tracking. Change-Id: I84e92d6f16a96d4a54c928e8cebc06efbf8fde2c Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Fix handling of disabled products when restoring.Christian Kandeler2013-09-201-4/+16
| | | | | | | | | If build data already exists (i.e. the product was not disabled before), we must not swap it over to the new product, and we need to remove all the artifacts from the build graph. Change-Id: I210f8da72a7252905a6c92f3db6b2a907922f7b0 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Fix a number of bugs uncovered by a recent leak fix (ff5b33b82b).Christian Kandeler2013-09-111-43/+50
| | | | | | | | | | | | | | | To name just a few: - Product removal, adaptation and re-resolving/swapping build data was done in the wrong order, resulting in outdated information still being present and necessary new one not being there yet. - Outdated artifacts were deleted too early, so that look-ups into the old project build data would cause undefined behavior. - The list of products whose file list was changed could contain the same entry twice, causing asserts when the same code was run again for the same product. Change-Id: I0c318fb18d5a8293d863ea6802203200941b9b7b Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Remove redundant method parameter.Christian Kandeler2013-09-091-4/+2
| | | | | | | Presumably the author thought the function was static. Change-Id: I5637493c6694edb15349d6189b098990471585be Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Fix artifact leaks in build graph loader and automoc.Christian Kandeler2013-09-091-1/+1
| | | | | Change-Id: I989d88c58586ab9b6fe9f7870432f7266a00b9cc Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Fix crash on restoring.Christian Kandeler2013-08-301-0/+2
| | | | | | | Do not apply rules to disabled products. Change-Id: Ib9b32420ecefdc76e86c80ce2f4d1cb6ad44d4b4 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* fix tracking of added file tagsJoerg Bornemann2013-08-261-1/+3
| | | | | | | | An added file tag was used to apply rules but it was not stored in the artifact. Change-Id: I0d4ce6b7b1372310fb1825bb2e2c47181e293079 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* Fix change tracking for properties requested from prepare scripts.Christian Kandeler2013-08-231-25/+66
| | | | | | | | | | | | | | When evaluating prepare scripts, we currently gather values requested from products as well as artifacts, but we do not differentiate between the two cases and upon restoring, we always compare the old property values to the product properties. This results in an insane amount of recompiling if any build system file changes due to false positives. With this patch, we record whether a property was requested from a product or an artifact, and use the right set of properties when tracking changes. Change-Id: Ib1fa4fad41019cfa7d3a10e0a91e7709c2f56414 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Even better handling of property changes when restoring a build graph.Christian Kandeler2013-08-191-20/+18
| | | | | | | | | | | | | | | | | | | | | | | In detail: - Fix the build config comparison function so that it not only checks whether keys present in both maps are the same, but also whether there are additional keys in one of the maps. - Do not abort loading a restored build graph when the comparison fails; instead, handle that condition the same way we handle changes in build system files, environment variables etc; that is, re-resolve the project and check whether the build data needs to be set up from scratch for any products. - Take overridden properties into account when comparing the old and new property maps. This has no effect on the command line client at the moment, because it does its own merging, but other API clients will benefit. A particularly nice "side effect" of this patch is that changing properties on the command line now works as expected with regards to change tracking. Task-number: QBS-374 Change-Id: I55583fb7a2ae78b80de225b09aa559229d851339 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Fix build error with Qt 4.Christian Kandeler2013-08-141-2/+4
| | | | | | | QSharedPointer::reset() is new in Qt 5. Change-Id: I6314aed42706b59b19fcc15f8d623f15cc942029 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Better handling of property changes when restoring a build graph.Christian Kandeler2013-08-141-24/+102
| | | | | | | | | | | | If a property change is discovered in any given product, the current code throws away the whole build graph, generates a new one and then re- inserts selected data from the old one. With this patch, we only regenerate the build data of the affected product (and still re-insert some existing data into it as to not rebuild artifacts that are up to date). Change-Id: I49e475c66dfb84ad20253ab53daf25acfe5a738b Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Handle changes in transformers when re-using a stored build graph.Christian Kandeler2013-08-141-18/+51
| | | | | | | | Also fixes a bug when comparing file lists in products and sets up the infrastructure for additional checks. Change-Id: I65b15620e12651ed845a102eb5bfe98f9be458a9 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Treat a product file the same way as other build system files...Christian Kandeler2013-08-141-4/+1
| | | | | | | | | | ... when doing change tracking after restoring a build graph. Changes in one product can influence properties in other products via the surrounding project. Change-Id: I4294b326280e676939de9533309fdfa9146f9e92 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* remove Artifact::topLevelProjectJoerg Bornemann2013-08-021-8/+5
| | | | | | | | Every artifact has a product now. That product points to its top level project. Artifact::topLevelProject can go. Change-Id: I7a7ec921043b64eec6c704128ae465fd9ef05031 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* move file dependencies to dedicated classJoerg Bornemann2013-08-011-18/+19
| | | | | | | | | File dependencies are a very simple variant of artifact. We save space and structure the code more clearly by introducing the FileDependency class. Change-Id: I36b95794f9d6d3d739ea4836ebc831848a89de98 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* Use previous results of calls to "File.exists()" in change tracking.Christian Kandeler2013-07-161-1/+16
| | | | | | | | This is the same kind of "external change" as those coming from the environment or JavaScript files, and is thus handled the same way. Change-Id: I0a097d6d5c39ece859e6784f65f77f35a7273d59 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Handle "indirect" changes to a product's file list.Christian Kandeler2013-07-161-31/+35
| | | | | | | | | | If the list of source files in a product changed without the respective file having been touched (e.g. because the list was dependent on an environment variable), we re-resolved the product, but we did not touch the build data, so the new file was not compiled. Change-Id: Ib63020339aa0bbc2a858ed22f938ab76fb0611c5 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Refactor BuildGraphLoader::trackProjectChanges().Christian Kandeler2013-07-161-73/+92
| | | | | | | | | | It's becoming hard to keep an overview of which checks are being done to find out whether we need to re-resolve, so introduce one function per check. In addition, skip checks if we already know we need to re-resolve. Change-Id: I6abeb41c6089e7fb7a0bfa2e69361ab8e58f477f Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Make sure no remains of removed products stay in the build graph.Christian Kandeler2013-07-111-6/+5
| | | | | | | | Namely, artifacts in transformer inputs of (former) parents. Task-number: QBS-358 Change-Id: I19e6cf6cd50e4d99c49e2e570daf163da25a3a79 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Make the Loader print progress information also in BuildGraphLoader.Christian Kandeler2013-07-031-0/+1
| | | | | | | | | Otherwise, a certain amount of time passes without any progress information in the case that a project needs to be re-resolved after restoring. Change-Id: I15e4e8cdece43a93c6be028c621aba844be5e01c Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Improve handling of changes to restored build graph.Christian Kandeler2013-06-241-90/+58
| | | | | | | | | Instead of painstakingly inserting new product pointers into an existing build graph, do it the other way around and put existing build data into the newly resolved project. This is much more robust. Change-Id: If38e4a5e14c6a5faedb0c590e86aa5efc7844e39 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Store list of files that are part of the projectTobias Hunger2013-06-201-7/+31
| | | | | | | | | | | Store a list of all files that are referenced when resolving the project as part of the project. This list is then processed to check whether the project needs to be re-resolved. Change-Id: Iccb8928a5349546c22a9615256a505bebf5de567 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Move BuildGraphLoader into its own set of files.Christian Kandeler2013-06-191-0/+550
Change-Id: Icd11a83337a34d3544bfd59c1ab93c9d2ccb4dea Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>