boostorg / stacktrace

C++ library for storing and printing backtraces.
https://boost.org/libs/stacktrace
422 stars 69 forks source link

Library for getting stacktraces from arbitrary exceptions #147

Closed apolukhin closed 6 months ago

coveralls commented 8 months ago

Coverage Status

coverage: 92.462% (-0.1%) from 92.573% when pulling 9f4de7e1546af2d248264478ab7af4adfe13989c on from-exception into 3de5aea55430f88f53e9d7dd49e939b01547a744 on develop.

pdimov commented 6 months ago

This doesn't build on macOS

clang-darwin.compile.c++ bin.v2/libs/stacktrace/build/clang-darwin-13/release/cxxstd-11-iso/link-static/threading-multi/visibility-hidden/from_exception.o
In file included from libs/stacktrace/build/../src/from_exception.cpp:10:
./boost/stacktrace/safe_dump_to.hpp:37:31: error: no type named 'size_t' in namespace 'std'; did you mean simply 'size_t'?
    BOOST_STACKTRACE_FUNCTION std::size_t from_dump(const char* filename, native_frame_ptr_t* out_frames);
                              ^~~~~~~~~~~
                              size_t

and Windows

compile-c-c++ bin.v2\libs\stacktrace\build\msvc-14.2\release\link-static\threading-multi\from_exception.obj
from_exception.cpp
.\boost/stacktrace/safe_dump_to.hpp(37): error C2039: 'size_t': is not a member of 'std'
C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt\stddef.h(23): note: see declaration of 'std'

(https://github.com/boostorg/boost/actions/runs/7812285701/job/21309026607)

Your CI seems incomplete. :-)

pdimov commented 6 months ago

Now that this has been merged to master, it breaks the master build of Boost as well.

https://github.com/boostorg/boost/actions/runs/7863976420

apolukhin commented 6 months ago

Ouch. Fixing that...

apolukhin commented 6 months ago

Should be fixed in develop and master now

pdimov commented 6 months ago

Isn't, although the errors are different this time. :-)

https://github.com/boostorg/boost/actions/runs/7876917683

clang-darwin.compile.c++ bin.v2/libs/stacktrace/build/clang-darwin-13/release/cxxstd-11-iso/link-static/threading-multi/visibility-hidden/from_exception.o
In file included from libs/stacktrace/build/../src/from_exception.cpp:10:
In file included from ./boost/stacktrace/safe_dump_to.hpp:219:
./boost/stacktrace/detail/collect_unwind.ipp:33:2: error: "Boost.Stacktrace requires `_Unwind_Backtrace` function. Define `_GNU_SOURCE` macro or `BOOST_STACKTRACE_GNU_SOURCE_NOT_REQUIRED` if _Unwind_Backtrace is available without `_GNU_SOURCE`."
#error "Boost.Stacktrace requires `_Unwind_Backtrace` function. Define `_GNU_SOURCE` macro or `BOOST_STACKTRACE_GNU_SOURCE_NOT_REQUIRED` if _Unwind_Backtrace is available without `_GNU_SOURCE`."
 ^
1 error generated.

on macOS, and

compile-c-c++ bin.v2\libs\stacktrace\build\msvc-14.2\release\link-static\threading-multi\from_exception.obj
from_exception.cpp
libs\stacktrace\build\..\src\from_exception.cpp(13): fatal error C1083: Cannot open include file: 'dlfcn.h': No such file or directory

on Windows.

As I said you need Mac/Windows CI. :-)

apolukhin commented 6 months ago

There is a windows CI :)

https://github.com/boostorg/stacktrace/blob/f6d4e117cdfd4f08e5d534b7025afdfb15e9a0ae/.github/workflows/ci.yml#L109-L121

The failure is about something different. The library should not build at all at Windows, but it does. Looks like some error in my Jamfile, some b2 commands trigger the build

pdimov commented 6 months ago

I see nothing in the build/Jamfile that would prevent the library from building on Windows.

apolukhin commented 6 months ago

Oh, it does not build in tests because the tests for that particular library are disabled on Windows. However, that does not prevents from building the library itself.

My fault, fix is coming...