Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[package] boost/1.75.0: libunwind is only supported on Linux and FreeBSD #5556

Closed
jonathan-r-thorpe opened this issue May 18, 2021 · 15 comments · Fixed by #5577
Closed

[package] boost/1.75.0: libunwind is only supported on Linux and FreeBSD #5556

jonathan-r-thorpe opened this issue May 18, 2021 · 15 comments · Fixed by #5577
Labels
bug Something isn't working

Comments

@jonathan-r-thorpe
Copy link

jonathan-r-thorpe commented May 18, 2021

Package and Environment Details (include every applicable attribute)

  • Package Name/Version: boost/1.75.0
  • Operating System+version: MacOS 10.15.7
  • Compiler+version: Apple clang version 12.0
  • Conan version: conan 1.36.0
  • Python version: Python 3.8.10

Conan profile (output of conan profile show default or conan profile show <profile> if custom profile is in use)

[settings]
arch=x86_64
arch_build=x86_64
build_type=Release
compiler=apple-clang
compiler.libcxx=libc++
compiler.version=12.0
os=Macos
os_build=Macos
[options]
[build_requires]
[env]

Steps to reproduce (Include if Applicable)

Building boost on macos fails with the following error:
ERROR: libunwind/1.5.0: Invalid configuration: libunwind is only supported on Linux and FreeBSD

It seems that #5420 has introduced a dependency on libunwind that cannot compile on macos

Logs (Include/Attach if Applicable)

Click to expand log
2021-05-18T10:46:03.0327600Z -- Conan: Automatic detection of conan settings from cmake
2021-05-18T10:46:03.3452050Z -- Conan: Settings= -s;build_type=Release;-s;compiler=apple-clang;-s;compiler.version=12.0;-s;compiler.libcxx=libc++
2021-05-18T10:46:03.3453870Z -- Conan: checking conan executable
2021-05-18T10:46:03.3489470Z -- Conan: Found program /Users/runner/hostedtoolcache/Python/3.8.10/x64/bin/conan
2021-05-18T10:46:03.8025550Z -- Conan: Version found Conan version 1.36.0
2021-05-18T10:46:03.8026050Z 
2021-05-18T10:46:03.8028820Z -- Conan executing: /Users/runner/hostedtoolcache/Python/3.8.10/x64/bin/conan install /Users/runner/work/nmos-cpp/nmos-cpp/Development/conanfile.txt -s build_type=Release -s compiler=apple-clang -s compiler.version=12.0 -s compiler.libcxx=libc++ -g=cmake_find_package -g=cmake --build=missing
2021-05-18T10:46:04.2455740Z Auto detecting your dev setup to initialize the default profile (/Users/runner/.conan/profiles/default)
2021-05-18T10:46:04.2484400Z CC and CXX: /Applications/Xcode_12.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc, /Applications/Xcode_12.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ 
2021-05-18T10:46:04.2586220Z Default settings
2021-05-18T10:46:04.2613330Z 	os=Macos
2021-05-18T10:46:04.2614090Z 	os_build=Macos
2021-05-18T10:46:04.2614810Z 	arch=x86_64
2021-05-18T10:46:04.2616890Z 	arch_build=x86_64
2021-05-18T10:46:04.2617950Z 	build_type=Release
2021-05-18T10:46:04.2618970Z *** You can change them in /Users/runner/.conan/profiles/default ***
2021-05-18T10:46:04.2620650Z *** Or override with -s compiler='other' -s ...s***
2021-05-18T10:46:04.2621460Z 
2021-05-18T10:46:04.2622010Z 
2021-05-18T10:46:04.2923910Z Configuration:
2021-05-18T10:46:04.2924900Z [settings]
2021-05-18T10:46:04.2925650Z arch=x86_64
2021-05-18T10:46:04.2926360Z arch_build=x86_64
2021-05-18T10:46:04.2927120Z build_type=Release
2021-05-18T10:46:04.2928680Z compiler=apple-clang
2021-05-18T10:46:04.2929530Z compiler.libcxx=libc++
2021-05-18T10:46:04.2930360Z compiler.version=12.0
2021-05-18T10:46:04.2931100Z os=Macos
2021-05-18T10:46:04.2931780Z os_build=Macos
2021-05-18T10:46:04.2932490Z [options]
2021-05-18T10:46:04.2933150Z [build_requires]
2021-05-18T10:46:04.2933850Z [env]
2021-05-18T10:46:04.2934360Z 
2021-05-18T10:46:04.2944360Z boost/1.75.0: Not found in local cache, looking in remotes...
2021-05-18T10:46:04.2945780Z boost/1.75.0: Trying with 'conan-center'...
2021-05-18T10:46:04.4925870Z Downloading conanmanifest.txt
2021-05-18T10:46:04.5013010Z Downloading conanfile.py
2021-05-18T10:46:04.5193800Z Downloading conan_export.tgz
2021-05-18T10:46:04.5327070Z boost/1.75.0: Downloaded recipe revision 34fcf97e07c38149fabf20f7ae743057
2021-05-18T10:46:04.5742980Z zlib/1.2.11: Not found in local cache, looking in remotes...
2021-05-18T10:46:04.5744530Z zlib/1.2.11: Trying with 'conan-center'...
2021-05-18T10:46:04.5929120Z Downloading conanmanifest.txt
2021-05-18T10:46:04.6015190Z Downloading conanfile.py
2021-05-18T10:46:04.6102730Z Downloading conan_export.tgz
2021-05-18T10:46:04.6219520Z zlib/1.2.11: Downloaded recipe revision 08c5163c8e302d1482d8fa2be93736af
2021-05-18T10:46:04.6276140Z bzip2/1.0.8: Not found in local cache, looking in remotes...
2021-05-18T10:46:04.6277520Z bzip2/1.0.8: Trying with 'conan-center'...
2021-05-18T10:46:04.6454190Z Downloading conanmanifest.txt
2021-05-18T10:46:04.6543340Z Downloading conanfile.py
2021-05-18T10:46:04.6629620Z Downloading conan_export.tgz
2021-05-18T10:46:04.6746130Z bzip2/1.0.8: Downloaded recipe revision 9c8b632000a52af5af3f045d3a6db12f
2021-05-18T10:46:04.6793090Z libbacktrace/cci.20210118: Not found in local cache, looking in remotes...
2021-05-18T10:46:04.6794700Z libbacktrace/cci.20210118: Trying with 'conan-center'...
2021-05-18T10:46:04.6985340Z Downloading conanmanifest.txt
2021-05-18T10:46:04.7073050Z Downloading conanfile.py
2021-05-18T10:46:04.7159350Z Downloading conan_export.tgz
2021-05-18T10:46:04.7275220Z libbacktrace/cci.20210118: Downloaded recipe revision b9b0e7ad4758a9999a3e3d2e7703fa46
2021-05-18T10:46:04.7316620Z libunwind/1.5.0: Not found in local cache, looking in remotes...
2021-05-18T10:46:04.7318100Z libunwind/1.5.0: Trying with 'conan-center'...
2021-05-18T10:46:04.7498660Z Downloading conanmanifest.txt
2021-05-18T10:46:04.7589270Z Downloading conanfile.py
2021-05-18T10:46:04.7675790Z Downloading conan_export.tgz
2021-05-18T10:46:04.7793940Z libunwind/1.5.0: Downloaded recipe revision 010f396949f6ff75931742a8a2b7a936
2021-05-18T10:46:04.7845590Z ERROR: Not able to automatically detect '/Applications/Xcode_12.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc' version
2021-05-18T10:46:04.7847110Z ERROR: Unable to find a working compiler
2021-05-18T10:46:04.7847950Z WARN: Remotes registry file missing, creating default one in /Users/runner/.conan/remotes.json
2021-05-18T10:46:04.7848940Z ERROR: libunwind/1.5.0: Invalid configuration: libunwind is only supported on Linux and FreeBSD
2021-05-18T10:46:04.8167000Z CMake Error at /Users/runner/work/nmos-cpp/build/conan.cmake:402 (message):
2021-05-18T10:46:04.8168240Z   Conan install failed='6'
@jonathan-r-thorpe jonathan-r-thorpe added the bug Something isn't working label May 18, 2021
@SpaceIm
Copy link
Contributor

