joshkunz / ashuffle

Automatic library-wide shuffle for mpd.
MIT License
76 stars 11 forks source link

Building v3.14.1 on OpenBSD 7.4 #226

Closed ghost closed 10 months ago

ghost commented 10 months ago

Building With:

I've followed the README and get to the step where I run ninja -C build install but the build fails with an error.

Build Error:

[172/185] Compiling C++ object libashuffle.a.p/src_args.cc.o
FAILED: libashuffle.a.p/src_args.cc.o 
c++ -Ilibashuffle.a.p -I. -I.. -I../src -Isubprojects/absl -I../subprojects/absl -Isubprojects/absl/__CMake_build -I../subprojects/absl/__CMake_build -I../subprojects/yaml-cpp/include -I../subprojects/yaml-cpp/src -Isubprojects/yaml-cpp/__CMake_build -I../subprojects/yaml-cpp/__CMake_build -Isubprojects/yaml-cpp -I../subprojects/yaml-cpp -fcolor-diagnostics -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=c++17 -O3 -Werror=switch -fno-omit-frame-pointer -fPIC -MD -MQ libashuffle.a.p/src_args.cc.o -MF libashuffle.a.p/src_args.cc.o.d -o libashuffle.a.p/src_args.cc.o -c ../src/args.cc
In file included from ../src/args.cc:17:
In file included from ../src/args.h:13:
../src/mpd.h:15:10: fatal error: 'mpd/idle.h' file not found
#include <mpd/idle.h>
         ^~~~~~~~~~~~
1 error generated.
[173/185] Compiling C++ object libashuffle.a.p/src_ashuffle.cc.o
FAILED: libashuffle.a.p/src_ashuffle.cc.o 
c++ -Ilibashuffle.a.p -I. -I.. -I../src -Isubprojects/absl -I../subprojects/absl -Isubprojects/absl/__CMake_build -I../subprojects/absl/__CMake_build -I../subprojects/yaml-cpp/include -I../subprojects/yaml-cpp/src -Isubprojects/yaml-cpp/__CMake_build -I../subprojects/yaml-cpp/__CMake_build -Isubprojects/yaml-cpp -I../subprojects/yaml-cpp -fcolor-diagnostics -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=c++17 -O3 -Werror=switch -fno-omit-frame-pointer -fPIC -MD -MQ libashuffle.a.p/src_ashuffle.cc.o -MF libashuffle.a.p/src_ashuffle.cc.o.d -o libashuffle.a.p/src_ashuffle.cc.o -c ../src/ashuffle.cc
../src/ashuffle.cc:17:10: fatal error: 'mpd/idle.h' file not found
#include <mpd/idle.h>
         ^~~~~~~~~~~~
1 error generated.

mpd/idle.h exists on my system at /usr/local/include/mpd/idle.h

joshkunz commented 10 months ago

Could you share the output of echo | c++ -xc++ -E -v - and the the file build/build.ninja? I'm not totally sure what is going on here, and this build issue will be system-dependent.

I think you could probably also work around this by passing -I /usr/local/include in the CXXFLAGS environment variable when invoking meson.

joshkunz commented 10 months ago

(having a space between the flag breaks it), I was able to build it just fine.)

Ah yeah. Sorry for recommending the wrong syntax.

Here are the two outputs you requested, from when the project isn't configured using the modified include flag:

So based on this output it looks like the search paths are:

#include <...> search starts here:
 /usr/include/c++/v1
 /usr/lib/clang/13.0.0/include
 /usr/include
End of search list.

This is system specified (either by the OS or your compiler), and it looks like your list doesn't include /usr/local/include, so the MPD headers there are not discovered.

That said, it's possible we should be discovering that include via pkg-config. Could you try applying this patch https://gist.github.com/joshkunz/e2c065d33f585892c50851e625dd25a4 and see if you can get a successful build then without the CXX flags?

ghost commented 10 months ago

Patch is good. With it, the project compiles without any other deviations from the README.

joshkunz commented 10 months ago

Thanks for testing! I'll patch that into the build a cut a new release once it passes CI.

joshkunz commented 10 months ago

Fix release cut: https://github.com/joshkunz/ashuffle/releases/tag/v3.14.3