aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/corelib/buildgraph
Commit message (Collapse)AuthorAgeFilesLines
* do not call createOutputArtifacts for the same filePath more than onceJoerg Bornemann2014-07-312-3/+18
| | | | | | Task-number: QBS-645 Change-Id: Ia54f71ed7543617ba0b44f05e868a899a7c42e9b Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* add getter/setters for Artifact::fileTagsJoerg Bornemann2014-07-3113-42/+71
| | | | | | | | | The setters take care of keeping the product's artifact-by-filetags hash up to date. Before, one had to set up the artifact's file tags before insertArtifactToProduct was called. Otherwise the hash didn't get updated. Change-Id: Ibb530d2c992d72c0a99152009b4e6eecbf770098 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* Speed up artifact removal.Christian Kandeler2014-07-311-40/+14
| | | | | | | | | | | | The current recursive algorithm for removing an artifact from the input set of all rule nodes, while admittedly very l33t-looking, results in a quasi-infinite loop when a larger number of artifacts are to be removed. Instead, we now simply iterate over the list of nodes. A further speed-up might be possible by doing batch changes, but this one solves the immediate problem. Change-Id: Id3c19321c82d5097e58b1b312c8717c59dc06eb3 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* fix condition for "conflicting rules" errorJoerg Bornemann2014-07-311-29/+24
| | | | | Change-Id: I3877fcee643e1b80b2ee5030bc2dd98bb13244cd Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* add trace output for RuleNode::applyJoerg Bornemann2014-07-313-0/+27
| | | | | Change-Id: Icbb514d6ec2b13f2660cf86003aea0c6bbd8e132 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* Avoid contractions in user-visible messages.Christian Kandeler2014-07-312-4/+4
| | | | | Change-Id: I68685166bfaa873f1e5995c7d507afef45b03055 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* fix calculation of old inputs for dynamic rulesJoerg Bornemann2014-07-305-27/+61
| | | | | | | | | | | | | | Instead of deducing the old inputs of a rule from the inputs of its created transformers, we hold a dedicated list of old inputs, because the former approach doesn't work for dynamic rules. This fixes a speed regression introduced in 32c4d3d7. The outputArtifacts script of dynamic rules was always run on compatible inputs that were not input of transformers, e.g. C++ sources that don't have a Q_OBJECT macro. Change-Id: I2d43fa7c91ed9084bd27dc9b948c06152bfce726 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* fix Qt4 buildJoerg Bornemann2014-07-221-1/+1
| | | | | Change-Id: Icbfb31d435b804254e1df95ed188763360f7c33b Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* put the project file artifact into artifactsByFileTagJoerg Bornemann2014-07-221-0/+1
| | | | | | | | | | The qbs file artifact was missing in that particular lookup table, because the "qbs" file tag is added after insertArtifact is called. This fixes tst_blackBox::testEmbedInfoPlist on OS X. This commit amends 32c4d3d7. Change-Id: Ibab9f301ca4cc4e562b4a397953add70351403bb Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* make it possible to set module properties on artifacts in outputArtifactsJoerg Bornemann2014-07-221-0/+73
| | | | | | | | | | | | | | | | | | Example: outputArtifacts: { return [{ fileTags: "blubb", filePath: "x", cpp: { includePaths: "mydir" defines: ["BLA", "BLUBB"] } }] } Task-number: QBS-646 Change-Id: I3defa656e1a5b10fe56e4bbba7c354612144552c Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* Fix JS command canceling for the "dry run" case.Christian Kandeler2014-07-211-1/+2
| | | | | | | No JavaScript is ever run, so it cannot be canceled either. Change-Id: I322b2b1bb599273562f60028c07ac6bb09b4dd66 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Add artifact to transformer outputs earlier.Christian Kandeler2014-07-211-1/+1
| | | | | | | | | Namely, at the same time we set the transformer on the artifact. Otherwise there will be a time window where the build graph is inconsistent (and there'd probably be a memory leak as well). Change-Id: Ief5d253e672ffcd76dfceab1572a5dcfdf4cdaa3 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Fix possible assertion in Executor.Christian Kandeler2014-07-211-2/+1
| | | | | | | | We can get an exception in build() when there are already jobs running, which was not the case originally. Adapt to this. Change-Id: I6c10983f9635950d1597c2b34f1b885112f3877d Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* More error message fine-tuning.Christian Kandeler2014-07-212-1/+4
| | | | | | | | | | | - Make sure errors are not overwritten in the executor. - Do not report a process result for canceled processes. Such bogus errors currently spam the output, making it difficult to find the actual error that caused us to cancel the process in the first place. Change-Id: I76d724d084532fbce243bf180d955d6f34ac0a91 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* fix occasional crash when applying dynamic rulesJoerg Bornemann2014-07-181-2/+10
| | | | | | | | | | When creating the set of input artifacts we must not include compatible artifacts that have been created by this rule. This can e.g. happen for the ["cpp", "hpp"] to ["hpp", "cpp", "unmocable"] rule and led to occasional crashes in TestBlackbox::track_qobject_change. Change-Id: I8bf5e8285fa22c8ec89619fb7d3bec60b9797ef0 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* add assertion in RulesApplicatorJoerg Bornemann2014-07-183-6/+12
| | | | | | | | Bail out if we try to remove an input artifact of a rule while applying this rule. This indicates a serious flaw of the calling code. Change-Id: I19110ececa02e5a795474a99f5ba911e4d2c9faa Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* fix up-to-date check wrt missing file dependenciesJoerg Bornemann2014-07-181-0/+7
| | | | | | | | | Missing file dependencies (e.g. header files that are not part of the project) must trigger a rebuild their dependents. Change-Id: I502e696d886c86a503e8950ae60254075f7e9415 Task-number: QBS-631 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* invalidate artifacts if a dependency is removedJoerg Bornemann2014-07-181-1/+2
| | | | | | | | | | | Artifacts must be invalidated if a dependency is removed. Consider a foo.cpp that includes bar.h. If bar.h is removed from the project, then we must recompile foo.cpp to trigger the compile error that stems from the wrong include. Change-Id: Ifc2bc3085be553f87685a17c5ff05273daa6579c Task-number: QBS-631 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* extend debug output of the up-to-date checkJoerg Bornemann2014-07-171-4/+8
| | | | | | | | It's sometimes valuable to know which file a timestamp belongs to... Change-Id: I41e748840bb07ff9755f33769b1b97b19066871a Reviewed-by: Jake Petroules <jake.petroules@petroules.com> Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* fix calculation of added/removed artifactsJoerg Bornemann2014-07-179-125/+99
| | | | | | | | | | | We kept lists of added and removed artifacts in ProductBuildData. It was never quite clear when to invalidate those lists, which led to QBS-635. Instead we let the RuleNode decide which artifacts it considers as "added or removed for this rule". Task-number: QBS-635 Change-Id: I390e0ab775c695045c6e91ade3ac7326692cb314 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* speed up ResolvedProduct::lookupArtifactsByFileTagJoerg Bornemann2014-07-174-0/+16
| | | | | Change-Id: Id2f55d64dcbaf6c1b80009a13d48ed823ee213cd Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* Take product type changes into account when change tracking.Christian Kandeler2014-07-161-0/+6
| | | | | | | | | | This property is special: We cannot just test for relevance by checking whether it is used in any transformers, because changing it can cause new transformers to get pulled in. Task-number: QBS-650 Change-Id: If18495b47c7238fc8a1256146f4e935ce9655b18 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Speed up project re-resolving by skipping the loading from file.Christian Kandeler2014-07-162-18/+32
| | | | | | | | When re-resolving an existing project, the build graph already exists in memory and does not have to be read from disk. Change-Id: Icf5cf7396a859d4ee1c495b8cc4fa7a1ee61ff1d Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* deprecate Artifact.fileName in favor of Artifact.filePathJoerg Bornemann2014-07-162-2/+2
| | | | | | | | This property is actually a file path, not a mere name. Task-number: QBS-579 Change-Id: I04e8f03eac97b5f86fe743a4923888a3d2a82c5d Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Refactor BuildGraphLoader::load().Christian Kandeler2014-07-152-28/+35
| | | | | | | | | Move the code that actually loads the project from a file into its own function. Change-Id: I258f97e8411a54e99fa274041f9054ce0703e273 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com> Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* fix crash when removing artifactJoerg Bornemann2014-07-041-1/+3
| | | | | | | | | | | When removing an artifact we also must remove it from the outputs of the transformer that produced it. The situation where such an artifact is later reused only occurs in dynamic multiplex rules, which is why we never caught this. Task-number: QBS-640 Change-Id: I675edc1e84e04886e09a959b548c0425ed932745 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* Remember at what point in time a project was fully resolved.Christian Kandeler2014-07-032-9/+5
| | | | | | | | | | And use that information for out-of-date checks instead of the build graph time stamp. The latter is updated after resolving or even building has finished, which means we miss all changes to project files that have happened in between. Change-Id: I4b2f9e962c26894ce167b36ae3e562e7905d2a3c Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Make it possible to set profiles per product.Christian Kandeler2014-07-027-38/+52
| | | | | | | | | | | Use case 1: Build product A for architecture X and product B for architecture Y (e.g. host tools vs target libraries). Use case 2: Build product A for architectures X and Y and product B only for architecture X (e.g. Android multi-arch packages). Change-Id: I2eb721c37cdd12c298ee12bad60e21e94b04676b Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Merge remote-tracking branch 'origin/1.2'Joerg Bornemann2014-07-022-0/+7
|\ | | | | | | Change-Id: I9d5874b3867d3b366e418ae101c25b518053b00a
| * fix graph traversal of ArtifactVisitorJoerg Bornemann2014-06-132-0/+7
| | | | | | | | | | | | | | | | | | We must return false in all visit methods to indicate that we don't want to traverse children. Task-number: QBS-617 Change-Id: I24226b2b83a5deee394ef1e2fd8dee84dbabf28e Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* | Make sure to remove empty parent directories when removing artifacts.Christian Kandeler2014-07-0210-7/+208
| | | | | | | | | | | | | | | | | | | | | | We create these directories when we create the artifacts, so we have to remove them when the artifacts are removed. For safety, we do not do that for artifacts located outside of the build directory. Task-number: QBS-630 Change-Id: I4da91a2b940ddea6837cb881bf3dc777b71fe702 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* | Fix exception leak in JS command execution.Christian Kandeler2014-07-021-5/+20
| | | | | | | | | | Change-Id: I5fd908cffdb8d2a32d808e85fdb5688873ca555a Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* | Do not lose rescuable artifact data after an incomplete build.Christian Kandeler2014-07-022-3/+13
| | | | | | | | | | | | Task-number: QBS-630 Change-Id: Ib69c541a6c1e228b1ad3c06da51d905194ed10d8 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* | Be more verbose about changed environment.Christian Kandeler2014-06-241-3/+6
| | | | | | | | | | | | | | | | | | If we have to re-resolve because an environment variable changed, print its name as well as the old and new value. Change-Id: I14032da14c151ec31a85f68f1ad56c3b44b3a9d4 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* | centralize input(s) property setupJoerg Bornemann2014-06-113-38/+3
| | | | | | | | | | | | | | | | | | For simplex rules we did set up the inputs with setupScriptEngineForArtifact. We removed setupScriptEngineForArtifact in favor of translateFileConfig. Change-Id: I0df90c65ad6157e715d83e785b3ae67d92ec2088 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* | provide missing input properties for multiplex rulesJoerg Bornemann2014-06-111-0/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | baseName, completeBaseName and baseDir were only available for simplex rule inputs. Now inputs and outputs for simplex and multiplex rules have exactly the same interface. This is a preparation for removing RulesApplicator::setupScriptEngineForArtifact, which is the place where we set up input objects for simplex rules. Change-Id: I2cbe614ed734e79205c1595619312fcf028dc708 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* | Merge remote-tracking branch 'origin/1.2'Joerg Bornemann2014-06-101-0/+10
|\| | | | | | | Change-Id: I603430421156e4d23451a7a4ba0f884d6556f89a
| * yield error if Command.workingDirectory doesn't existJoerg Bornemann2014-06-101-0/+10
| | | | | | | | | | | | | | | | | | Otherwise some command might clutter the user's current working dir. Task-number: QBS-607 Change-Id: Id263481d1a615b9c66753e11b271441d4bd004b1 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* | show error location in Rule.ArtifactJoerg Bornemann2014-06-051-2/+4
| | | | | | | | | | | | | | Change-Id: Ic492a3e7d7a28633f96e808680ef695d33eb79f2 Reviewed-by: Jake Petroules <jake.petroules@petroules.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* | simplify Transformer::setup{In|Out}putsJoerg Bornemann2014-06-051-8/+6
| | | | | | | | | | | | | | | | | | Also, the input/output properties are now removed instead of set to undefined. Change-Id: Ia64a8484e955525d7e186e4459f61f9b7378b0eb Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* | Merge remote-tracking branch 'origin/1.2'Joerg Bornemann2014-06-021-4/+4
|\| | | | | | | | | | | | | | | | | Conflicts: qbs_version.pri share/qbs/modules/cpp/GenericGCC.qbs version.js Change-Id: I77e3d22cdc6f95bfa83c64a7fcfde735c6393d10
| * Fix repeated emission of the finished() signal in JsCommandExecutor.Christian Kandeler2014-05-261-4/+4
| | | | | | | | | | | | | | | | This currently happens always if the command fails, resulting in an assertion. Change-Id: If3de00a2f0e7d89bd052a6ab74bf4237be82e913 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* | Properly treat "usings" as inputs when applying rules.Christian Kandeler2014-06-021-3/+3
| | | | | | | | | | | | | | | | | | This allows non-multiplex rules with only "usings" and no "inputs" to work as expected, that is they create one transformer per "usings" element. Change-Id: Iba5144f81b082043878f3eefc111846b6d05646a Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* | run rules on dependency-only productsJoerg Bornemann2014-05-263-2/+17
| | | | | | | | | | | | | | | | | | This enables compound products that do not provide their own source files but only consist of dependencies. Task-number: QBS-277 Change-Id: I8e3fc5b5e3a85ca2c6fe4890dcd52d3a55cebfe2 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* | refactor rule applicationJoerg Bornemann2014-05-232-18/+19
| | | | | | | | | | | | | | Move invariant out of doApply. Change-Id: I02ffa00b53e722dbb3d94d2bc14f4a5b88302675 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* | Sanitize the project setup API.Christian Kandeler2014-05-231-1/+2
| | | | | | | | | | | | | | | | | | | | | | Ever since we introduced "overridden values", the setter for the build configuration has been pretty much an empty shell, containing only the build variant and the profile. We now make that explicit, resulting in a less confusing API that does not expect the caller to know how to encode profile and build variant information in a QVariantMap. Change-Id: I60183fc1884a884c9ceba34d7eb460c261be47ca Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* | speed-up rule application a bitJoerg Bornemann2014-05-231-5/+9
| | | | | | | | | | | | | | Bail out early when input set is empty. Change-Id: Id92790b5a8258733daafe41ee55a4bb3c9d1dd0e Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* | Merge remote-tracking branch 'origin/1.2'Joerg Bornemann2014-05-224-75/+102
|\| | | | | | | Change-Id: I20fc0abcd4c6fa4bfb908d981399f75d50179e97
| * pass file dependencies to recursive dependency scannersJoerg Bornemann2014-05-211-7/+11
| | | | | | | | | | | | | | | | | | Recursive dependency scanners, like the C include file scanner, must be fed with file dependencies they've found. Task-number: QBS-566 Change-Id: I68a8e4a5cbb771ed2785ca69412a3b4c4e280eb2 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
| * let scanners operate on FileResourceBase objectsJoerg Bornemann2014-05-204-26/+34
| | | | | | | | | | | | | | File dependencies should be scannable for dependencies too. Change-Id: I7223ba65ee6ca02f70c8e48165652550007e91f6 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>