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

Build failure when Catch2 is installed in the system #2722

Closed
LukashonakV opened this issue Jul 20, 2023 · 1 comment · Fixed by #2742
Closed

Build failure when Catch2 is installed in the system #2722

LukashonakV opened this issue Jul 20, 2023 · 1 comment · Fixed by #2742
Labels
Building and Packaging Issues affecting build/packaging scripts and utilities Good First Issue Issues that can be undertaken by someone new to the project

Comments

@LukashonakV
Copy link

LukashonakV commented Jul 20, 2023

Describe the bug
Waybar application uses Catch2 as a subproject and has dependency on it. See Waybar test main.cpp. It includes Catch headers like: #include <catch2/catch_all.hpp>
When Catch2 is not installed in the system meson downloads and provides necessary dependencies for Catch2 subproject automatically. When Catch2 is installed in the system, meson provides necessary headers are installed in the system.
Then catch_all.hpp header includes #include <catch2/matchers/catch_matchers_all.hpp>. Then catch_matchers_all.hpp includes #include <catch2/matchers/catch_matchers_range_equals.hpp> .
If we check meson.build we don't see catch_matchers_range_equals.hpp header should be installed in the system. For Catch2 itself building and installation process it's not an issue.... but
When external Application is trying to use Catch2 as a library and tries to include #include <catch2/catch_all.hpp> it will get a compiler error due to by the chain builder will not find catch_matchers_range_equals.hpp due to according meson.build it won't been installed.

So for now with installed catch2 version 3.3.2 during Waybar build process we've got an error:
FAILED: test/waybar_test.p/main.cpp.o c++ -Itest/waybar_test.p -Itest -I../test -I../include -I/usr/include/gtkmm-3.0 -I/usr/lib64/gtkmm-3.0/include -I/usr/include/giomm-2.4 -I/usr/lib64/giomm-2.4/include -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/lib64/libffi/include -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glibmm-2.4 -I/usr/lib64/glibmm-2.4/include -I/usr/include/sigc++-2.0 -I/usr/lib64/sigc++-2.0/include -I/usr/include/gtk-3.0 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/fribidi -I/usr/include/cairo -I/usr/include/libpng16 -I/usr/include/pixman-1 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/gio-unix-2.0 -I/usr/include/atk-1.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -I/usr/include/cairomm-1.0 -I/usr/lib64/cairomm-1.0/include -I/usr/include/pangomm-1.4 -I/usr/lib64/pangomm-1.4/include -I/usr/include/atkmm-1.6 -I/usr/lib64/atkmm-1.6/include -I/usr/include/gtk-3.0/unix-print -I/usr/include/gdkmm-3.0 -I/usr/lib64/gdkmm-3.0/include -I/usr/include/jsoncpp -I/usr/include -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=c++17 -O3 '-DVERSION="0.9.19-29-gdffba784 (branch '"'"'master'"'"')"' -DHAVE_LANGINFO_1STDAY '-DSYSCONFDIR="//usr/local/etc"' -DHAVE_CPU_LINUX -DHAVE_MEMORY_LINUX -DHAVE_SWAY -DHAVE_WLR -DHAVE_RIVER -DHAVE_DWL -DHAVE_HYPRLAND -DHAVE_LIBNL -DHAVE_GAMEMODE -DHAVE_UPOWER -DHAVE_LIBPULSE -DHAVE_LIBJACK -DHAVE_LIBWIREPLUMBER -DHAVE_DBUSMENU -DHAVE_LIBUDEV -DHAVE_LIBEVDEV -DHAVE_LIBINPUT -DHAVE_GTK_LAYER_SHELL -DHAVE_GIO_UNIX -DHAVE_LIBDATE -DHAVE_LIBCAVA -DONLY_C_LOCALE=0 -DUSE_OS_TZDB=1 -DSPDLOG_SHARED_LIB -DSPDLOG_COMPILED_LIB -DSPDLOG_FMT_EXTERNAL -pthread -MD -MQ test/waybar_test.p/main.cpp.o -MF test/waybar_test.p/main.cpp.o.d -o test/waybar_test.p/main.cpp.o -c ../test/main.cpp In file included from /usr/include/catch2/catch_all.hpp:123, from ../test/main.cpp:7: /usr/include/catch2/matchers/catch_matchers_all.hpp:30:10: fatal error: catch2/matchers/catch_matchers_range_equals.hpp: No such file or directory 30 | #include <catch2/matchers/catch_matchers_range_equals.hpp> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ compilation terminated.

Expected behavior
External application should be built successful with catch2 dependencies

Reproduction steps

  1. Install catch2 into system
  2. Git clone Waybar project
  3. cd Waybar && make

Platform information:

  • OS: Linux 6.1.38-gentoo-x86_64 # 1 SMP PREEMPT_DYNAMIC Wed Jul 12 15:19:30 +03 2023 x86_64 12th Gen Intel(R) Core(TM) i7-1260P GenuineIntel GNU/Linux
  • Compiler+version: gcc (Gentoo 12.3.1_p20230526 p2) 12.3.1 20230526
  • Catch version: v3.3.2

Additional context

  1. Doesn't help Migrating from v2 to v3
  2. ISSUE2272.txt
@LukashonakV LukashonakV changed the title Build failure when Catch2 is iinstalled in the system Build failure when Catch2 is installed in the system Jul 20, 2023
@horenmar horenmar added the Building and Packaging Issues affecting build/packaging scripts and utilities label Jul 22, 2023
@horenmar
Copy link
Member

Should be easy enough to fix: PR is welcome (or it will have to wait until I get around to it).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Building and Packaging Issues affecting build/packaging scripts and utilities Good First Issue Issues that can be undertaken by someone new to the project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants