[lsb-discuss] Building Qt as LSB-compliant

Craig.Scott at csiro.au Craig.Scott at csiro.au
Mon Jun 6 18:12:22 PDT 2011


I was debating whether to put this one out there, but Thiago's last post (on qt5-feedback) gave me the kick I needed. I'm cross-posting to lsb-discuss so that those on that list are aware of this posting too (particularly see the discussion relating to DBus at the end). Apologies for the long post, but the justifications are needed to make the arguments.

Under linux, if you want to build packages that work across a wide variety of distributions, a good way is to make them LSB-compliant. Unfortunately, the LSB tends to provide you with only relatively old Qt versions (4.2 in the latest LSB spec). That means if you want to make use of any more recent Qt features, the only way you can produce LSB compliant packages is to build your own Qt libraries using the LSB compilers and include those libraries in your packages.

Prior to LSB 4.0, the LSB didn't really cover recent enough versions of things Qt depended on to make building Qt itself with LSB compilers viable. However, since LSB 4.0, the dependencies are essentially there. The only Qt module which cannot be built is QtDBus (more on that below). Now, Nokia already provide pre-built binary packages for Linux with each Qt release. My understanding is that these are built on Kubuntu 7.04 (or at least, I think they used to be). It would seem worthwhile to consider also supplying LSB packages with each release, since this would encourage more portable apps being built on top of Qt under linux. Such packages would offer ISV's some certainty that the Qt binaries should work on the linux distributions they need to target. The current binary packages Nokia provide do not offer this and indeed we've seen issues with using those in the past, which is why we build our own Qt from source for inclusion in the packages we create. Since Qt5-related discussions are often around binary compatibility, it would seem to be a good time to consider making LSB compliant packages available with each Qt release. Would Nokia consider doing this? How big a task would it be? What are the barriers?

Note that providing these packages should not be too onerous, since Nokia would only need to provide one package for 32-bit and one for 64-bit, and these should cover all mainstream linux distributions. If you pick LSB 4.0 as your baseline, that will cover the vast majority of what people are using these days. For the list of distros covered, see here:

http://www.linuxfoundation.org/lsb-cert/productdir.php?by_lsb

Further testing with the LSB app checker will also reveal that the libraries should work on older linux distributions as well, since all the required binary interfaces the Qt source uses are present on those too (we have to go back to RHEL3 to find mainstream distros that are missing interfaces for our packages). There's a bug report in the bug tracker showing the small number of patches to the Qt source required to make Qt buildable with LSB compilers (I've also attached a full patch set for Qt 4.7.3 to that bug report):

http://bugreports.qt.nokia.com/browse/QTBUG-16385


QtDBus
======
The situation with QtDBus is a bit special. For one, this module is only available on linux and not Mac or Windows. This means that it is not in the same category as the likes of QtGui or QtNetwork which are fully cross-platform. The QtDBus module is a linux-specific thing (currently). Even under linux though, the stability of the DBus API has been a concern in the past. See here for past comments on the LSB side of things (now getting a bit dated):

http://www.linuxfoundation.org/en/LSB_DBus

Note, however, that even the latest LSB release still doesn't include any DBus libraries! As things stand, you can't offer DBus functionality in a LSB-compliant package, since DBus isn't in the LSB and therefore you can't even build Qt with DBus support using LSB compilers. I guess you could try building DBus itself with LSB compilers, but that just seems like the rabbit warren is going too deep - and DBus is really something that should be in the LSB, but currently isn't. 

It would seem worthwhile for Qt and LSB people to have discussions about what could be done to include DBus in the LSB, to then also enable the QtDBus module to be added to the LSB and also to allow the QtDBus module to be built with the LSB compilers. How could we go about doing this? Note that LSB people are currently discussing what should go into the LSB 5.0 spec, so it might be the right time to have these discussions, given that there is also a parallel discussion around Qt5 binary issues on this list.

--
Dr Craig Scott
Computational Software Engineering Team Leader, CSIRO (CMIS)
Melbourne, Australia





More information about the lsb-discuss mailing list