0

I've got the following structure of conanfile.py for the purpose of installing boost in my macOS build machine. Apparently some boost components are not supported in this platform and should be omitted according to this post. Thus I need to apply the following settings. However, this is how they are configured in conanfile.txt, and I'm already working with conanfile.py, so I need to find the equivalent python code to this settings :

[options]
boost/*:with_stacktrace_backtrace=False
boost/*:without_locale=True

and here's my attempt to apply this configuration in conanfile.py.

from conan2 import ConanFile

class BoostExampleConan(ConanFile):
    name = "BoostExample"
    version = "1.0"
    settings = "os", "compiler", "build_type", "arch"
    requires = "boost/1.83.0"  
    generators = "CMakeDeps", "CMakeToolchain"
    default_options = {
        "boost:header_only": False
-->     "boost:with_stacktrace_backtrace"=False
-->     "boost:without_locale"=True
    }

    def layout(self):
        self.folders.source = "."
        self.folders.build = "build"

However, I still get the following error :

boost/1.83.0: WARN: Boost component 'locale' is missing libraries. Try building boost with '-o boost:without_locale'. (Option is not guaranteed to exist)
boost/1.83.0: WARN: Boost component 'stacktrace_addr2line' is missing libraries. Try building boost with '-o boost:without_stacktrace_addr2line'. (Option is not guaranteed to exist)
boost/1.83.0: WARN: Boost component 'stacktrace_backtrace' is missing libraries. Try building boost with '-o boost:without_stacktrace_backtrace'. (Option is not guaranteed to exist)
ERROR: boost/1.83.0: Error in package_info() method, line 2011
    raise ConanException(f"These libraries were expected to be built, but were not built: {non_built}")
    ConanException: These libraries were expected to be built, but were not built: {'boost_locale', 'boost_stacktrace_backtrace', 'boost_stacktrace_addr2line'}
2
  • I don't understand. Why the C++ tag? The code is Python. Your question talks about Python. Where is the C++ code? Where is the C++ content? Commented Dec 7, 2024 at 20:50
  • You are missing the /* that refers to any version: docs.conan.io/2/reference/conanfile/attributes.html#id30. Unfortunately the stacktrace module changedçs for each boost version and is hard to mimic what B2 will result when configuring it. It's mapped to be fixed the Conanfile in a soon future. Commented Dec 7, 2024 at 21:25

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.