Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Travis QT5 #2108

Merged
merged 2 commits into from
Jun 21, 2015
Merged

Travis QT5 #2108

merged 2 commits into from
Jun 21, 2015

Conversation

lukas-w
Copy link
Member

@lukas-w lukas-w commented Jun 16, 2015

Adds a Travis job for compiling using Qt5.

@tresf
Copy link
Member

tresf commented Jun 16, 2015

For some reason it's failing on:

CMake Error at /usr/share/cmake-2.8/Modules/FindPkgConfig.cmake:266 (message):
  A required package was not found
Call Stack (most recent call first):
  /usr/share/cmake-2.8/Modules/FindPkgConfig.cmake:320 (_pkg_check_modules_internal)
  CMakeLists.txt:139 (PKG_CHECK_MODULES)
CMake Error at CMakeLists.txt:141 (MESSAGE):
  LMMS requires libsndfile1 and libsndfile1-dev >= 1.0.11 - please install,
  remove CMakeCache.txt and try again!

@midi-pascal
Copy link
Contributor

And under Ubuntu 12.04 32 bits:

CMake Error at src/CMakeLists.txt:12 (QT5_WRAP_UI):
  Unknown CMake command "QT5_WRAP_UI".
CMake Error at CMakeLists.txt:109 (FIND_PACKAGE):
  Could not find module FindQt5Xml.cmake or a configuration file for package
  Qt5Xml.
  Adjust CMAKE_MODULE_PATH to find FindQt5Xml.cmake or set Qt5Xml_DIR to the
  directory containing a CMake configuration file for Qt5Xml.  The file will
  have one of the following names:
    Qt5XmlConfig.cmake
    qt5xml-config.cmake
CMake Error at CMakeLists.txt:108 (FIND_PACKAGE):
  Could not find module FindQt5Widgets.cmake or a configuration file for
  package Qt5Widgets.
  Adjust CMAKE_MODULE_PATH to find FindQt5Widgets.cmake or set Qt5Widgets_DIR
  to the directory containing a CMake configuration file for Qt5Widgets.  The
  file will have one of the following names:
    Qt5WidgetsConfig.cmake
    qt5widgets-config.cmake
CMake Error at CMakeLists.txt:107 (FIND_PACKAGE):
  Could not find module FindQt5Gui.cmake or a configuration file for package
  Qt5Gui.
  Adjust CMAKE_MODULE_PATH to find FindQt5Gui.cmake or set Qt5Gui_DIR to the
  directory containing a CMake configuration file for Qt5Gui.  The file will
  have one of the following names:
    Qt5GuiConfig.cmake
    qt5gui-config.cmake
CMake Error at CMakeLists.txt:106 (FIND_PACKAGE):
  Could not find module FindQt5Core.cmake or a configuration file for package
  Qt5Core.
  Adjust CMAKE_MODULE_PATH to find FindQt5Core.cmake or set Qt5Core_DIR to
  the directory containing a CMake configuration file for Qt5Core.  The file
  will have one of the following names:
    Qt5CoreConfig.cmake
    qt5core-config.cmake
Machine: i686-linux-gnu
-- Target host is 32 bit
PROCESSOR: i686

@tresf
Copy link
Member

tresf commented Jun 16, 2015

My guess is we'd need a FindQt5Core.cmake or equivalent which is provided by QT5 normally, but precise doesn't have QT5, so perhaps https://launchpad.net/~ubuntu-sdk-team/+archive/ubuntu/ppa is needed.

@lukas-w
Copy link
Member Author

lukas-w commented Jun 16, 2015

@tresf This PR already adds that exact PPA. :)

I messed up the shell script syntax, that's why no packages were installed, including libsndfile-dev. Let's see if my last commit 1dfc300 fixes that.

@lukas-w
Copy link
Member Author

lukas-w commented Jun 16, 2015

In file included from /home/travis/build/LMMS/lmms/include/PlayHandle.h:32:0,
                 from /home/travis/build/LMMS/lmms/include/Mixer.h:75,
                 from /home/travis/build/LMMS/lmms/include/Controller.h:31,
                 from /home/travis/build/LMMS/lmms/include/Song.h:33,
                 from /home/travis/build/LMMS/lmms/plugins/HydrogenImport/HydrogenImport.cpp:11:
/home/travis/build/LMMS/lmms/include/ThreadableJob.h: In member function ‘ThreadableJob::ProcessingState ThreadableJob::state() const’:
/home/travis/build/LMMS/lmms/include/ThreadableJob.h:52:46: error: invalid cast from type ‘const QAtomicInt’ to type ‘int’

@softrabbit
Copy link
Member

I get those QAtomicInt errors on Qt 5.2, Ubuntu 14.04. Should be easy enough to sort them out.

@softrabbit
Copy link
Member

