[Qbs] Deployment and dependency bundling
Oswald Buddenhagen
oswald.buddenhagen at gmx.de
Fri Dec 27 19:24:37 CET 2019
On Fri, Dec 27, 2019 at 06:04:08PM +0300, Alberto Mardegan wrote:
>I agree that in many cases the Depends item is the one who has the best
>information on how to handle its deployment. For example, the QtGui
>module will know which platform plugins need to be deployed, and the
>QtQml module could know which QML modules need to be deployed and how.
>
you're mixing up two separate issues.
"deployment" (you actually mean dependency embedding) is just a special
form of "linking" dependencies. you should be able to make a fully
static build or a bundle with embedded dlls and plugins from the same
project, by flipping a single bit. similarly, for qml, you could select
whether the qml files are compiled (with the old qml compiler) or
embedded as-is.
_what_ gets depended upon is a policy decision that is independent from
the mechanism that does the linking.
plugins specify a type, while modules declare what types of plugins they
want to pull in. that makes this policy implicit, and a manual override
is provided. that was actually already implemented for the qt port.
qml modules should be typically found by qmlimportscanner or an
equivalent mechanism. there should be probably a mechnism to exclude
unnecessary transitive dependencies.
>Project {
> QtGuiApplication {
> Depends {
> name: "QtGui"
>
> /* Or should this be automatically detected depending on
> * the target? Maybe one should have a "deployed-app" product,
> * and deployment should be triggered if and only if qbs is
> * asked to build that target?
> */
>
you are merely asking about the default of that property, which
definitely should be specific to the particular Depends item. an
expression that depends on a project-wide setting whether the result
should be self-contaiend even when doing a dynamic build would certainly
make sense.
> * Additional properties could be used to exclude some libraries
> * from being deployed (because we assume they exist in the
> * target system).
> */
> deployment.excludePatterns: [ "libstdc++.so*", "libxcb.so*" ]
>
the embedding property should apply to abstract modules (and their
"slices", i.e., files that fall into a particular category), not
os-specific files. yes, that means that there need to be modules for
"system" dependencies, and they should be declared as such (so that
projects don't need to repeat the exclusions each time).
More information about the Qbs
mailing list