conan-io/wishlist

Qt/5.6

Closed this issue ยท 33 comments

Qt libraries.
Mainly used to develop GUI C++ applications.
Its installer from qt website is quite useful-friendly, but it'd be nice to have them in conan too :)

Hi! If you could specify in which platforms (OS, compiler) you plan to use it, that could also help to package creators to prioritize work and test first on those platforms.

Hi @memsharded!
I'd like to use qt with conan in Windows x64 compilling with gcc 4.9
thx!

Mingw, right?

yep!

Support for Visual Studio 2010 => 2015 would be great too.

There is a package from @osechet here: https://github.com/osechet/conan-qt
I am trying it, and it doesn't work on Win, will contact the author and try to collaborate.

Thank to @memsharded's help, my Qt package is available. It has been tested on Linux and Windows.
On Windows, it's working only with Visual Studio (tested with 2012, 2013 and 2015) for the moment. I'll try to add support for gcc later.
I'm uploading some packages to conan.io server (MSVC2013, MSVC2015) but they are quite big and it's taking time. If you need others packages (MSVC2010 or MSVC2012), conan should build them for you but you have to know Qt is very long to build.
Feedback is welcome.

Excellent, I have twitted about it, trying to gather more feedback and contributions. Thanks!

@osechet thanks for this package! I've following issue on VS2013
LINK : fatal error LNK1104: cannot open file 'Qt5X11Extrasd.lib'
I've solved it by removing some libs from CONAN_LIBS:
list(REMOVE_ITEM CONAN_LIBS Qt5X11Extras Qt5X11Extrasd Qt5XcbQpa Qt5XcbQpad)
And I needed to copy platforms/plugins folder to bin

Yes, you are right, they should not be added to CONAN_LIBS on Windows. However, I don't think you should link with CONAN_LIBS. Qt provides a lot of libraries and linking with all of them is probably not a good thing. I think to use Qt the way Qt suggests it is better:

  • call find_package() for the libraries you need
  • use the Qt5::<lib> targets to link

I see you have already removed them from windows, added extra helloworld2 linking with CONAN_LIBS. Excellent, tested in windows, works perfectly. Submitting a PR to add the execution of helloworld2 to the test() in test_package.

Hey! Thanks a lot, @osechet, for the work, just finished compiling it in Ubuntu and it works as expected.

Nevertheless, I may be facing an issue: after several hours of compile time (yes, an old computer) I have the following directories in ~/.conan/data/Qt/5.6.1-1/osechet/testing:

  • build
  • export
  • package
  • source
  • system_reqs

As I need to free space on my HD, I would like to remove some of them, I thought that the only needed ones would be export and package, but when I change the name of build my application failed to execute (it compiles fine) with:

$ ./bin/MyProject 
This application failed to start because it could not find or load the Qt platform plugin "xcb"
in "".

Reinstalling the application may fix this problem.
Aborted (core dumped)

This is the core, no debug symbols, though :/

(gdb) bt
#0  0x00007f8cadb71267 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:55
#1  0x00007f8cadb72eca in __GI_abort () at abort.c:89
#2  0x00007f8cae4bfa01 in QMessageLogger::fatal(char const*, ...) const ()
   from /home/javi/.conan/data/Qt/5.6.1-1/osechet/testing/package/41b4a670ac66e314bb644198013c12a53602fa3d/lib/libQt5Core.so.5
#3  0x00007f8cad613c94 in QGuiApplicationPrivate::createPlatformIntegration() ()
   from /home/javi/.conan/data/Qt/5.6.1-1/osechet/testing/package/41b4a670ac66e314bb644198013c12a53602fa3d/lib/libQt5Gui.so.5
#4  0x00007f8cad613ccd in QGuiApplicationPrivate::createEventDispatcher() ()
   from /home/javi/.conan/data/Qt/5.6.1-1/osechet/testing/package/41b4a670ac66e314bb644198013c12a53602fa3d/lib/libQt5Gui.so.5
#5  0x00007f8cae6b47d4 in QCoreApplicationPrivate::init() ()
   from /home/javi/.conan/data/Qt/5.6.1-1/osechet/testing/package/41b4a670ac66e314bb644198013c12a53602fa3d/lib/libQt5Core.so.5
#6  0x00007f8cad614c2f in QGuiApplicationPrivate::init() ()
   from /home/javi/.conan/data/Qt/5.6.1-1/osechet/testing/package/41b4a670ac66e314bb644198013c12a53602fa3d/lib/libQt5Gui.so.5
#7  0x00007f8caeab6569 in QApplicationPrivate::init() ()
   from /home/javi/.conan/data/Qt/5.6.1-1/osechet/testing/package/41b4a670ac66e314bb644198013c12a53602fa3d/lib/libQt5Widgets.so.5
#8  0x00000000004034eb in main ()

It is weird, as the core shows symbols from the package subfolder, not the build one, so the build one could be removed or renamed without problems, in theory. In which OS are you working? I would like to check what could be happening.

Ubuntu 15.04

[settings_defaults]
arch=x86_64
build_type=Release
compiler=gcc
compiler.libcxx=libstdc++
compiler.version=4.9
os=Linux

@jgsogo The problem is due to the prefix path that is hard-coded (see this page). Qt uses this hard coded path to load plugins. Until I find a solution, you should manually create a qt.conf file in the package directory and specify the real prefix path:

[Paths]
Prefix = /path/to/the/package

In your case, the qt.conf file should be in /home/javi/.conan/data/Qt/5.6.1-1/osechet/testing/package/41b4a670ac66e314bb644198013c12a53602fa3d with this content:

[Paths]
Prefix = /home/javi/.conan/data/Qt/5.6.1-1/osechet/testing/package/41b4a670ac66e314bb644198013c12a53602fa3d

I created a new package for Qt that only includes the qtbase modules (Core, Gui, network...). By building only qtbase I have been able to reduce the creation time (from several hours to less than a hour).
The new package is available on conan.io.
For the moment, only MacOs is not supported.

I think most of the people is only interested by these modules. So I think it's a good beginning. I will now try to create others packages for others Qt modules.

Your feedback is welcomed.

The Qt package has been updated. From stable/5.7.1, it is possible to specify the wanted modules using options. For example, if you want the Qt Serial Port module, use the Qt:serialport=True option with conan. By default, the Qt package does not build any module except the qtbase ones.
Here is the list of module options:

  • -o imageformats="False"
  • -o gamepad="False"
  • -o svg="False"
  • -o graphicaleffects="False"
  • -o xmlpatterns="False"
  • -o serialport="False"
  • -o canvas3d="False"
  • -o location="False"
  • -o tools="False"
  • -o websockets="False"
  • -o webengine="False"

More modules may be added if requested.

For information on how to use the package, you can check the related page on conan.io: https://www.conan.io/source/Qt/5.7.1/osechet/stable

Note: The QtBase package is now considered deprecated.

The purpose is to add libraries as whishlist ? It would be great if we can have this ones, I'm using them in few projects I'm migrating to use Conan:

@forlayo You should open a new issue for each of them. This ticket is dedicated to Qt.

+1

The current version is 5.10.1. Is packaging this still in the plans?

Hard to tell. Packaging big libraries as this as well as its dependencies is very time consuming. We are willing to help the community with it and I think the recipe from @osechet is a very good starting point.

I'm hacking at it currently/ Quite a bit of updating required.

https://github.com/TurboIT/conan-qt

I'm not convinced the conan recipe should be running apt-get on a machine to install required libraries.
The windows vcvars stuff is unnecessary, if a user runs it from a visual studio cmd prompt. It just adds technical debt/complexity.

It is a good starting point, but the complexity is the reason it needs so much work to get it to work with later versions of qt and conan.

My github repo version builds mac and linux, still working on windows. I haven't tested it end to end with a dependant app yet, so I'm unsure how the RPATH situation will work out on mac.

@conradjones
@bincrafters
@lucienboillod
@osechet

I appreciate your existing qt conan projects and effort. I would like to highlight here a Qt conan package i created some time ago. Maybe something of my project can inspire also your existing ones. My design goal was to handle a manual copy of (nearly) all qt configuration options and provide them to the conan options interface:
https://github.com/cguentherTUChemnitz/conan-Qt

The default configuration behaves as follows:

  • disables as most as possible (Qt modules and external dependencies)
  • enables as most as possible optimizations
  • prefers the qt provided libs, where needed.

The goal was to create a qt conan package which is small (especially interesting for shared linking) and ships only stuff you really need for your project.

This package is actively used for linux compilation and cross-compilation for windows. Sadly it is tested only by a small set of configuration options and the compilation path for mac OS is not present.

I'm also investigating binary packaging using the downloadable Qt installers,

I've found compiling from source, I can't get qmake to work in an ubunutu docker container. the same packages installed and the same ./configure etc (even outside of conan), work on a non-docker ubuntu install.

qmake -> i get an error cannot find mkspec.

@conradjones
@cguentherTUChemnitz

Thanks for sharing all of this, indeed I also think we should all put our efforts together to provide the best packaging strategie for Qt. We were also aiming to build smallest possibles modules.

You can see the current Qt version https://github.com/bincrafters/conan-qt , there is a lot of opened issues and possibles improvments (a current pull request is trying to use the qt-everywhere-src instead of git bincrafters/conan-qt@c7fe15c)

I don't know what is the current statut of the Qt project hosted on bincrafters ? @solvingj wdyt, how should we proceed.

@conradjones yes you are right, that is exactly what is the purpose of the PR ๐Ÿ˜Š

So I started working on a binary package to test feasibility. From a packaging perspective it's not ideal, having to download the qt installer at multiple gigabytes and silently execute the installer.
The installer has a GUI

  • On linux docker, the installer must run under xvfb-run
  • MacOs if executing via ssh (jenkins agent etc) then the same user must be logged into the physical console
  • Windows works fine in windows docker.

As it's executing an installer it's not exactly leaving the CI machine in a clean state, for windows and linux this is ok as both OSs can be dockerized, MacOS would require a snapshoted VM and corresponding orchestration, which although possible has caveats under the Apple EULA.

I haven't finished the package yet,

https://github.com/TurboIT/conan-qtbinary/

the test_package executes okay on linux (again requires xvfb) and windows but not on MacOs yet due to the way the dylibs are named for MacOs

Consumer package not tested yet.

It's probably copying too many files at the package stage, I need to look at this.

Hi all. I am new to conan and I had a quick question. I've successfully used bincrafters's qt package to build a qt program. I was wondering if I could build/use a static qt build rather than the default dynamic build. I have set the option in conanfile.txt:

[requires]
Qt/5.11.0@bincrafters/stable

[generators]
cmake

[options]
Qt:shared=False

But this results in 100+ linker errors. I have a suspicion that this is not possible. I am currently using the mingw-w64-x86_64-qt5-static package from MSYS2 but I want to move off of MSYS2/MinGW. I might just settle for a dynamic qt build.

Hi @tgharib,

There are stil ongoing efforts to improve the Qt package from bincrafters. You can see the progress of the issues here: https://github.com/bincrafters/community/issues

Please report there & contribute to make the recipe better! Thanks ๐Ÿ˜„

Should be closed in favour of conan-io/conan-center-index#1833