aassif / pvr.freebox

Kodi + Freebox TV
MIT License
64 stars 24 forks source link

[Nexus] Change test builds to Kodi 20 Nexus, increase addon version to 20.0.0 and small cleanups #84

Closed AlwinEsch closed 3 years ago

AlwinEsch commented 3 years ago

About first commit, as there no more travis-ci.org available, change this it to use the github workflow about test build. The .travis.yml still leaved in for case as you change to use the new travis-ci.com. The last commit improves the debian packaging a bit.

After this request is in can you create a new branch for Nexus on this addon. There I will create two separate requests where set the build system to related Kodi versions.

Build system updated to Kodi 20 Nexus and addon Version increase to 20.0.0.

WARNING: Before request comes in, set it to new coming Nexus branch here.

AlwinEsch commented 3 years ago

With the update on nlohmann-json was come to test addon with C++17/20.

There is a strange error with all versions about (old and new) and brings:

[ 50%] Building CXX object CMakeFiles/pvr.freebox.dir/src/Freebox.cpp.o
/home/alwin/Development/Kodi/_Addons/_alwin/pvr/pvr.freebox/src/Freebox.cpp: In member function ‘bool Freebox::ProcessChannels()’:
/home/alwin/Development/Kodi/_Addons/_alwin/pvr/pvr.freebox/src/Freebox.cpp:879:42: error: cannot bind non-const lvalue reference of type ‘nlohmann::detail::iteration_proxy<nlohmann::detail::iter_impl<nlohmann::basic_json<> > >&’ to an rvalue of type ‘nlohmann::basic_json<>::iteration_proxy<nlohmann::detail::iter_impl<nlohmann::basic_json<> > >’ {aka ‘nlohmann::detail::iteration_proxy<nlohmann::detail::iter_impl<nlohmann::basic_json<> > >’}
  879 |       for (auto & [id, source] = d.items ())
      |                                  ~~~~~~~~^~
/home/alwin/Development/Kodi/_Addons/_alwin/pvr/pvr.freebox/src/Freebox.cpp:879:19: error: cannot decompose inaccessible member ‘nlohmann::detail::iteration_proxy<nlohmann::detail::iter_impl<nlohmann::basic_json<> > >::container’ of ‘nlohmann::detail::iteration_proxy<nlohmann::detail::iter_impl<nlohmann::basic_json<> > >’
  879 |       for (auto & [id, source] = d.items ())
      |                   ^~~~~~~~~~~~
In file included from /home/alwin/Development/Kodi/_Addons/_alwin/pvr/pvr.freebox/build/build/depends/include/kodi/../nlohmann/detail/conversions/to_json.hpp:12,
                 from /home/alwin/Development/Kodi/_Addons/_alwin/pvr/pvr.freebox/build/build/depends/include/kodi/../nlohmann/adl_serializer.hpp:7,
                 from /home/alwin/Development/Kodi/_Addons/_alwin/pvr/pvr.freebox/build/build/depends/include/kodi/../nlohmann/json.hpp:51,
                 from /home/alwin/Development/Kodi/_Addons/_alwin/pvr/pvr.freebox/src/Freebox.h:27,
                 from /home/alwin/Development/Kodi/_Addons/_alwin/pvr/pvr.freebox/src/Freebox.cpp:39:
/home/alwin/Development/Kodi/_Addons/_alwin/pvr/pvr.freebox/build/build/depends/include/kodi/../nlohmann/detail/iterators/iteration_proxy.hpp:125:38: note: declared private here
  125 |     typename IteratorType::reference container;
      |                                      ^~~~~~~~~
/home/alwin/Development/Kodi/_Addons/_alwin/pvr/pvr.freebox/src/Freebox.cpp:879:44: error: expected ‘;’ before ‘)’ token
  879 |       for (auto & [id, source] = d.items ())
      |                                            ^
      |                                            ;
/home/alwin/Development/Kodi/_Addons/_alwin/pvr/pvr.freebox/src/Freebox.cpp:879:44: error: expected primary-expression before ‘)’ token
/home/alwin/Development/Kodi/_Addons/_alwin/pvr/pvr.freebox/src/Freebox.cpp:879:44: error: expected ‘;’ before ‘)’ token
  879 |       for (auto & [id, source] = d.items ())
      |                                            ^
      |                                            ;
/home/alwin/Development/Kodi/_Addons/_alwin/pvr/pvr.freebox/src/Freebox.cpp:892:43: error: cannot bind non-const lvalue reference of type ‘nlohmann::detail::iteration_proxy<nlohmann::detail::iter_impl<nlohmann::basic_json<> > >&’ to an rvalue of type ‘nlohmann::basic_json<>::iteration_proxy<nlohmann::detail::iter_impl<nlohmann::basic_json<> > >’ {aka ‘nlohmann::detail::iteration_proxy<nlohmann::detail::iter_impl<nlohmann::basic_json<> > >’}
  892 |       for (auto & [id, quality] = d.items ())
      |                                   ~~~~~~~~^~
/home/alwin/Development/Kodi/_Addons/_alwin/pvr/pvr.freebox/src/Freebox.cpp:892:19: error: cannot decompose inaccessible member ‘nlohmann::detail::iteration_proxy<nlohmann::detail::iter_impl<nlohmann::basic_json<> > >::container’ of ‘nlohmann::detail::iteration_proxy<nlohmann::detail::iter_impl<nlohmann::basic_json<> > >’
  892 |       for (auto & [id, quality] = d.items ())
      |                   ^~~~~~~~~~~~~
In file included from /home/alwin/Development/Kodi/_Addons/_alwin/pvr/pvr.freebox/build/build/depends/include/kodi/../nlohmann/detail/conversions/to_json.hpp:12,
                 from /home/alwin/Development/Kodi/_Addons/_alwin/pvr/pvr.freebox/build/build/depends/include/kodi/../nlohmann/adl_serializer.hpp:7,
                 from /home/alwin/Development/Kodi/_Addons/_alwin/pvr/pvr.freebox/build/build/depends/include/kodi/../nlohmann/json.hpp:51,
                 from /home/alwin/Development/Kodi/_Addons/_alwin/pvr/pvr.freebox/src/Freebox.h:27,
                 from /home/alwin/Development/Kodi/_Addons/_alwin/pvr/pvr.freebox/src/Freebox.cpp:39:
/home/alwin/Development/Kodi/_Addons/_alwin/pvr/pvr.freebox/build/build/depends/include/kodi/../nlohmann/detail/iterators/iteration_proxy.hpp:125:38: note: declared private here
  125 |     typename IteratorType::reference container;
      |                                      ^~~~~~~~~
/home/alwin/Development/Kodi/_Addons/_alwin/pvr/pvr.freebox/src/Freebox.cpp:892:45: error: expected ‘;’ before ‘)’ token
  892 |       for (auto & [id, quality] = d.items ())
      |                                             ^
      |                                             ;
/home/alwin/Development/Kodi/_Addons/_alwin/pvr/pvr.freebox/src/Freebox.cpp:892:45: error: expected primary-expression before ‘)’ token
/home/alwin/Development/Kodi/_Addons/_alwin/pvr/pvr.freebox/src/Freebox.cpp:892:45: error: expected ‘;’ before ‘)’ token
  892 |       for (auto & [id, quality] = d.items ())
      |                                             ^
      |                                             ;
make[5]: *** [CMakeFiles/pvr.freebox.dir/build.make:63: CMakeFiles/pvr.freebox.dir/src/Freebox.cpp.o] Fehler 1
make[4]: *** [CMakeFiles/Makefile2:77: CMakeFiles/pvr.freebox.dir/all] Fehler 2
make[3]: *** [Makefile:152: all] Fehler 2
make[2]: *** [CMakeFiles/pvr.freebox.dir/build.make:114: pvr.freebox-prefix/src/pvr.freebox-stamp/pvr.freebox-build] Fehler 2
make[1]: *** [CMakeFiles/Makefile2:270: CMakeFiles/pvr.freebox.dir/all] Fehler 2
make: *** [Makefile:84: all] Fehler 2

On e.g. (see my added code comments):

#if __cplusplus >= 201703L
// ----------------------> In the set C++17 area comes the compile error if lib compiled in C++17
      for (auto & [id, quality] = d.items ())
        m_tv_prefs_quality.emplace (ChannelId (id), ParseQuality (quality));
#else
// ----------------------> If now used this on C++17/20 does it work with compiled lib on C++17/20
      for (auto & item : d.items ())
        m_tv_prefs_quality.emplace (ChannelId (item.key ()), ParseQuality (item.value ()));
#endif

There comes soon a update on Kodi where all addons becomes compiled with C++17 and thought to check before. Has leaved the version update in. If not OK I remove the commit.

AlwinEsch commented 3 years ago

If you want to reproduce you can set here https://github.com/xbmc/xbmc/blob/master/cmake/scripts/common/CompilerSettings.cmake the 14 to 17 or 20.

AlwinEsch commented 3 years ago

About the added OSX test build by github workflows seems the openssl (old and new) unhappy with the # include <inttypes.h>. There macos-11 and macos-10.5, on Jenkins where use macos-10.4 it works. Bad that OSX always change something on System headers :unamused:.

Will remove his test build on here :cry:.

aassif commented 3 years ago

Regarding the nlohmann_json issue, either it's a bug or a behaviour change. I think it should work if we force const auto & instead of auto &. I don't have the time to try today so feel free to check yourself if you can :)

AlwinEsch commented 3 years ago

Regarding the nlohmann_json issue, either it's a bug or a behaviour change. I think it should work if we force const auto & instead of auto &. I don't have the time to try today so feel free to check yourself if you can :)

No problem, will then play a bit with it and to find a way about :+1:

AlwinEsch commented 3 years ago

Have a look, unfortunately with the "const" it doesn't change either, crazy that it works with the old C++11 way.

AlwinEsch commented 3 years ago

This is one of the last addons that does not yet contain the Nexus branch and should see that the branch is added soon.

Maybe we can bring this request to the next Nexus branch and only the build update and version increase for the matrix? Since in Kodi Matrix it is based on C++14 and sticks to it, there would be no problems.

AlwinEsch commented 3 years ago

I switched the building scripts to Kodi Nexus and raised the version to 20.

Is this OK with you regarding version? It's about having the major equal to Kodi and taking the second number as the major in the addon. The background is to be able to more easily identify the add-on version of the associated Kodi version.

BIG NOTE:: First create a new Nexus branch and convert this request to it before it gets in :sweat_smile:.

phunkyfish commented 3 years ago

@aassif if you have time to look at this that would be great. There are PVR API changes for Nexus waiting to go in but we need to get the branching and versioning done first. Thanks in advance!

If we could get the Nexus branch created that would be a big help!!!

aassif commented 3 years ago

I can do it now but what should I do first? Last time, I messed up and created the branch before merging.

phunkyfish commented 3 years ago

@AlwinEsch does everything look good?

AlwinEsch commented 3 years ago

@AlwinEsch does everything look good?

Yes, also created now the API request for here https://github.com/aassif/pvr.freebox/pull/86.