SpaceIm commented May 19, 2021

@madebr do you have a quickfix for this issue? boost with default options values can't be built anymore except on Linux, FreeBSD and with Visual Studio. It also means that there are no Boost pre-built binaries on Macos anymore.
This issue will propagate to all downstream recipes.

@SpaceIm SpaceIm mentioned this issue May 19, 2021
4 tasks
@madebr
Copy link
Contributor

madebr commented May 19, 2021

# libbacktrace cannot be built on Visual Studio
if self.settings.compiler == "Visual Studio":
del self.options.with_stacktrace_backtrace

The test should include tools.is_apple_os(self.settings.os).

@SpaceIm
Copy link
Contributor

SpaceIm commented May 19, 2021

And Windows instead of Visual Studio?

@madebr
Copy link
Contributor

madebr commented May 19, 2021

Looks like it.
libunwind only builds on FreeBSD and Linux.

@SpaceIm
Copy link
Contributor

SpaceIm commented May 19, 2021

so:

if self.settings.os not in ["Linux", "FreeBSD"]:
    del self.options.with_stacktrace_backtrace

@madebr
Copy link
Contributor

madebr commented May 19, 2021

I think so. No promises 😉 .

@SpaceIm
Copy link
Contributor

SpaceIm commented May 19, 2021

It should work, but it's misleading, backtrace can be built on Macos (and maybe also with MinGW, but the recipe is broken in this case), the issue comes from libunwind.

@madebr
Copy link
Contributor

madebr commented May 19, 2021

Mmm, I'm starting to doubt the combination of libunwind and libbacktrace.

I assumed they were closely linked because boost.build tests the presence of both libraries (headers):
https://github.com/boostorg/stacktrace/blob/b37e0d8e9f9613813534b6765559bdec693f34d5/build/has_backtrace.cpp#L7-L8
But it looks like addr2line also needs libunwind: https://github.com/boostorg/stacktrace/blob/08d720adbd01c0187af256eb491cffece7e87857/build/has_addr2line.cpp#L11

It also looks like no actual libunwind symbols are used in these tests.
boostorg/stacktrace#27 is the reason for that.

I think unwind.h is needed when building the stacktrace library as a whole.
Not only when building libstacktrace_backtrace.

It worked because unwind.h is provided by gcc and clang.

@SpaceIm
Copy link
Contributor

SpaceIm commented May 20, 2021

Ok, so just remove libunwind dependency?

@erathorus
Copy link

erathorus commented May 22, 2021

I cannot install a downstream package of boost due to this error right now. Are there any way to avoid this error while the proper fix is being delivered?

@SpaceIm
Copy link
Contributor

SpaceIm commented May 22, 2021

yes add option -o boost:with_stacktrace_backtrace=False

@erathorus
Copy link

Awesome! :)

@ahmadbeirkdar
Copy link

yes add option -o boost:with_stacktrace_backtrace=False

Seems like the option does not work on macOS, due to missing libraries

@erathorus
Copy link

erathorus commented May 23, 2021 via email

@ahmadbeirkdar
Copy link

ahmadbeirkdar commented May 23, 2021

I ended up cloning the recipe and reverted it back to the commit before
libunwind was introduced.

Seems like this is the only option, in case this ever happens again...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
5 participants