Uploaded image for project: 'Qbs ("Cubes")'
  1. Qbs ("Cubes")
  2. QBS-1350

installPrefix vs. installRoot is b0rked

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Not Evaluated
    • None
    • 1.11.1
    • None
    • 0ac5a1467433cafe98e01598de25f155f24fcb2f (qbs/qbs/1.17)

    Description

      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):

      • host:/installRoot/installPrefix/installPath/fileName
      • target:/devInstallPrefix/installPath/fileName

      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.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              kandeler Christian Kandeler
              buddenha Oswald Buddenhagen
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes