cpptrace
cpptrace copied to clipboard
Compatibility for Homebrew Formula
First of all, thanks for this project! I've started using it (optionally, for now) in one of my projects.
While trying to build on macOS, I noticed that cpptrace isn't yet available in Homebrew. So I thought "how hard can it be" and started writing up a formula, which is currently on a dev branch.
While this works fine, there are a two issues:
ccacheis currently a hard dependency. I believe the issue here is that ifccachehappens to be installed, but it's not a dependency, then cmake will somehow find theccachebinary, but it won't be in thePATHwhile building. Making it a hard dependency will putccachein thePATH. This should be fixed by #184.- A more serious issue is that
libdwarf(the formula is calleddwarfutilsin Homebrew) must be found via pkgconfig, as the formula doesn't installed a CMake config. This is fine for just buildingcpptrace, but when usingcpptracefrom another CMake project viafind_package, thecpptrace::cpptracetarget will try to link-ldwarf, which it doesn't find because it doesn't recall the linker search path from buildingcpptrace. This should be fixable by adding the originalpkg_check_modulescall tocpptrace-config-cmake.inand making sure the dependency is correctly resolved. Maybe you have a better idea.
Hello! Thank you for opening this and taking the time to look into a homebrew formula!
Regarding libdwarf, unfortunately I'm not sure the best solution. Even with cmake this stuff is a pain (at least for me). I think what you are suggesting sounds reasonable. The current code checks for a configuration option due to something I encountered when packaging the library for conda.
https://github.com/jeremy-rifkin/cpptrace/blob/124dba5254bd4d396a2f48ab31aac5f6337000ac/cmake/in/cpptrace-config-cmake.in#L17-L19
And easy and safe solution would be to add something similar to facilitate homebrew. Using pkg_check_modules in the config file any time pkg_check_modules is used in the CMakeLists.txt could also be correct though I'd want to test that locally.
P.s.: Nice project, I think I've heard of DwarFS before :)
And easy and safe solution would be to add something similar to facilitate homebrew. Using
pkg_check_modulesin the config file any timepkg_check_modulesis used in the CMakeLists.txt could also be correct though I'd want to test that locally.
Cool, I'll see if I can play with this a bit and come up with a PR. I have the same problem in DwarFS and what I suggested is what worked for me.
P.s.: Nice project, I think I've heard of DwarFS before :)
Thanks! :)
cpptrace helped significantly in the investigation of a recent Windows-specific bug.
Hi, circling back on this have you had a chance to look at things again and do you know if issues persist?
Hi, circling back on this have you had a chance to look at things again and do you know if issues persist?
To be honest, I got busy with other stuff and completely forgot about this :(
Thanks for the reminder, I'll try to get back to it over the next few weeks!
Sorry, it's been a while.
Good news: I think the code might be fine as-is.
As long as cpptrace is built as a shared library, the dependency on libdwarf is resolved automatically. I've tested that everything works fine on macOS and have submitted a PR to homebrew for addition of cpptrace: https://github.com/Homebrew/homebrew-core/pull/251948