Using Qt 5 with CircleCI

The best way to install Qt5 is to add the following to your circle.yml file:

dependencies:
  pre:
    - sudo apt-get install apt -y
    - sudo add-apt-repository ppa:beineri/opt-qt542-trusty -y
    - sudo apt-get update -y; true
    - sudo apt-get install -y qt54webkit libwebkit-dev libgstreamer0.10-dev
    - echo "/opt/qt54/bin/qt54-env.sh" >> ~/.circlerc

The person who maintains the qt5 ppa for Precise periodically will bump the minor version and remove the previous file. If this happens simply change ppa:beineri/opt-qt542 to whatever the latest version is.

Additionally, if you want to install capybara-webkit with qt5, you need to run the following command.

QMAKE=/opt/qt54/bin/qmake bundle install
2 Likes

This kind of typing before bundle install seems annoying. Just

machine:
  environment:
    QMAKE: /opt/qt54/bin/qmake

in circle.yml + rebuild w/o cache

This doesn’t look like it’s working any longer. Is there a new suggestion?

Can you clarify what the problem is?

It was still showing the deprecation notice. Rebuilding with a cleared cache seemed to fix the problem.

1 Like

After setting up QT55 we’re experiencing an issue with some of our specs, but can’t find much on google about it. The error is:

Could not initialize GLX

Which then causes capybara-webkit to crash:

An error occurred in an after hook
Capybara::Webkit::CrashError: The webkit_server process crashed!
Broken pipe

It appears this maybe related to graphics drivers from some posts I found related to the error, but I’m not sure what to do about fixing them for ubuntu.

Are you able to SSH in and run this step manually to see if you get any additional logging somewhere?

It’s a weird error to me because we have the same specs running over the same code with just a slightly different html/css templates for a couple dozen themes, and the specs pass fine for all but 3 of the themes which end up with the GLX error causing them to fail. So QT55 appears to mostly work fine except in these few cases in the circle containers we can’t reproduce the errors in our dev enviornment. Will have to try SSH to see if that turns anything up for point of failure I guess was hoping people may have seen this GLX error before.

This is the first i’ve heard about the GLX error :frowning:

If you end up digging into this we would definitely appreciate any more details. Thank you!

I tried this and in trying to install libgstreamer0.10-dev I get E: Could not open file descriptor -1

Any ideas?

sudo apt-get install -y libgstreamer0.10-dev || true
Reading package lists… Done

