alamminsalo / orion

Cross platform Twitch.tv client
GNU General Public License v3.0
315 stars 60 forks source link

orion(-git) won't build #253

Closed ahjolinna closed 5 years ago

ahjolinna commented 5 years ago

I tried to make a build for openSUSE (tumbleweed) using OBS, and it fails

[   99s] /usr/include/c++/8/bits/predefined_ops.h: In instantiation of 'bool __gnu_cxx::__ops::_Iter_pred<_Predicate>::operator()(_Iterator) [with _Iterator = __gnu_cxx::__normal_iterator<std::unique_ptr<QJSValue>*, std::vector<std::unique_ptr<QJSValue> > >; _Predicate = MpvObject::unobserveProperty(const QJSValue&)::<lambda(const int&)>]':
[   99s] /usr/include/c++/8/bits/stl_algo.h:869:13:   required from '_ForwardIterator std::__remove_if(_ForwardIterator, _ForwardIterator, _Predicate) [with _ForwardIterator = __gnu_cxx::__normal_iterator<std::unique_ptr<QJSValue>*, std::vector<std::unique_ptr<QJSValue> > >; _Predicate = __gnu_cxx::__ops::_Iter_pred<MpvObject::unobserveProperty(const QJSValue&)::<lambda(const int&)> >]'
[   99s] /usr/include/c++/8/bits/stl_algo.h:939:30:   required from '_FIter std::remove_if(_FIter, _FIter, _Predicate) [with _FIter = __gnu_cxx::__normal_iterator<std::unique_ptr<QJSValue>*, std::vector<std::unique_ptr<QJSValue> > >; _Predicate = MpvObject::unobserveProperty(const QJSValue&)::<lambda(const int&)>]'
[   99s] src/player/mpvobject.cpp:196:6:   required from here
[   99s] /usr/include/c++/8/bits/predefined_ops.h:283:11: error: no match for call to '(MpvObject::unobserveProperty(const QJSValue&)::<lambda(const int&)>) (std::unique_ptr<QJSValue>&)'
[   99s]   { return bool(_M_pred(*__it)); }
[   99s]            ^~~~~~~~~~~~~~~~~~~~
[   99s] src/player/mpvobject.cpp:189:90: note: candidate: 'MpvObject::unobserveProperty(const QJSValue&)::<lambda(const int&)>'
[   99s]      callbacks.erase(std::remove_if(callbacks.begin(), callbacks.end(), [&](auto const& cb){
[   99s]                                                                                           ^
[   99s] src/player/mpvobject.cpp:189:90: note:   no known conversion for argument 1 from 'std::unique_ptr<QJSValue>' to 'const int&'
[   99s] /usr/lib64/qt5/bin/moc -DAPP_VERSION=\"v1.6.6+git~20181015-147.1\" -DAPP_NAME=\"Orion\" -DMPV_PLAYER -DPLAYER_BACKEND=\"mpv\" -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_QUICKCONTROLS2_LIB -DQT_QUICK_LIB -DQT_GUI_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_DBUS_LIB -DQT_CORE_LIB --include '/home/abuild/rpmbuild/BUILD/orion-1.6.6+git~20181015/moc_predefs.h' -I/usr/lib64/qt5/mkspecs/linux-g++ -I'/home/abuild/rpmbuild/BUILD/orion-1.6.6+git~20181015' -I/usr/include/qt5 -I/usr/include/qt5/QtWidgets -I/usr/include/qt5/QtQuickControls2 -I/usr/include/qt5/QtQuick -I/usr/include/qt5/QtGui -I/usr/include/qt5/QtQml -I/usr/include/qt5/QtNetwork -I/usr/include/qt5/QtDBus -I/usr/include/qt5/QtCore -I/usr/include/c++/8 -I/usr/include/c++/8/x86_64-suse-linux -I/usr/include/c++/8/backward -I/usr/lib64/gcc/x86_64-suse-linux/8/include -I/usr/local/include -I/usr/lib64/gcc/x86_64-suse-linux/8/include-fixed -I/usr/x86_64-suse-linux/include -I/usr/include src/network/networkmanager.h -o moc_networkmanager.cpp
[   99s] make: *** [Makefile:954: mpvobject.o] Error 1
[   99s] make: *** Waiting for unfinished jobs....
[  103s] error: Bad exit status from /var/tmp/rpm-tmp.K15KRK (%build)
[  103s] 
[  103s] 
[  103s] RPM build errors:
[  103s]     Bad exit status from /var/tmp/rpm-tmp.K15KRK (%build)

https://build.opensuse.org/package/show/home:ahjolinna/orion

the whole build log file : link

ahjolinna commented 5 years ago

@mrgreywater it was after this got merged https://github.com/alamminsalo/orion/pull/252

PS. I'm not sure how it works with qml, but at least for "basic" Qt5 apps I do recommend using Clazy to test the code quality

mrgreywater commented 5 years ago

That code is valid c++14. Both the osx and windows build are compiling, see appveyor and travis ci.

Seems like the orion.pro build file only configures for c++11, so changing CONFIG += c++11 to CONFIG += c++14 in the orion.pro build file might be enough to make it compile for you. Anyway I'll look into the build configuration on linux.

If that doesn't help, whatever compiler you're using doesn't seem to deduce the auto type correctly. I'll look into adding a linux build in travis and add a appimage artifact.

Thanks for letting me know.

ahjolinna commented 5 years ago

@mrgreywater : I use openSUSE OBS to build my pkgs, and it support many linux distros ..not just SUSE, for example SailfishOS / mer use it and oc many other

OBS: https://openbuildservice.org

ahjolinna commented 5 years ago

also I use default GCC(++), I haven't tried clang/llvm (which I do like more)

anyway, I do recommend to use Clazy for checking your Qt5 apps

mrgreywater commented 5 years ago

Thanks for showing me Clazy, but this is not a code issue, this is a build configuration issue. As I said, I'll look into it soon.

ahjolinna commented 5 years ago

I got that, but I just wanted to mention Clazy as a tip at least

ahjolinna commented 5 years ago

@mrgreywater I added that 'patch' and I get this build error now with openSUSE leap 15* , but the tumbleweed (rolling) version did build just fine

*leap 15 uses Qt5.9 (LTS), compare to tumbleweed that oc has the latest Qt5

PS. obs also has appimage support, which is great if you don't want to do local building or if you don't have/use linux you can at least check that it builds

ahjolinna commented 5 years ago

also now when I try to open orion , it crashes:

(edit/update): I forgot that I had a major nvidia driver (410.66) update which caused the crash (this happens sometimes)

ahjolinna commented 5 years ago

@mrgreywater : I tried adding openssl (or/and libopenssl1_0_0) and the leap 15 (with Qt5.9) still fails to build, same error

mrgreywater commented 5 years ago

Sorry, I didn't see that hidden second error log there: https://paste.kde.org/pzzkxcdfs/1d4rq9/raw

-I/usr/lib64/qt5/mkspecs/linux-g++ -o channellistmodel.o src/model/channellistmodel.cpp
[   49s] In file included from src/main.cpp:43:0:
[   49s] src/player/mpvobject.h:10:10: fatal error: mpv/render_gl.h: No such file or directory
[   49s]  #include <mpv/render_gl.h>
[   49s]           ^~~~~~~~~~~~~~~~~
[   49s] compilation terminated.
[   49s] make: *** [Makefile:791: main.o] Error 1

This just means your libmpv-dev package is out of date. mpv added a new render api and deprecated their old one (opengl-cb) in mpv 0.28.0, so you need to either find an up-to-date libmpv-dev package, or compile your own (see ci/build_mpv.sh )

ahjolinna commented 5 years ago

@mrgreywater : well unfortunately mpv 0.28.x requires ffmpeg4.x and leap 15 has the older 3.4.4 and so does many other LTS distros, so do you think it would be possible to add "backwards compatibility" for those users?

because I don't think adding ffmpeg4 would work (or at least an ideal solution) as it could break the distro or at least many other apps, yes I could pkgs so that you can have both version....but still.

mrgreywater commented 5 years ago

Similarly to what I do in travis, you could potentially use these scripts https://github.com/mpv-player/mpv-build to compile and build ffmpeg and libmpv to a static library, so they are all included in the final orion binary. Alternatively compile ffmpeg static, and mpv shared (so the libmpv.so contains the ffmpeg binary), and distribute your own up-to-date libmpv package for openSUSE. Adding back support for the old deprecated API is not the right solution imo.

ahjolinna commented 5 years ago

personally I do hate that both ffmpeg and mpv keep breaking their APIs so much/easily (just plain laziness and lack of discipline). I think it's sad that LTS distros can loose support of some apps because of this.

Having two version of ffmpeg/mpv isn't an ideal or good solution, just because it works it doesn't mean it you should do it...just a lazy way out of a problem.

for now orion is part of the official suse repos I wonder if openSUSE team will remove the leap 15 version because of this(same with or other LTS distros)...or either they may keep the old version as long as it works and then remove it

mrgreywater commented 5 years ago

Well it's the genesis of mpv to remove old parts and only keep what's new and actually needed. And to their defense, they haven't actually removed the old api, just deprecated it.

Personally I also think the real problem here is that those distributions don't keep their packages updated, and keep distributing old versions, even if there doesn't seem to be any reason to do so.

Anyway, I'll bring back the old code with a mpv version check to choose between the APIs.

ahjolinna commented 5 years ago

well at least with openSUSE leap (15 forward) does share it's core pkgs with SUSE enterprise, so this is one of the reason why those pkgs won't get any major updates ...for the other LTS distros it also just comes down to having a well tested system.

personally I like the "semi-rolling" update model the most, it's what for example chakraOS is using.....I think Jolla's SailfishOS kinda uses that model ...and with mer as their "rolling" base

ahjolinna commented 5 years ago

@XenonPK any input? assuming this is you https://build.opensuse.org/user/show/xenonpk (because of this https://build.opensuse.org/package/revisions/games:tools/orion)

mrgreywater commented 5 years ago

added opengl-cb backward compatibility to #258

ahjolinna commented 5 years ago

@mrgreywater : thanks, it builds now...so I will close this