Closed kloczek closed 4 days ago
Note the following issue happens with glibc 2.34 where it changed to:
* Add _SC_MINSIGSTKSZ and _SC_SIGSTKSZ. When _DYNAMIC_STACK_SIZE_SOURCE
or _GNU_SOURCE are defined, MINSIGSTKSZ and SIGSTKSZ are no longer
constant on Linux. MINSIGSTKSZ is redefined to sysconf(_SC_MINSIGSTKSZ)
and SIGSTKSZ is redefined to sysconf (_SC_SIGSTKSZ). This supports
dynamic sized register sets for modern architectural features like
Arm SVE.
Yes I can confirm that.
Here are the results .. I cannot apply https://github.com/onqtam/doctest/commit/099d5414e97244ec44cf46b14cd176b3a3dc52e3 on top of latest doctest
[tkloczko@barrel SPECS]$ rpmbuild -ba --with chech doctest.spec
warning: Downloading https://github.com/onqtam/doctest//archive/2.4.6/doctest-2.4.6.tar.gz to /home/tkloczko/rpmbuild/SOURCES/doctest-2.4.6.tar.gz
warning: Downloading https://github.com/onqtam/doctest//commit/099d5414.patch#/doctest-fixed-473-SIGSTKSZ-is-no-longer-a-constant-in-glibc-2.34.patch to /home/tkloczko/rpmbuild/SOURCES/doctest-fixed-473-SIGSTKSZ-is-no-longer-a-constant-in-glibc-2.34.patch
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.j6bXJz
+ umask 022
+ cd /home/tkloczko/rpmbuild/BUILD
+ cd /home/tkloczko/rpmbuild/BUILD
+ rm -rf doctest-2.4.6
+ /usr/bin/gzip -dc /home/tkloczko/rpmbuild/SOURCES/doctest-2.4.6.tar.gz
+ /usr/bin/tar -xof -
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd doctest-2.4.6
+ /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ /usr/bin/cat /home/tkloczko/rpmbuild/SOURCES/doctest-fixed-473-SIGSTKSZ-is-no-longer-a-constant-in-glibc-2.34.patch
+ /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
6 out of 6 hunks FAILED -- saving rejects to file doctest/doctest.h.rej
6 out of 6 hunks FAILED -- saving rejects to file doctest/parts/doctest.cpp.rej
and my my undestanding is that first I need fixed doctest before below will work as well
[tkloczko@barrel SPECS]$ rpmbuild -ba --with check --with failing_tests Box2D.spec
warning: Downloading https://github.com/erincatto/box2d//archive/v2.4.1/Box2D-2.4.1.tar.gz to /home/tkloczko/rpmbuild/SOURCES/Box2D-2.4.1.tar.gz
warning: Downloading https://github.com/erincatto/box2d//commit/95f74a46.patch#/Box2D-Remove-unnecessary-function-659.patch to /home/tkloczko/rpmbuild/SOURCES/Box2D-Remove-unnecessary-function-659.patch
warning: Downloading https://github.com/erincatto/box2d//commit/eb8b5356.patch#/Box2D-Typo-fix-684.patch to /home/tkloczko/rpmbuild/SOURCES/Box2D-Typo-fix-684.patch
warning: Downloading https://github.com/erincatto/box2d//commit/cd2c28db.patch#/Box2D-Update-doctest-version-682.patch to /home/tkloczko/rpmbuild/SOURCES/Box2D-Update-doctest-version-682.patch
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.PanIPw
+ umask 022
+ cd /home/tkloczko/rpmbuild/BUILD
+ cd /home/tkloczko/rpmbuild/BUILD
+ rm -rf box2d-2.4.1
+ /usr/bin/gzip -dc /home/tkloczko/rpmbuild/SOURCES/Box2D-2.4.1.tar.gz
+ /usr/bin/tar -xof -
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd box2d-2.4.1
+ /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ /usr/bin/cat /home/tkloczko/rpmbuild/SOURCES/Box2D-Remove-unnecessary-function-659.patch
+ /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
+ /usr/bin/cat /home/tkloczko/rpmbuild/SOURCES/Box2D-Typo-fix-684.patch
+ /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
+ /usr/bin/cat /home/tkloczko/rpmbuild/SOURCES/Box2D-Update-doctest-version-682.patch
+ /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
+ CFLAGS='-O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none'
+ CXXFLAGS='-O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -fno-rtti -fno-exceptions'
+ FFLAGS='-O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -I/usr/lib64/gfortran/modules'
+ FCFLAGS='-O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -I/usr/lib64/gfortran/modules'
+ LDFLAGS='-Wl,-z,relro -Wl,--as-needed -Wl,--gc-sections -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -flto=auto -flto-partition=none -fuse-linker-plugin'
+ CC=/usr/bin/gcc
+ CXX=/usr/bin/g++
+ FC=/usr/bin/gfortran
+ AR=/usr/bin/gcc-ar
+ NM=/usr/bin/gcc-nm
+ RANLIB=/usr/bin/gcc-ranlib
+ export CFLAGS CXXFLAGS FFLAGS FCFLAGS LDFLAGS CC CXX FC AR NM RANLIB
+ /usr/bin/cmake -B x86_64-redhat-linux-gnu -D BUILD_SHARED_LIBS=ON -D CMAKE_AR=/usr/bin/gcc-ar -D CMAKE_BUILD_TYPE=RelWithDebInfo -D CMAKE_C_FLAGS_RELEASE=-DNDEBUG -D CMAKE_CXX_FLAGS_RELEASE=-DNDEBUG -D CMAKE_Fortran_FLAGS_RELEASE=-DNDEBUG -D CMAKE_INSTALL_PREFIX=/usr -D CMAKE_NM=/usr/bin/gcc-nm -D CMAKE_RANLIB=/usr/bin/gcc-ranlib -D CMAKE_VERBOSE_MAKEFILE=ON -D DBUILD_SHARED_LIBS=ON -D INCLUDE_INSTALL_DIR=/usr/include -D LIB_INSTALL_DIR=/usr/lib64 -D LIB_SUFFIX=64 -D SHARE_INSTALL_PREFIX=/usr/share -D SYSCONF_INSTALL_DIR=/etc -S . -D BOX2D_BUILD_SHARED=ON -D BOX2D_BUILD_TESTBED=ON -D BOX2D_BUILD_UNIT_TESTS=ON -D BOX2D_INSTALL=ON
[..]
[ 35%] Building CXX object unit-test/CMakeFiles/unit_test.dir/math_test.cpp.o
cd /home/tkloczko/rpmbuild/BUILD/box2d-2.4.1/x86_64-redhat-linux-gnu/unit-test && /usr/bin/g++ -DB2_SHARED -I/home/tkloczko/rpmbuild/BUILD/box2d-2.4.1/src/../include -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -fno-rtti -fno-exceptions -DNDEBUG -fvisibility=hidden -fvisibility-inlines-hidden -std=c++11 -MD -MT unit-test/CMakeFiles/unit_test.dir/math_test.cpp.o -MF CMakeFiles/unit_test.dir/math_test.cpp.o.d -o CMakeFiles/unit_test.dir/math_test.cpp.o -c /home/tkloczko/rpmbuild/BUILD/box2d-2.4.1/unit-test/math_test.cpp
/home/tkloczko/rpmbuild/BUILD/box2d-2.4.1/unit-test/math_test.cpp: In function 'void _DOCTEST_ANON_FUNC_2()':
/home/tkloczko/rpmbuild/BUILD/box2d-2.4.1/unit-test/math_test.cpp:43:17: error: 'DOCTEST_REQUIRE_EQ' was not declared in this scope; did you mean 'FAST_REQUIRE_EQ'?
43 | DOCTEST_REQUIRE_EQ(transform.p.x, sweep.c0.x);
| ^~~~~~~~~~~~~~~~~~
| FAST_REQUIRE_EQ
gmake[2]: *** [unit-test/CMakeFiles/unit_test.dir/build.make:121: unit-test/CMakeFiles/unit_test.dir/math_test.cpp.o] Error 1
gmake[2]: Leaving directory '/home/tkloczko/rpmbuild/BUILD/box2d-2.4.1/x86_64-redhat-linux-gnu'
gmake[1]: *** [CMakeFiles/Makefile2:235: unit-test/CMakeFiles/unit_test.dir/all] Error 2
doctest-2.4.6 already has the changes so a patch wouldn't apply again (i.e. 2.4.6 is fixed), and currently this project also uses doctest-2.4.6 but doesn't have a new release with it yet (box2d-2.4.1 is still on doctest-2.3.7)
So you have a few options
-DBOX2D_BUILD_UNIT_TESTS=OFF
May have been simpler if this didn't bundle doctest and (at least optionally) used the system's
Issue is that doctrest even without that patch still does not build
[ 37%] Building CXX object examples/all_features/CMakeFiles/all_features.dir/stringification.cpp.o
cd /home/tkloczko/rpmbuild/BUILD/doctest-2.4.6/x86_64-redhat-linux-gnu/examples/all_features && /usr/bin/g++ -DDOCTEST_CONFIG_COLORS_NONE -DDOCTEST_CONFIG_NO_POSIX_SIGNALS -DDOCTEST_CONFIG_NO_WINDOWS_SEH -I/home/tkloczko/rpmbuild/BUILD/doctest-2.4.6/scripts/development_only -I/home/tkloczko/rpmbuild/BUILD/doctest-2.4.6/doctest/parts -I/home/tkloczko/rpmbuild/BUILD/doctest-2.4.6 -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -fno-rtti -Werror -fstrict-aliasing -pedantic -pedantic-errors -fvisibility=hidden -Wall -Wextra -fdiagnostics-show-option -Wconversion -Wold-style-cast -Wfloat-equal -Wlogical-op -Wundef -Wredundant-decls -Wshadow -Wstrict-overflow=5 -Wwrite-strings -Wpointer-arith -Wcast-qual -Wformat=2 -Wswitch-default -Wmissing-include-dirs -Wcast-align -Wswitch-enum -Wnon-virtual-dtor -Wctor-dtor-privacy -Wsign-conversion -Wdisabled-optimization -Weffc++ -Winvalid-pch -Wmissing-declarations -Woverloaded-virtual -Wunused-but-set-variable -Wunused-result -Wnoexcept -Wdouble-promotion -Wtrampolines -Wzero-as-null-pointer-constant -Wuseless-cast -Wvector-operation-performance -Wshift-overflow=2 -Wnull-dereference -Wduplicated-cond -Walloc-zero -Walloca -Wduplicated-branches -Wcast-align=strict -DNDEBUG -std=gnu++11 -MD -MT examples/all_features/CMakeFiles/all_features.dir/stringification.cpp.o -MF CMakeFiles/all_features.dir/stringification.cpp.o.d -o CMakeFiles/all_features.dir/stringification.cpp.o -c /home/tkloczko/rpmbuild/BUILD/doctest-2.4.6/examples/all_features/stringification.cpp
/home/tkloczko/rpmbuild/BUILD/doctest-2.4.6/examples/all_features/stringification.cpp: In function 'void _DOCTEST_ANON_FUNC_20()':
/home/tkloczko/rpmbuild/BUILD/doctest-2.4.6/examples/all_features/stringification.cpp:106:26: error: variable 'bla2' set but not used [-Werror=unused-but-set-variable]
106 | MyTypeInherited<int> bla2;
| ^~~~
cc1plus: all warnings being treated as errors
gmake[2]: *** [examples/all_features/CMakeFiles/all_features.dir/build.make:121: examples/all_features/CMakeFiles/all_features.dir/stringification.cpp.o] Error 1
gmake[2]: Leaving directory '/home/tkloczko/rpmbuild/BUILD/doctest-2.4.6/x86_64-redhat-linux-gnu'
gmake[1]: *** [CMakeFiles/Makefile2:263: examples/all_features/CMakeFiles/all_features.dir/all] Error 2
Looks like in this case LTO exposes new coding warning.
Here is the patch which fixes doctrest
--- a/examples/all_features/stringification.cpp~ 2021-03-22 12:05:04.000000000 +0000
+++ b/examples/all_features/stringification.cpp 2021-10-08 20:45:48.454488888 +0100
@@ -103,9 +103,6 @@
MyTypeInherited<int> bla1;
bla1.one = 5;
bla1.two = 4u;
- MyTypeInherited<int> bla2;
- bla2.one = 5;
- bla2.two = 6u;
Bar::Foo f1;
Bar::Foo f2;
I updated to doctest 2.4.7 in e76cf2d82792fbf915e42ae253f8a2ae252adbdf
Please file a new issue if that doesn't fix your problem.
Thanks, are you planning a release in a near future?
I updated to doctest 2.4.7 in e76cf2d
Please file a new issue if that doesn't fix your problem.
Just tested that patch and probably that is not all what needs to be applied because in my case build still fails on:
[ 33%] Building CXX object unit-test/CMakeFiles/unit_test.dir/math_test.cpp.o
cd /home/tkloczko/rpmbuild/BUILD/box2d-2.4.1/x86_64-redhat-linux-gnu/unit-test && /usr/bin/g++ -DB2_SHARED -I/home/tkloczko/rpmbuild/BUILD/box2d-2.4.1/src/../include -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -fno-rtti -fno-exceptions -DNDEBUG -fvisibility=hidden -fvisibility-inlines-hidden -std=c++11 -MD -MT unit-test/CMakeFiles/unit_test.dir/math_test.cpp.o -MF CMakeFiles/unit_test.dir/math_test.cpp.o.d -o CMakeFiles/unit_test.dir/math_test.cpp.o -c /home/tkloczko/rpmbuild/BUILD/box2d-2.4.1/unit-test/math_test.cpp
/home/tkloczko/rpmbuild/BUILD/box2d-2.4.1/unit-test/math_test.cpp: In function ‘void DOCTEST_ANON_FUNC_2()’:
/home/tkloczko/rpmbuild/BUILD/box2d-2.4.1/unit-test/math_test.cpp:43:17: error: ‘DOCTEST_REQUIRE_EQ’ was not declared in this scope; did you mean ‘FAST_REQUIRE_EQ’?
43 | DOCTEST_REQUIRE_EQ(transform.p.x, sweep.c0.x);
| ^~~~~~~~~~~~~~~~~~
| FAST_REQUIRE_EQ
make[2]: *** [unit-test/CMakeFiles/unit_test.dir/build.make:121: unit-test/CMakeFiles/unit_test.dir/math_test.cpp.o] Error 1
make[2]: Leaving directory '/home/tkloczko/rpmbuild/BUILD/box2d-2.4.1/x86_64-redhat-linux-gnu'
make[1]: *** [CMakeFiles/Makefile2:235: unit-test/CMakeFiles/unit_test.dir/all] Error 2
make[1]: Leaving directory '/home/tkloczko/rpmbuild/BUILD/box2d-2.4.1/x86_64-redhat-linux-gnu'
make: *** [Makefile:139: all] Error 2
Is there an issue for this on doctest? It doesn't seem like there is anything for me to fix.
I will put out a release if I have time to work through most of the issues.
I now have CI building on ubuntu GNU 9.3.0, Windows Visual Studio 2019, and macOS Clang 13. https://github.com/erincatto/box2d/actions
I'm not sure what platform is failing here and I don't think this is something I can fix so I'm going to close this issue again. Please let me know if you identify a fix in box2d code. If it is a doctest issue, please file an issue on that project. Once they make a fix, I will update box2d.
I'm not sure what platform is failing here and I don't think this is something I can fix so I'm going to close this issue again. Please let me know if you identify a fix in box2d code. If it is a doctest issue, please file an issue on that project. Once they make a fix, I will update box2d.
I'm usig Linux/x86_64
Just retested with current master and now build fails in more places.
Is it pssible to reopen this ticket? 🤔
Gentle ping .. any update? 🤔
Sorry, I've been working exclusively on version 3. Maybe I can do something to quickly fix this.
I'm hitting this barrier now too. I'll roll with disabling unit tests for now.
I think I'll need more info. Either it is a problem with doctest itself or a problem with the unit test. For example, I forced a unit test to fail and it prints out the values. I need this data.
\box2d\unit-test\math_test.cpp(43): FATAL ERROR: REQUIRE_EQ( transform.p.x, sweep.c0.x + 0.01f ) is NOT correct!
values: REQUIRE_EQ( -2, -1.99 )
This pull request has the latest version of doctest: https://github.com/erincatto/box2d/pull/763