janbar / noson-app

The essential to control music from your SONOS devices on Linux platforms
GNU General Public License v3.0
335 stars 28 forks source link

Not building on Arch Linux #191

Closed alba4k closed 1 year ago

alba4k commented 1 year ago

While trying to build the program, I get a couple of errors due to weirdly organized code:

[ 11%] Building CXX object backend/lib/noson-build/CMakeFiles/noson.dir/src/private/uriparser.cpp.o
/home/alba4k/.cache/paru/clone/noson-app/src/build/backend/lib/noson-src/noson/src/private/builtin.c: In function ‘__timetz’:
/home/alba4k/.cache/paru/clone/noson-app/src/build/backend/lib/noson-src/noson/src/private/builtin.c:409:31: warning: ‘%2.2d’ directive writing between 2 and 5 bytes into a region of size 3 [-Wformat-overflow=]
  409 |   sprintf(tz->tz_str, "%+2.2d:%2.2d", tz->tz_dir * tz->tz_hour, tz->tz_min);
      |                               ^~~~~
/home/alba4k/.cache/paru/clone/noson-app/src/build/backend/lib/noson-src/noson/src/private/builtin.c:409:23: note: directive argument in the range [-1379, 1379]
  409 |   sprintf(tz->tz_str, "%+2.2d:%2.2d", tz->tz_dir * tz->tz_hour, tz->tz_min);
      |                       ^~~~~~~~~~~~~~
In file included from /usr/include/stdio.h:906,
                 from /home/alba4k/.cache/paru/clone/noson-app/src/build/backend/lib/noson-src/noson/src/private/builtin.h:35,
                 from /home/alba4k/.cache/paru/clone/noson-app/src/build/backend/lib/noson-src/noson/src/private/builtin.c:22:
In function ‘sprintf’,
    inlined from ‘__timetz’ at /home/alba4k/.cache/paru/clone/noson-app/src/build/backend/lib/noson-src/noson/src/private/builtin.c:409:3:
/usr/include/bits/stdio2.h:30:10: note: ‘__builtin___sprintf_chk’ output between 7 and 10 bytes into a destination of size 7
   30 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   31 |                                   __glibc_objsize (__s), __fmt,
      |                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   32 |                                   __va_arg_pack ());
      |                                   ~~~~~~~~~~~~~~~~~
[ 12%] Building CXX object backend/lib/noson-build/CMakeFiles/noson.dir/src/private/wscontent.cpp.o
[ 46%] Building CXX object backend/lib/noson-build/CMakeFiles/noson.dir/src/sonossystem.cpp.o
In file included from /home/alba4k/.cache/paru/clone/noson-app/src/build/backend/lib/noson-src/noson/src/sonossystem.cpp:31:
/home/alba4k/.cache/paru/clone/noson-app/src/build/backend/lib/noson-src/noson/src/private/os/threads/timeout.h: In function ‘int64_t SONOS::OS::__gettime_ms()’:
/home/alba4k/.cache/paru/clone/noson-app/src/build/backend/lib/noson-src/noson/src/private/os/threads/timeout.h:58:19: error: ‘CLOCK_MONOTONIC’ was not declared in this scope
   58 |     clock_gettime(CLOCK_MONOTONIC, &time);
      |                   ^~~~~~~~~~~~~~~
/home/alba4k/.cache/paru/clone/noson-app/src/build/backend/lib/noson-src/noson/src/private/os/threads/timeout.h:58:19: note: the macro ‘CLOCK_MONOTONIC’ had not yet been defined
In file included from /usr/include/time.h:33,
                 from /home/alba4k/.cache/paru/clone/noson-app/src/build/backend/lib/noson-src/noson/src/private/builtin.h:34,
                 from /home/alba4k/.cache/paru/clone/noson-app/src/build/backend/lib/noson-src/noson/src/sonossystem.cpp:33:
/usr/include/bits/time.h:48: note: it was later defined here
   48 | # define CLOCK_MONOTONIC                1
      | 
/home/alba4k/.cache/paru/clone/noson-app/src/build/backend/lib/noson-src/noson/src/private/os/threads/timeout.h:58:5: error: ‘clock_gettime’ was not declared in this scope
   58 |     clock_gettime(CLOCK_MONOTONIC, &time);
      |     ^~~~~~~~~~~~~
[ 47%] Linking CXX executable noson-gui
[ 47%] Building CXX object backend/lib/noson-build/CMakeFiles/noson.dir/src/sonostypes.cpp.o
make[2]: *** [backend/lib/noson-build/CMakeFiles/noson.dir/build.make:692: backend/lib/noson-build/CMakeFiles/noson.dir/src/sonossystem.cpp.o] Errore 1
make[2]: *** Attesa per i processi non terminati....
[ 48%] Building CXX object backend/NosonMediaScanner/CMakeFiles/NosonMediaScanner.dir/mediascanner.cpp.o

The compilation then proceeds until 70%, where it fails due to a makefile error (2)

Is this a known issues? experiencing on multiple machines

I might look into the code when I get back from holiday, but I think this would still be an issue

Hopefully I can help more, let me know! :)

janbar commented 1 year ago

Hi,

alba4k commented 1 year ago

on both machines, a fully up to date arch system

maybe try in a vm?

EvyBongers commented 1 year ago

I use Arch Linux too and ran into the same error. On another one of my systems, I did successfully upgrade to noson 5.2.2 on 28 July (originally installed 4.4.9 through AUR and upgrading from there). Doing a clean build of the package on that machine, I now get the same error. Therefore I'm led to believe that some library changed, causing the build to error now.

alba4k commented 1 year ago

Same here

In case anybody is experiencing the same, try to extract this folder and copy everything in the correct subdirectories (cp -r /path/to/folder/usr/* /usr/, it should contain everything I was able to find on the old machine with the package installed that is needed).

I was able to install it on my new computer this way and it's working as intended, except it's obviously not managed by a package manager

noson.zip

janbar commented 1 year ago

On ubuntu 23 (development release) , the build fails with the same issue. I guess some system headers (time.h) have been updated in the recent linux distribution. It could be a bug too. It should be tracked.

Also, you could install the AppImage , which is provided in assets from the "Release" page. It should work on any Linux.

janbar commented 1 year ago

I updated the master branch to fix this issue. The change include explicitly the header for Linux.

baurmatt commented 1 year ago

(I'm the maintainer of the Arch AUR package)

I've just updated the package to 5.3.2-1 and built it locally without any issues.

alba4k commented 1 year ago

I just also succeesfully installed it (after obviously needing to remove the stuff that I had installed manually, but that was just a sudo rm -rf /usr/*noson* away)

Thanks a lot for fixing this issue, I'm pretty sure it can be closed as completed :)

Again, thanks a lot for continuing to support this wonderful project @janbar !

Only feedback I could give, the pulseaudio audio sharing has quite some latency, but for everything else, this app is awesome!