Closed yuelimv closed 1 year ago
Hi @yuelimv, thanks for your contribution! I'm not sure that I follow - why not download and compile cares as a static library? It doesn't compile? Maybe we can patch its makefile somehow, like we do for other archs?
Re/ libunwind - I never really used macos, but I read online that it's possible to install, perhaps we could better detect that somehow instead of always disabling it?
hi @chakaz
Hi @yuelimv, thanks for your contribution! I'm not sure that I follow - why not download and compile cares as a static library? It doesn't compile? Maybe we can patch its makefile somehow, like we do for other archs?
Without this patch, the current implementation download a copy of
libcares
, build it. But for some reason, the one built on mac always asks forlibresolv
as part of the dependencies, which I couldn't find the way to install. This will need further investigation to see how the library can be configured not to require such dependency.Re/ libunwind - I never really used macos, but I read online that it's possible to install, perhaps we could better detect that somehow instead of always disabling it?
Yes that is possible... Apple has a proprietary version that ships together with macOS... for instance, I can find it under /opt/local/lib, and it might also be possible to install a copy through mac ports. At least manually editing build.ninja to use the correct library path will make it work. But I felt doing so might require some more changes to cmake files comparing to this change.
Could you explain the benefit of keeping libunwind on macOS? I actually don't quite understand its full purpose. But according to @romange libunwind current introduces bugs that slows down exception handling... it was turned off in release mode for dragonfly
From what I googled, vanilla libunwind seems does not have macOS support according to discussions on their mailing list. As a matter of fact, I couldn't make it compile on macos.
Hi @chakaz - I've been discussing about this change with @yuelimv offline. I do not consider libunwind as a required feature. We use it only for improving the quality of CPU profiling. Regarding libcares - I think it's fine to use the distribution library: libcares is mature enough and for now we want to get something simple that works, and using a system lib seems to fit the profle :)
This patch uses
libcares
installed by homebrew on macOS instead. The previous libcares built from the original source seems have extra dependencies on-lresolv
when helio is built on a mac, which seems to unnecessary.CMakeLists.txt is modified to turn off
libunwind
. An alternative way is to pass a flag toblaze.sh
orcmake
insideblaze.sh
, for instance:./blaze.sh -ninja -release -DWITH_UNWIND=OFF
Furthermore, we need to avoid linking against
librt
on macOS. This has just been done in another PRhttps://github.com/romange/helio/pull/97
Tested on macOS Big Sur 11.7.7