boostorg / stacktrace

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

CMake: add Boost::stacktrace ALIAS target for platform defaults #167

Closed leha-bot closed 2 months ago

coveralls commented 2 months ago

Coverage Status

coverage: 86.35%. remained the same when pulling e512d7c8ce7cef78fb7316100e540355edc02010 on leha-bot:feat/cmake-alias-target into 66c0f7a54fe8d47e3ecae40a7fe56d9042ec19ec on boostorg:develop.

coveralls commented 2 months ago

Coverage Status

coverage: 86.35%. remained the same when pulling 30b472ba350c5fee8bcf9cccc1363d4d465fef7c on leha-bot:feat/cmake-alias-target into 66c0f7a54fe8d47e3ecae40a7fe56d9042ec19ec on boostorg:develop.

pdimov commented 2 months ago

This change breaks the CMake build: https://github.com/boostorg/boost/actions/runs/9594246969/job/26456395308

pdimov commented 2 months ago

Instead of

add_library(Boost::stacktrace ALIAS Boost::stacktrace_windbg)

use

add_library(Boost::stacktrace ALIAS boost_stacktrace_windbg)

and similarly for the other two.

pdimov commented 2 months ago

Also, you need to add CMake jobs to your CI.

pdimov commented 2 months ago

Can this please be fixed? It's breaking my boostorg/cmake CI and interfering with my work.

leha-bot commented 2 months ago

Hello, yes, sorry; hotfix will be ready in no time. I actually want to ping you to ask about proper boost_install() usage, as I also want to expose it from Boost-config.cmake

leha-bot commented 2 months ago

https://github.com/boostorg/stacktrace/pull/168

@pdimov , may you show the example with CMake CI? I will contribute it also in another PR, thanks in advance.

pdimov commented 2 months ago

I actually want to ping you to ask about proper boost_install() usage, as I also want to expose it from Boost-config.cmake

This might not be easy because boost_install() has never been tested with ALIAS targets and probably doesn't work as-is.

pdimov commented 2 months ago

The Timer CI may be the best starting point

https://github.com/boostorg/timer/blob/develop/.github/workflows/ci.yml#L268-L601

because it's a compiled library (although macos-11 would need to be replaced with macos-14 because macos-11 is going away.)

leha-bot commented 2 months ago

Yes, thanks, will try to play on my own fork with both of them (boost_install() and CI), maybe will come up with some ideas about it. 👍

pdimov commented 2 months ago

For the boost_install() part, maybe the way to do it is to declare boost_stacktrace as an INTERFACE library that links to the corresponding boost_stacktrace_... one. (Boost::stacktrace will be an ALIAS to boost_stacktrace as usual.)

pdimov commented 2 months ago

I'm working on adding CI. Will look into the boost_stacktrace target next.

pdimov commented 2 months ago

Added CMake CI to develop.

pdimov commented 2 months ago

Added boost_stacktrace on a branch, but there are weird failures on macos-12 and macos-14. I'm not sure why they happen and what I need to do about them.

macos-12 is just this

/Users/runner/work/stacktrace/boost-root/libs/stacktrace/test/test.cpp(279): test 'boost::stacktrace::stacktrace(1, 1).size() == 1' failed in function 'int main()'
1 error detected.

(https://github.com/boostorg/stacktrace/actions/runs/9617263707/job/26528655980) whereas macos-14 is more convoluted and probably caused by inlining (https://github.com/boostorg/stacktrace/actions/runs/9617263707/job/26528657050).

pdimov commented 2 months ago

Added the Boost::stacktrace library (now properly installed and tested) to develop.