aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/corelib/language/moduleloader.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix SOFT ASSERT for parametrized dependencies in Export/Module itemsv1.10.11.10Joerg Bornemann2018-01-311-6/+5
| | | | | | | | | | | | | The SOFT ASSERT was triggered, because the Depends items in Export/Module had the type ModuleInstance instead of ModuleParameters. Move the assignment of that item type to ItemReaderASTVisitor instead of adjusting it in the ModuleLoader, because this ensures that we don't have to traverse prototypes in the adjustment procedure. Task-number: QBS-1287 Change-Id: Ie1a1080d40b8bebe5c205f8b34298469cde5bd46 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Fix parameter extraction for Depends items within Export/Module itemsJoerg Bornemann2018-01-311-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Parameters of Depends items within Export items were ignored. Project { Product { name: "foo" Export { Depends { name: "dep"; cpp.link: false } // dep } } Product { name: "bar" Depends { name: "foo" } } } The instance of foo in bar has an Depends child depinst. The item depinst was created by createChildInstances and is an empty item with the prototype dep, which is the Depends item in foo's Export item. Thus, extractParameters must look up properties in the deepest prototype (dep), not in the Depends item itself (depinst). Unfortunately, this fix triggers SOFT ASSERT: varValue in ../../../../1.10/src/lib/corelib/language/evaluatorscriptclass.cpp:574 which will be fixed separately. Task-number: QBS-1287 Change-Id: I56b5464aad2578bb5ddab2e831fc607d6634ac8d Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* ModuleLoader: Fix order of module mergingChristian Kandeler2018-01-171-18/+44
| | | | | | | | | | Dependencies must be merged before their dependents, because the merging process for the former sets up data to be consumed by the merging process for the latter. Task-number: QBS-1275 Change-Id: Ide9146add79bf2b4fcf80d7ce95ac1d9d4ac20b2 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Fix convenience command-line override syntax for qbs propertiesChristian Kandeler2017-12-231-0/+2
| | | | | | | | | | | | Users can write "qbs.xyz" instead of "modules.qbs.xyz", but we only applied that during module prototype loading, meaning that using that syntax (and only that syntax) would not override values set in project files, which was obviously quite confusing to users. Now the two variants behave exactly the same. Task-number: QBS-1244 Change-Id: Ie9c5de1ac42e33205b80335566e0721d61718947 Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* Fix scopes of dependency parametersChristian Kandeler2017-12-231-20/+5
| | | | | | | | | | | Only the values in Depends items of products had a scope, and that one did not allow to access module instances. Now the scope always is the surrounding item, which should be a sensible one in all contexts. Task-number: QBS-1253 Change-Id: Iedca2d98f82f71887373579f8e4dc91f057eded3 Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* Fix spurious "unknown property" error on loading module candidatesChristian Kandeler2017-12-151-19/+28
| | | | | | | | | | | | | | | | | | When loading a module file, we apply property overrides from profiles and throw an error if ther profile sets a non-existing property on the module. This should only be done if that module file actually gets chosen to represent the module. In the past, it was enough to check the item condition, but this is no longer enough, because since commit 885bd2ec92 even module files with a matching condition might not get chosen because another one has a higher priority. This patch fixes the problem by delaying the check until we know the chosen candidate and applying it only on that one. We also improve the error message: There was no context given, so users had no clue where the problem came from. Change-Id: I9cb1b8ab118072e6be612c466552d9dd97796e8a Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* ModuleLoader: Copy id when setting up module instance child itemsChristian Kandeler2017-12-151-0/+1
| | | | | | | | | | Problem was uncovered by d08ce8f643, after which the Depends item used for loading a module is no longer the original one from the prototype (i.e. the one that got the id assigned by the AST visitor). Task-number: QBS-1264 Change-Id: Id8bdf0cc903aaabfb3eaafc56445064ed49d1cd7 Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* Fix inadvertant module prototype sharingv1.10.0Christian Kandeler2017-11-231-5/+9
| | | | | | | | | | A product that is not multiplexed in the sense that additional instances of it are created can still alter prototype values. Take this into account when deciding whether to re-use an existing module prototype. Task-number: QBS-1243 Change-Id: I017fc0dc9d6080d622b030e97796d254d17b3468 Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* Remove unused overload of ModuleLoader::productModuleJoerg Bornemann2017-10-061-6/+0
| | | | | Change-Id: I62651b2baf2497d11d78554fc84ad0cfbf178f33 Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* ModuleLoader: Fix false positive in property declaration checkerChristian Kandeler2017-10-041-1/+1
| | | | | | | | Assigning module properties in a Group in an Export item erroneously caused an error. Change-Id: Idfbb4986196ad6b1c29d772c919afc9e3ab7b45b Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* ModuleLoader: Fix check for Probe.configureChristian Kandeler2017-10-041-1/+2
| | | | | | | | | Item::setupForBuiltinType() always creates a Value object, so the check for Probe.configure never triggered. Change-Id: I2be1b10c2fa29ceb36edddc22585dede9b626ea5 Reviewed-by: Jake Petroules <jake.petroules@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Log debug messages for failures in non-required modulesChristian Kandeler2017-10-041-0/+3
| | | | | | | | | Such failures might be expected and thus cannot be warnings, but they should get logged. Change-Id: I8ac63f1034b2dcc3e0a23e5d0da648e640f4ab21 Reviewed-by: Jake Petroules <jake.petroules@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Fix recursion issue when releasing ResourceAcquiringScriptObjectsJoerg Bornemann2017-09-271-0/+1
| | | | | | | | | | | | | | | | | Calling releaseResourcesOfScriptObjects in QScriptEngine::evaluate does not guarantee that the function is called in all circumstances, because evaluate is not virtual. Worse, it might be called at the wrong time by a recursive evaluate. Remove the evaluate overloads, and call releaseResourcesOfScriptObjects manually after the evaluation of - Probe.configure, - Rule.outputArtifacts, - Rule.prepare, - and JavaScriptCommand.sourceCode. Change-Id: Ie4ed0c2d0895a13a8930d7b35c0f22a8d62dc34b Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Refine log messages in ModuleLoader::loadModuleFileJoerg Bornemann2017-09-261-3/+3
| | | | | Change-Id: Ie87508e7daed63b7f047ed8e46bfeb920d78ae55 Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* Introduce Module.priorityJoerg Bornemann2017-09-261-7/+49
| | | | | | | | | | | | | | | Add the property Module.priority to be able to define an order of module instances. This is used to resolve conflicts in module instances. If there is more than one module instance available, the one with the highest numerical priority is chosen. [ChangeLog] The property Module.priority was added to provide a mechanism to resolve conflicts in module instances. Task-number: QBS-61 Change-Id: I6aeae91be742bb11a61345bb890992697bdf0a23 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Remove instance list from instantiateModuleJoerg Bornemann2017-09-261-3/+3
| | | | | | | | | | We do not have to construct this list, as the knowledge is already present in the prototype chain. Apart from saving allocations, this change makes it easier to extract the determination of the deepest module instance in a subsequent commit. Change-Id: I2d64b3d5ea32cdf8ee4f04d8aafb148bd8f54745 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Simplify setup of the qbs module's prototypeJoerg Bornemann2017-09-261-11/+7
| | | | | Change-Id: I7e7e258e04129e4de95de80efa8e1dcb4afd428a Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Extend log messageJoerg Bornemann2017-09-221-1/+2
| | | | | | | | The product name and the complete location are more useful at this point than just the location's file path. Change-Id: I63494ae8d68fd3d1107be550b0812d5ad980853b Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* Yield error on conflicting module instancesJoerg Bornemann2017-09-211-1/+12
| | | | | | | | | | | If there is more than one suitable module instance, we used to pick the first one. The module order is determined by what QDirIterator provides. This is surprising and hard to control. Yield an error in this situation instead. Task-number: QBS-61 Change-Id: If53853e6d4d32587cb0182f0e25200d402949ff5 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Use ranged-based for loops where applicableJoerg Bornemann2017-09-191-2/+2
| | | | | Change-Id: Iad8468472cb585b919f0c463e45d091d6f5395ae Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* Add missing override keywordsJoerg Bornemann2017-09-191-3/+3
| | | | | Change-Id: I647a04501fbc279d0434d9b8a6160dad1a4f907e Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* Remove ModuleLoader::m_moduleSearchPathsJoerg Bornemann2017-09-181-24/+6
| | | | | | | | | | | This member was supposed to hold the current module search paths but was out of date as soon as an extra search path was pushed to the ItemReader. We already searched for modules in m_modulesSearchPaths + m_reader->allSearchPaths() to mitigate this. This led to having the same search multiple times in the list of module paths to consider. Change-Id: I3946d12b1708ae62e432b4bcfd18148f22ba211d Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Fix check for duplicate search paths in ModuleLoaderJoerg Bornemann2017-09-181-1/+2
| | | | | | | | | | m_moduleSearchPaths contains paths with the suffix "/modules". Search paths from preferences usually don't have this suffix. The duplicate check must not use the values from m_modulesSearchPaths but the unaltered search paths of the ItemReader. Change-Id: I26dc1652af39eed7acae914a88ed00d6f611f87c Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Rename ItemReader::searchPaths() to allSearchPathsJoerg Bornemann2017-09-181-1/+1
| | | | | | | | This removes the asymmetry of searchPaths() returning a value different from what was set with setSearchPaths(). Change-Id: I173a3e171710d7450121d4d9fec7cebf9064339f Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Do not clear ModuleLoader::m_moduleDirListCache in setSearchPathsJoerg Bornemann2017-09-141-1/+0
| | | | | | | | This cache holds file lists of directories. Disk content is independent of any search path. There is no reason to clear the cache at this point. Change-Id: I449927bd355b5b39fffb9951f5a18223d9a558fe Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Fix style of some log messagesJoerg Bornemann2017-09-141-4/+5
| | | | | Change-Id: Ic941a2c3b9dab95f6a8b40de45fe560a43d4c9a0 Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* Move hostOS identifier list function from module loader to HostOsInfoJake Petroules2017-09-111-31/+1
| | | | | | | | This location makes a lot more sense and makes it easier to find and remember where it is. Change-Id: Idaa7189c2d8f8f2f5375a7af57250f0323de8b2f Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Merge 1.9 into masterChristian Kandeler2017-09-011-53/+65
|\ | | | | | | Change-Id: I8f29ec41a4f3bc87be39abe37398d8345012be5b
| * ModuleLoader: Fix adjustment for multiplexed dependenciesv1.9.0Christian Kandeler2017-09-011-60/+72
| | | | | | | | | | | | | | | | | | We erroneously gave the responsible function only a local project view instead of the global one, meaning dependencies could fail across subprojects. Change-Id: I18155df39cb981aed36e204ea2a85ed26a7eb6c7 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* | Use std::vector for ModuleLoader::ProductDependenciesJoerg Bornemann2017-08-231-5/+9
| | | | | | | | | | | | | | | | The value_type is a somewhat bigger struct which is a suboptimal type for QList. Change-Id: I25c9f3942d1ee573f58fc01ac1ac66794cb2be4f Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* | Fix bug in conditional dependenciesJoerg Bornemann2017-08-231-3/+2
| | | | | | | | | | | | | | | | Dependencies of products must not be stored per project but per product as they can differ in different products. Change-Id: I14f6767d4bceab1295d3922d5b0e77f13997a3e2 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Rename ProductDependencyResults to ProductDependenciesJoerg Bornemann2017-08-231-2/+2
| | | | | | | | | | | | | | | | That name is more descriptive. Move the declaration and use it in more places. Change-Id: I73fee238abc9d2fada35b024bb18e1d29106623a Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Make conditional dependencies in modules respect command-line overridesChristian Kandeler2017-08-211-11/+10
| | | | | | | | | | | | | | The code that set overridden module properties was run too late. Change-Id: Ic1c4afad8412dd9a72512ad77419afb5ed54dd88 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* | Simplify qbs.hostOSJake Petroules2017-08-161-111/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We remove several values that are obsolete, as well as values for operating systems that have been discontinued. bsd4 and qnx6 are removed because there is a separate qbs.hostOSVersion property for the version of the host OS. These were removed from Qt Creator in 2014. osx is removed as it is a long-deprecated synonym for macos. 5 minor releases since the introduction of 'macos' in Qbs 1.5.2 is long enough. android, ios, lynx, nacl, qnx, integrity, and vxworks are removed because it is either not possible or not practical to run Qbs on these platforms. Command line tools can't be run on iOS or Android without jailbreaking or rooting the device, QNX has long since removed the QNX-native QCC compilers, and it seems unlikely that there have ever been or would be compilers available for LynxOS, INTEGRITY or VxWorks so those are easily out. NaCl is a deprecated technology that is being replaced by WebAssembly (nor would you run a build process on either of them anyways). ultrix and reliant have not seen a release since 1995. dgux not since 2001. bsdi not since 2003. irix not since 2006. osf not since 2010. dynix... unclear, but no later than 2002. symbian needs no mention. All considered obsolete, all gone. sco and unixware are effectively obsolete. Remove them until someone expresses a real need. haiku was added because Qt has it. Change-Id: I5cc23ae165a3069c63ee13388655d0093e5ccabc Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Merge 1.9 into masterChristian Kandeler2017-08-141-3/+1
|\| | | | | | | Change-Id: I6da76b0a53bf87105c4e7b48724d9760cb68e831
| * ModuleLoader: Remove invalid assertionChristian Kandeler2017-08-141-3/+1
| | | | | | | | | | | | | | | | The assumption that all list properties must have acquired a defining item at some point is simply wrong. Change-Id: I34d035e50b5d5cd8c62f1baba899326b92ade8d1 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* | Set overridden module properties on all members of the prototype chainChristian Kandeler2017-08-141-4/+8
| | | | | | | | | | | | | | | | This is necessary since d08ce8f643 to prevent properties set in higher- level module instances from taking precedence. Change-Id: I5cc3be52fe22e3cded44d9fa3ce5faf40b55ddb7 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* | Centralize conversion of multiplex id to human-readable stringChristian Kandeler2017-08-031-25/+7
| | | | | | | | | | | | | | | | | | | | | | ... and use it to construct a unique product display name that can be used in error messages and so on. [ChangeLog][API] Introduced ProductData::fullDisplayName() Change-Id: I9a35765d3694a8f24741f1506b00d499a1aa23a0 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* | Fix problems regarding multiplexing and Depends.profilesChristian Kandeler2017-08-021-34/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Change the default of Depends.profiles from [product.profile] to undefined, so that we can by default use the same heuristics for dependencies, regardless over which property the products were multiplexed. - Replace the the internal Depends property "multiplexConfigurationId" by "multiplexConfigurationIds", which is a string list rather than a string. This way, we don't have to create additional Depends items anymore for the case where we want to depend on several variants of a product. Note that the old approach did not even work, because all but the first Depends item were ignored by the code that resolved the dependencies (since a module of that name already existed). The problem was masked by the fact that we set Depends.profiles to "*" in various places. This hack is now also gone. Change-Id: Ic05fdeed3978e2f7b184dfdc9c173d93406faec2 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* | Use categorized logging in ModuleLoaderJoerg Bornemann2017-08-021-59/+38
| | | | | | | | | | Change-Id: I0379366eb745ce5c5ff2ba90e6c1eeae70ec3624 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Add initial support for Universal Windows PlatformJake Petroules2017-08-011-4/+1
| | | | | | | | | | | | | | | | | | | | | | [ChangeLog] Added initial support for the Universal Windows Platform (properties for which API families/partitions are available to code being compiled, and whether compiled binaries require an app container context to load/execute). Change-Id: Idd3e117bbb40bd547ae06c16318b2d2e38f07bb4 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Introduce the Profile itemChristian Kandeler2017-08-011-4/+107
| | | | | | | | | | | | | | | | | | | | | | | | | | Allows users to provide project-specific profiles. Useful for when a project has specific, well-known requirements regarding the build environment and/or target platform. [ChangeLog] Profiles can now be defined within a project using the Profile item. Task-number: QBS-895 Change-Id: Idf902fbb095bb153c15e31d2aa8eb73448b69936 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* | Refactor SetupProjectParameters to take a qbs::Profile objectChristian Kandeler2017-07-271-2/+3
| | | | | | | | | | | | | | | | ... rather than a profile name. We will make use of this in a follow-up patch. Change-Id: I3b89ebfdaea052750868e1b91d58e3e592d81c54 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* | Remove references to obsolete platformsJake Petroules2017-07-251-9/+0
| | | | | | | | | | | | | | | | | | We'll never support Windows CE, Windows Phone (8.x), or BlackBerry. Change-Id: I4adceb663098799f4a8e7283059add6ed9c15f1f Reviewed-by: Kai Koehne <kai.koehne@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* | Fix Depends conditions in modulesJoerg Bornemann2017-07-111-75/+161
| | | | | | | | | | | | | | | | | | Resolve depends items for module instances, not for module prototypes. Otherwise Depends.condition is always evaluated in the prototype's scope and always has the same value. Change-Id: I600ec8b318f955028fdb156f735cd1b2773f652e Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Act on some version-related TODO itemsChristian Kandeler2017-07-061-10/+9
|/ | | | | Change-Id: I24010c2323c2cef04030a01b3b0f53f5624f8706 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Allow to pass the initial value to PropertyDeclaration constructorChristian Kandeler2017-07-051-1/+1
| | | | | | | | | Saves lots of unnecessary variable declarations in BuiltinDeclarations, preventing error-prone sharing of these variables between different objects. Change-Id: Ic407c80c1094c8504fc64ef3ccb518b0996943f5 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Fix false positive in property declaration checkerChristian Kandeler2017-07-041-2/+3
| | | | | | | | During export item merging, we lost the information about whether the property was setup by a Properties block. Change-Id: I899188b10aea66dfcfdb61e348d93be1f69347a3 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Fix trace messageJoerg Bornemann2017-07-041-1/+1
| | | | | Change-Id: Ie59d05c4bc0a86017a45bfed35899225f1d7f034 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* ModuleLoader: Re-add error message removed in 1.8Christian Kandeler2017-06-131-3/+2
| | | | | | | We now support the indicated syntax. Change-Id: Ie9105db6075e97408090e7d01d503e59c3f673b2 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>