Priority: Not Evaluated
Affects Version/s: 1.11.1
Fix Version/s: None
Component/s: Language Syntax & Semantics
as has become obvious during the review of https://codereview.qt-project.org/227754, qbs seriously misinterprets the concepts of prefix and install root. here is how these are conventionally understood, for good reasons:
the prefix defines the final installation location. it is often somehow built into the executable. consequently, it is invalid to run an executable from anywhere except its prefix. that means that a product configured for a particular prefix cannot be installed into two different prefixes without re-building, or at least fiddling with embedded rpaths. that also means that an actual prefix simply cannot be empty (even the root would be specified explicitly).
only if the executable is fully relocatable, the prefix becomes a meaningless concept.
the install root (DESTDIR in automake terms) is a virtual root for the install/packaging/deployment step only. it is invalid to attempt to run anything from a non-identity (empty) install root. therefore, the install root doesn't have any limitations like the prefix. it is empty by default.
an empty prefix should be interpreted as a request for a sandboxed installation (the prefix is a subdir of the build tree). one would never set an install root in such a case.
as an additional complication, cross-builds may actually build a different prefix into the executable than is used for installing on the host (such an executable obviously can't be run on the host anyway). this doesn't need to concern the build tool ... until it actively participates in deployment to devices.
this results in the following installation paths for any particular product (the slashes represent semantical joining, not concatenation):
as one can see, installRoot and installPrefix are always used together during actual installation. however, only the installPrefix will be embedded into auxiliary files (like module files which determine -L and -rpath-link flags). the devInstallPrefix may be embedded into the binaries (e.g., via -D and -rpath flags).
a project may use multiple prefixes, for example if it mixes host and target products.
while it would be possible to install different products with different install roots, this isn't a use case of much concern.
|For Gerrit Dashboard: QBS-1350|
|307848,11||doc: Provide a complete example in the "Installing Files" section||1.17||qbs/qbs||Status: MERGED||+2||+1|