[Qbs] qmath3d build issue

Christian Kandeler Christian.Kandeler at qt.io
Wed Feb 19 14:05:49 CET 2020

On Wed, 19 Feb 2020 12:18:13 +0000
Wookey <wookey at wookware.org> wrote:

> I maintain a couple of debian packages that build with qbs.
> Last night, whilst fixing a couple of bugs in qmath3d (https://tracker.debian.org/pkg/qmath3d) I found a problem: it used to build but no longer does.
> Well it builds fine but the qbs install step is installing to:
> $(CURDIR)/debian/tmp/usr/local/usr/lib/<triplet>/

"$(CURDIR)/debian" is the install root
"/usr/local" is the install prefix (this is the default value on Unix)
"/usr/lib/<triplet>/" comes from somewhere else; presumably someone sets qbs.installDir to that.

> instead of 
> $(CURDIR)/debian/tmp/usr/lib/<triplet>/
> when given:
> 	qbs install --settings-dir debian --no-build \
>            --install-root $(CURDIR)/debian/tmp \
>            project.libDir:lib/$(DEB_HOST_MULTIARCH) \
>            profile:deb \
>            config:qbs-build
> If I also configure with:
>         qbs config --settings-dir debian profiles.deb.qbs.installPrefix usr/

This looks sensible and appears to be the "conceptually correct" solution.

> then it installs into
> $(CURDIR)/debian/tmp/usr/usr/lib/<triplet>/
> (so we got rid of the 'local', but still have two 'usr's)
> To make it work I now have to do:
>         qbs config --settings-dir debian profiles.deb.qbs.installPrefix ""
> All this doesn't seem to fit with InstallPrefix and InstallRoot info on
> https://doc.qt.io/qbs/qml-qbsmodules-qbs.html#installation-properties
> I'm not sure what's going on, and why it has changed.
> installing to
> <InstallRoot>/usr/local/usr/lib/
> seems almost always likely to be wrong.

Sure, but that's the fault of who/whatever sets the "/usr/lib" thing. The project itself perhaps?

> I have made it work, but it used to be that the path was correctly constructed from
> <InstallRoot><InstallPrefix><Libdir>
> but that seems no longer to be true, and now I don't understand what it is doing.

It worked by coincidence, because qbs.installPrefix used to be empty by default. Now that it isn't anymore, it becomes painfully obvious that someone has put a "/usr" where it doesn't belong. (Presumably the project, and presumably into qbs.installDir).

> I'm on qbs 1.13.1, and I guess it was 1.11 or 1.12 last time I tried any of this.
> Is this a deliberate change in behaviour

Yes. Giving qbs.installPrefix a sensible default makes it more obvious to new users what the responsibilities of the different install* properties are, and as a side effect uncovers mistakes like the one we are seeing here.
Of course, one can also choose to ignore all of this and continue as before by forcing qbs.installPrefix to an empty string.


More information about the Qbs mailing list