After those QAtomics were fixed (pull #2114), I'm at this point:

/home/travis/build/LMMS/lmms/src/core/base64.cpp: In function ‘QString base64::encode(const QVariant&)’:
/home/travis/build/LMMS/lmms/src/core/base64.cpp:41:17: error: variable ‘QDataStream out’ has initializer but incomplete type
/home/travis/build/LMMS/lmms/src/core/base64.cpp: In function ‘QVariant base64::decode(const QString&, QVariant::Type)’:
/home/travis/build/LMMS/lmms/src/core/base64.cpp:60:16: error: variable ‘QDataStream in’ has initializer but incomplete type
/home/travis/build/LMMS/lmms/src/core/base64.cpp:66:18: error: incomplete type ‘QDataStream’ used in nested name specifier

https://travis-ci.org/LMMS/lmms/jobs/67159276

I don't see that error on my system, so I'll hand the torch to anyone who wants to grab it 🔥

@tresf
Copy link
Member

tresf commented Jun 17, 2015

Both the QDataStream and QBuffer (QIODevice) APIs look similar enough from QT 4.8 to QT 5.4 for this to work as-is (they're nearly identical from what I'm reading).

Although, there is a big deprecated! warning in include/base64.h#L51.

Is there a chance we just need to explicitly add some includes, such as #include <QDataStream>? Or is this a matter of us hitting the deprecated part of the code?

-Tres

@softrabbit
Copy link
Member

Both the QDataStream and QBuffer (QIODevice) APIs look similar enough from QT 4.8 to QT 5.4 for this to work as-is (they're nearly identical from what I'm reading).

I think it's 5.0 that the Travis build uses that is the problem. I've built my branch with both 5.2 and 5.4.

@lukas-w
Copy link
Member Author

lukas-w commented Jun 18, 2015

While #2114 solves the issue of QAtomicInt's operator int missing in Qt 5.0, I think having too many of those '#ifdef's can become really ugly, and they're only going to become more.

So I vote we do one of the following, as I think supporting Qt4 and Qt5 (at least 5.0) at the same time is too much trouble:

  1. Drop Qt4 support and switch to Qt5. I'm not sure how much trouble this would cause deploying the update to Linux distros.
  2. If dropping Qt4 is too much trouble for users, don't support Qt5 until we can safely drop Qt4.
  3. Try it with Qt4 & Qt5.3+ only, as Qt5.3 at least fixes the missing atomic int operator. Getting Qt5.3 on Travis (Ubuntu 12.04) may be difficult, even Ubuntu 14.04 only contains Qt5.2, so switching to e.g. http://semaphoreci.com/ wouldn't help either.

@softrabbit
Copy link
Member

So I vote we do one of the following, as I think supporting Qt4 and Qt5 (at least 5.0) at the same time is too much trouble:

I agree on the Qt 5.0 thing, it feels a bit beta-ish. Or maybe there was some backlash against dropping features too many relied on, what do I know? 😄

Drop Qt4 support and switch to Qt5. I'm not sure how much trouble this would cause deploying the update to Linux distros.
If dropping Qt4 is too much trouble for users, don't support Qt5 until we can safely drop Qt4.

Those two are the same thing, only the timing is different... now or later? It's probably too late to drop Qt4 in 1.2, but for 1.3/2.0 it could be considered.

Try it with Qt4 & Qt5.3+ only, as Qt5.3 at least fixes the missing atomic int operator. Getting Qt5.3 on Travis (Ubuntu 12.04) may be difficult, even Ubuntu 14.04 only contains Qt5.2, so switching to e.g. http://semaphoreci.com/ wouldn't help either.

I'd say 5.2 is the version to target for now, regardless of what is done about Qt4 support. Ubuntu will support 14.04 until 2019, so it could be relevant for quite a while.

@midi-pascal
Copy link
Contributor

I would vote for 3 because:

  • Unbuntu 12.04 - which is still in LTS - comes with Qt 4.8
  • I installed Qt 5.4 - from qt.io - alongside and ported two medium-sized projects from Qt 4.8 to Qt 5.4. This has not been too difficult (not this much #ifdef QT_VERSION...) and almost no changes to the code itself. But these apps are not half the size of Lmms...
    My 2 cents.

@tresf
Copy link
Member

tresf commented Jun 18, 2015

@lukas-w, can't we just use a compat-style header with a single (or a few) #ifdefs and just wrap everything in the new QT5 syntax? We already do that for some win32 stuff (isnanf(), I think) and we only have a handful of compats to deal with.

@lukas-w
Copy link
Member Author

lukas-w commented Jun 18, 2015

@tresf We could try that, sure. But I can't, unfortunately. I only got a single ultrabook I'm working on that has very limited disk space and Qt 5.4 installed, which I need for other projects.

@lukas-w
Copy link
Member Author

lukas-w commented Jun 18, 2015

Those two are the same thing, only the timing is different... now or later?

Exactly. Thinking about it again, I don't see a problem with dropping Qt4 now (or after 1.2). Ubuntu isn't going to update to our next release, they'd only include it in their next version (15.10), and 15.04 already has Qt 5.4.
The bigger problem could be that not all developers may have Qt 5 available. (?)

Thoughts welcome, maybe I'm missing something important here.

@tresf
Copy link
Member

tresf commented Jun 18, 2015

@lukas-w, Travis should be able to handle the QT4.8 and QT5.0 jobs, no?

@midi-pascal
Copy link
Contributor

@lukas-w As a developer, it is no big deal getting Qt 5.4 for any platform
As I wrote above I got Qt 4.8 from Ubuntu 12.04 repo and installed Qt 5.4 from qt.io in a different directory so I can develop for both versions. I can choose the one I want from inside Qt Creator and I had no mismatch or Qt version conflict so far.
The sole problem I can see the one you have: disk space. A full Qt version is pretty big!

@lukas-w lukas-w force-pushed the travis-qt5 branch 2 times, most recently from 7cb949e to 4a3691f Compare June 21, 2015 13:00
@lukas-w
Copy link
Member Author

lukas-w commented Jun 21, 2015

Fixed and squashed commits. Merging. :)

lukas-w added a commit that referenced this pull request Jun 21, 2015
@lukas-w lukas-w merged commit 3136869 into master Jun 21, 2015
@lukas-w lukas-w deleted the travis-qt5 branch June 21, 2015 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants