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

Please update to Catch2 (2.13.5+) #12

Closed
slyon opened this issue Jan 18, 2022 · 3 comments
Closed

Please update to Catch2 (2.13.5+) #12

slyon opened this issue Jan 18, 2022 · 3 comments

Comments

@slyon
Copy link

slyon commented Jan 18, 2022

The catch1 library/test system is unmaintained and not compatible with glibc v2.34+ anymore.
SIGSTKSZ is not a constant anymore as of glibc 2.34+ – Catch2 has been updated to handle such situations (catchorg/Catch2#2178), while Catch1 remains unmaintained, which makes the tests of libpotassco fail to build on newer systems (e.g. Ubuntu 22.04).

In file included from /<<PKGBUILDDIR>>/clasp/libpotassco/tests/main.cpp:19:
/<<PKGBUILDDIR>>/clasp/libpotassco/tests/catch.hpp:6415:41: error: array bound is not an integer constant before ‘]’ token
 6415 |         static char altStackMem[SIGSTKSZ];
      |                                         ^
/<<PKGBUILDDIR>>/clasp/libpotassco/tests/catch.hpp: In constructor ‘Catch::FatalConditionHandler::FatalConditionHandler()’:
/<<PKGBUILDDIR>>/clasp/libpotassco/tests/catch.hpp:6434:30: error: ‘altStackMem’ was not declared in this scope
 6434 |             sigStack.ss_sp = altStackMem;
      |                              ^~~~~~~~~~~
/<<PKGBUILDDIR>>/clasp/libpotassco/tests/catch.hpp: At global scope:
/<<PKGBUILDDIR>>/clasp/libpotassco/tests/catch.hpp:6466:53: error: array bound is not an integer constant before ‘]’ token
 6466 |     char FatalConditionHandler::altStackMem[SIGSTKSZ] = {};
      |                                                     ^
@slyon slyon changed the title Please update to Catch2 Please update to Catch2 (2.13.5+) Jan 18, 2022
@rkaminsk
Copy link
Member

rkaminsk commented Jan 18, 2022

@BenKaufmann we should do this at some point. We should also change how catch is included. Version 3 is moving away from a single header include. Since we are using cmake, it is very easy to just add catch as a submodule or subtree and use it calling add_subdirectory. @slyon As a quick fix, you can probably just replace the catch header by the latest catch 2 header.

PS @BenKaufmann: I can also provide PRs but let's discuss first.

@slyon
Copy link
Author

slyon commented Jan 19, 2022

Thank you for the feedback! I've opted to patch the files to make use of the system provided catch library in Ubuntu, which is already modified to be compatible with glibc-2.34.

http://launchpadlibrarian.net/581088471/gringo_5.4.1-3ubuntu2_5.4.1-3ubuntu3.diff.gz
https://launchpad.net/ubuntu/+source/gringo/5.4.1-3ubuntu3

Going with a cmake submodule instead of the single header include sounds like a good path forward!

@BenKaufmann
Copy link
Contributor

Updated to catch v2.13.8 on dev branch.

@rkaminsk I'm fine with an upgrade to version 3 and a switch to a separate library. If you can provide corresponding PRs that would be even better 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants