Skip to content

Commit 96b943b

Browse files
mgornySkylion007henryiii
authored
tests: update catch to 2.13.5 to fix glibc 2.34 failures (#3679)
* Download catch for MinGw * Fix rest of MinGW * fix: update catch to 2.13.5 to fix glibc 2.34 failures Update the downloaded Catch version to 2.13.5, in order to fix build failure on glibc 2.34: ``` In file included from /usr/include/signal.h:328, from /tmp/pybind11/.nox/tests-3-9/tmp/tests/catch/catch.hpp:8030, from /tmp/pybind11/tests/test_embed/catch.cpp:13: /tmp/pybind11/.nox/tests-3-9/tmp/tests/catch/catch.hpp:10818:58: error: call to non-‘constexpr’ function ‘long int sysconf(int)’ 10818 | static constexpr std::size_t sigStackSize = 32768 >= MINSIGSTKSZ ? 32768 : MINSIGSTKSZ; | ^~~~~~~~~~~ In file included from /usr/include/python3.9/Python.h:36, from /tmp/pybind11/include/pybind11/detail/common.h:215, from /tmp/pybind11/include/pybind11/pytypes.h:12, from /tmp/pybind11/include/pybind11/cast.h:13, from /tmp/pybind11/include/pybind11/attr.h:13, from /tmp/pybind11/include/pybind11/pybind11.h:13, from /tmp/pybind11/include/pybind11/embed.h:12, from /tmp/pybind11/tests/test_embed/catch.cpp:4: /usr/include/unistd.h:640:17: note: ‘long int sysconf(int)’ declared here 640 | extern long int sysconf (int __name) __THROW; | ^~~~~~~ In file included from /tmp/pybind11/tests/test_embed/catch.cpp:13: /tmp/pybind11/.nox/tests-3-9/tmp/tests/catch/catch.hpp:10877:45: error: size of array ‘altStackMem’ is not an integral constant-expression 10877 | char FatalConditionHandler::altStackMem[sigStackSize] = {}; | ^~~~~~~~~~~~ ``` The newest Catch version cannot be used yet because of regression: catchorg/Catch2#2364 * fix: add option for _ check, only define on pybind11 * Revert "fix: add option for _ check, only define on pybind11" This reverts commit 86817db. * fix: only undef _ for catch cpp creation. Co-authored-by: Aaron Gokaslan <[email protected]> Co-authored-by: Henry Schreiner <[email protected]>
1 parent 94a9487 commit 96b943b

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

.github/workflows/ci.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -914,7 +914,7 @@ jobs:
914914
- name: Configure C++11
915915
# LTO leads to many undefined reference like
916916
# `pybind11::detail::function_call::function_call(pybind11::detail::function_call&&)
917-
run: cmake -G "MinGW Makefiles" -DCMAKE_CXX_STANDARD=11 -S . -B build
917+
run: cmake -G "MinGW Makefiles" -DCMAKE_CXX_STANDARD=11 -DDOWNLOAD_CATCH=ON -S . -B build
918918

919919
- name: Build C++11
920920
run: cmake --build build -j 2
@@ -932,7 +932,7 @@ jobs:
932932
run: git clean -fdx
933933

934934
- name: Configure C++14
935-
run: cmake -G "MinGW Makefiles" -DCMAKE_CXX_STANDARD=14 -S . -B build2
935+
run: cmake -G "MinGW Makefiles" -DCMAKE_CXX_STANDARD=14 -DDOWNLOAD_CATCH=ON -S . -B build2
936936

937937
- name: Build C++14
938938
run: cmake --build build2 -j 2
@@ -950,7 +950,7 @@ jobs:
950950
run: git clean -fdx
951951

952952
- name: Configure C++17
953-
run: cmake -G "MinGW Makefiles" -DCMAKE_CXX_STANDARD=17 -S . -B build3
953+
run: cmake -G "MinGW Makefiles" -DCMAKE_CXX_STANDARD=17 -DDOWNLOAD_CATCH=ON -S . -B build3
954954

955955
- name: Build C++17
956956
run: cmake --build build3 -j 2

tests/test_embed/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ if("${PYTHON_MODULE_EXTENSION}" MATCHES "pypy" OR "${Python_INTERPRETER_ID}" STR
77
return()
88
endif()
99

10-
find_package(Catch 2.13.2)
10+
find_package(Catch 2.13.5)
1111

1212
if(CATCH_FOUND)
1313
message(STATUS "Building interpreter tests using Catch v${CATCH_VERSION}")

tests/test_embed/catch.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99
# pragma warning(disable: 4996)
1010
#endif
1111

12+
// Catch uses _ internally, which breaks gettext style defines
13+
#ifdef _
14+
#undef _
15+
#endif
16+
1217
#define CATCH_CONFIG_RUNNER
1318
#include <catch.hpp>
1419

0 commit comments

Comments
 (0)