(I’d put in the full log but I’m having trouble figuring out how to give log output and posting takes does something with the apt source links instead of keeping them verbatim. And then tells me I’m only allowed 2.

Hey guys,

as of this morning this solution fails with an error like this:

Err http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ trusty-updates/main libapt-pkg4.12 amd64 1.0.1ubuntu2.10
  404  Not Found [IP: 54.198.110.211 80]

Err http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ trusty-updates/main apt amd64 1.0.1ubuntu2.10
  404  Not Found [IP: 54.198.110.211 80]

Failed to fetch http://us-east-1.ec2.archive.ubuntu.com/ubuntu/pool/main/a/apt/libapt-pkg4.12_1.0.1ubuntu2.10_amd64.deb  404  Not Found [IP: 54.198.110.211 80]
Failed to fetch http://us-east-1.ec2.archive.ubuntu.com/ubuntu/pool/main/a/apt/apt_1.0.1ubuntu2.10_amd64.deb  404  Not Found [IP: 54.198.110.211 80]

I tried updating to the latest repository, but could not find a working solution.

Any hints?

Hi @toadle

I got this working again by putting

sudo apt-get update -y; true

at the beginning

Tim

Hey guys,

this still does not work for me. I use the exact same dependency-block as above. This this errors out as:

sudo apt-get install apt -y
Reading package lists... Done


Building dependency tree       


Reading state information... Done

The following packages were automatically installed and are no longer required:
  libmono-data-tds2.0-cil libmono-npgsql2.0-cil mono-4.0-service libperl-dev
  libmono-management4.0-cil libgail18
  libmono-system-data-services-client4.0-cil libmono-peapi2.0-cil
  libmono-compilerservices-symbolwriter4.0-cil libmono-simd2.0-cil
  libmono-system-net4.0-cil libmono-system-web-routing4.0-cil
  libmono-cscompmgd8.0-cil libmono-http4.0-cil libmono-sqlite2.0-cil
  libmono-cairo4.0-cil libmono-custommarshalers4.0-cil
  libmono-management2.0-cil libmono-system-dynamic4.0-cil monodoc-browser
  libmono-microsoft-build-tasks-v4.0-4.0-cil libmono-sharpzip4.84-cil
  mono-xbuild libmono-system-servicemodel-routing4.0-cil
  libmono-system-serviceprocess4.0-cil libmono-cairo2.0-cil
  libmono-system-data-services4.0-cil
  libmono-system-web-extensions-design4.0-cil libwebkitgtk-1.0-common
  libmono-microsoft-build-engine4.0-cil libmono-c5-1.1-cil
  libmono-system-messaging2.0-cil libclass-mix-perl libtasn1-3 libtasn1-3:i386
  libmono-codecontracts4.0-cil libmono-rabbitmq4.0-cil mono-csharp-shell
  libmono-profiler libjavascriptcoregtk-1.0-0 libmono-system-ldap4.0-cil
  libmono-messaging2.0-cil libmono-rabbitmq2.0-cil
  libmono-system-windows-forms-datavisualization4.0-cil libmono-ldap4.0-cil
  libmono-messaging-rabbitmq4.0-cil libclass-isa-perl
  libmono-system-drawing-design4.0-cil libmono-db2-1.0-cil
  libmono-opensystem-c4.0-cil libmono-system-data2.0-cil
  libmono-system-ldap2.0-cil libmono-sharpzip2.6-cil libglade2.0-cil
  libtasn1-3-dev libmono-ldap2.0-cil libmono-messaging-rabbitmq2.0-cil
  libmono-system-servicemodel-discovery4.0-cil
  libmono-system-web-dynamicdata4.0-cil libmono-relaxng4.0-cil mono-jay
  libwebkit1.1-cil libglib2.0-cil mono-2.0-gac libglade2-0
  libmono-system-componentmodel-composition4.0-cil
  libmono-microsoft-build-utilities-v4.0-4.0-cil mono-mcs monodoc-base
  libmono-system-design4.0-cil libmono-sharpzip2.84-cil
  libmono-webmatrix-data4.0-cil libswitch-perl libmono-relaxng2.0-cil
  libmono-system-data-datasetextensions4.0-cil mono-2.0-service
  libmono-microsoft-build2.0-cil libmono-system-servicemodel-web4.0-cil
  libmono-system-runtime-durableinstancing4.0-cil libmono-cecil-private-cil
  libmono-tasklets4.0-cil libmono-webbrowser2.0-cil
  libmono-system-numerics4.0-cil libmono-microsoft8.0-cil libwebkitgtk-1.0-0
  libmono-accessibility2.0-cil libmono-microsoft-visualc10.0-cil mono-dmcs
  libmono-system-web-abstractions4.0-cil monodoc-manual libmono-oracle4.0-cil
  libmono-tasklets2.0-cil libmono-2.0-dev libmono-system-management4.0-cil
  libgtk2.0-cil libmono-oracle2.0-cil libmono-npgsql4.0-cil libnunit-cil-dev
  libmono-peapi4.0-cil mono-gmcs libmono-simd4.0-cil libmono-2.0-1
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  libapt-pkg4.12
Suggested packages:
  apt-doc
The following packages will be upgraded:
  apt libapt-pkg4.12
2 upgraded, 0 newly installed, 0 to remove and 1343 not upgraded.
Need to get 1,590 kB of archives.
After this operation, 311 kB of additional disk space will be used.


Err http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ trusty-updates/main libapt-pkg4.12 amd64 1.0.1ubuntu2.10
  404  Not Found [IP: 54.144.108.75 80]

Err http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ trusty-updates/main apt amd64 1.0.1ubuntu2.10
  404  Not Found [IP: 54.144.108.75 80]

Failed to fetch http://us-east-1.ec2.archive.ubuntu.com/ubuntu/pool/main/a/apt/libapt-pkg4.12_1.0.1ubuntu2.10_amd64.deb  404  Not Found [IP: 54.144.108.75 80]
Failed to fetch http://us-east-1.ec2.archive.ubuntu.com/ubuntu/pool/main/a/apt/apt_1.0.1ubuntu2.10_amd64.deb  404  Not Found [IP: 54.144.108.75 80]

sudo apt-get install apt -y returned exit code 100

E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing? Action failed: sudo apt-get install apt -y

When I try to get the files myself. I also get a 404.

Any other hints?

When I look at this http://us-east-1.ec2.archive.ubuntu.com/ubuntu/pool/main/a/apt/ it seems correct.

libapt-pkg4.12_1.0.1ubuntu2.10_amd64.deb is now a libapt-pkg4.12_1.0.1ubuntu2.11_amd64.deb

@timdiggins: Thanks for your tip. Didn’t work the first time. Dunno why. But in the end, this is the right thing to do:

    - sudo apt-get update -y; true
    - sudo apt-get install apt -y
    - sudo add-apt-repository ppa:beineri/opt-qt542 -y
    - sudo apt-get update -y; true
    - sudo apt-get install -y qt54webkit libwebkit-dev libgstreamer0.10-dev
    - echo "/opt/qt54/bin/qt54-env.sh" >> ~/.circlerc
1 Like

FYI to all it seems like the best way to use QT5 is now to use the apparently experimental feature “ubuntu 14.04 (trusty)”: Ubuntu 14.04 (Trusty) container . This has has QT5 preinstalled. However we are getting sporadic failures on it on one project (am going to try out on another project). Have started a issue with capybara-webkit (https://github.com/thoughtbot/capybara-webkit/issues/890) to get insight and will investigate further, but would be useful to hear other peoples experiences here.

1 Like

Thanks for your notes, we are able to run our integration tests

Is there a way to bring down the time taken to install qt54webkit, i would expect this install to be cached. It takes 1:08 minutes for this step

There is no great way to cache apt packages, but there somewhat a solution in this post.

Ubuntu 14.04 Trusty is working great with qt5 preinstalled. Saves 1 minute on the build setup!

There’s one gotcha for capybara-webkit. gstreamer is required:

machine:
  pre: 
    - sudo apt-get install gstreamer1.0-plugins-base gstreamer1.0-tools gstreamer1.0-x
1 Like

Is this still correct?
I have added it to my circle.yml file but I get

E: Unable to locate package qt54webkit
sudo apt-get install -y qt54webkit libwebkit-dev libgstreamer0.10-dev returned exit code 100
Action failed: sudo apt-get install -y qt54webkit libwebkit-dev libgstreamer0.10-dev

The config file looks like

machine:
timezone:
Europe/Rome
ruby:
version: 2.2.3
environment:
QMAKE: /opt/qt54/bin/qmake

dependencies:
pre:
- sudo apt-get install apt -y
- sudo add-apt-repository ppa:beineri/opt-qt542-trusty -y
- sudo apt-get update -y; true
- sudo apt-get install -y qt54webkit libwebkit-dev libgstreamer0.10-dev
- echo “/opt/qt54/bin/qt54-env.sh” >> ~/.circlerc
override:
- gem install bundler
- bundle install

test:
override:
- bundle exec rspec spec/

Thanks