Repository: conan-io/conan-center-index

Issue:
When compiling boost in macOS Intel for arm64, some libraries are missing. 
While trying to create a cross-platform build system for my project, I encountered the following issue when fetching boost library from Conancenter: 

here's the install command + configuration 
```
-- Conan executing: conan install /Users/me/myproj/conan.py --remote conancenter --build missing --settings build_type=Release --settings compiler=apple-clang --settings compiler.version=13.1 --settings compiler.libcxx=libc++
Configuration:
[settings]
arch=armv8
arch_build=x86_64
build_type=Release
compiler=apple-clang
compiler.libcxx=libc++
compiler.version=13.1
os=Macos
os_build=Macos
[options]
[build_requires]
[env]
```

And this is the error I've got : 

```
boost/1.79.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.79.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.79.0: Error in package_info() method, line 1664
	raise ConanException("These libraries were expected to be built, but were not built: {}".format(non_built))
	ConanException: These libraries were expected to be built, but were not built: {'boost_stacktrace_backtrace', 'boost_stacktrace_addr2line'}
```
any idea how to resolve it ? 



Discussion:
Hi @iradization 

I guess this is a problem related to the recipe, so let me transfer the issue to conan-center-index repository.
Hi all, any chance someone can look at this error ? thanks !
@iradization It's unexpected, because any change related to those options, as more than 1 year old.

First, what's the content of your recipe? Are you requesting specific options?

That error says what was requested in terms of modules, is not the same for what the recipe found.

Also, you can use `compiler.version=13`, because it's compatible with 13.1. I run Apple 13.1 too, but I use 13 on my profile. The advantage, you will find pre-built libraries from Conan Center.

I suggest you cleaning your cache, then trying to install Boost again:

    rm -rf ~/.conan/data/boost
    conan install boost/1.79.0@


Resolving patch:
diff --git a/recipes/boost/all/conanfile.py b/recipes/boost/all/conanfile.py
--- a/recipes/boost/all/conanfile.py
+++ b/recipes/boost/all/conanfile.py
@@ -20,7 +20,7 @@
 except ImportError:
     from io import StringIO
 
-required_conan_version = ">=1.46.0"
+required_conan_version = ">=1.47.0"
 
 
 # When adding (or removing) an option, also add this option to the list in
@@ -1345,7 +1345,7 @@ def _toolset_tag(self):
         if self._is_msvc:
             toolset_version = self._toolset_version.replace(".", "")
         else:
-            toolset_version = str(Version(self.settings.compiler.version).major)
+            toolset_version = str(Version(self.settings.compiler.version).major(fill=False))
 
         toolset_parts = [compiler, os_]
         toolset_tag = "-".join(part for part in toolset_parts if part) + toolset_version
@@ -1458,8 +1458,8 @@ def package_info(self):
                 self.cpp_info.components["headers"].defines.append("BOOST_ERROR_CODE_HEADER_ONLY")
 
         if self.options.layout == "versioned":
-            version = Version(self.version)
-            self.cpp_info.components["headers"].includedirs.append(os.path.join("include", "boost-{}_{}".format(version.major, version.minor)))
+            version = Version(self.version).as_list
+            self.cpp_info.components["headers"].includedirs.append(os.path.join("include", f"boost-{version[0]}_{version[1]}"))
 
         # Boost::boost is an alias of Boost::headers
         self.cpp_info.components["_boost_cmake"].requires = ["headers"]
@@ -1565,20 +1565,20 @@ def package_info(self):
                     libsuffix_data["abi"] = "-{}".format(abi)
 
             libsuffix_data["arch"] = "-{}{}".format(self._b2_architecture[0], self._b2_address_model)
-            version = Version(self.version)
-            if not version.patch or version.patch == "0":
-                libsuffix_data["version"] = "-{}_{}".format(version.major, version.minor)
+            version = Version(self.version).as_list
+            if len(version) == 2 or version[2] == 0:
+                libsuffix_data["version"] = f"-{version[0]}_{version[1]}"
             else:
-                libsuffix_data["version"] = "-{}_{}_{}".format(version.major, version.minor, version.patch)
+                libsuffix_data["version"] = f"-{version[0]}_{version[1]}_{version[2]}"
             libsuffix = libsuffix_lut[str(self.options.layout)].format(**libsuffix_data)
             if libsuffix:
                 self.output.info("Library layout suffix: {}".format(repr(libsuffix)))
 
             libformatdata = {}
             if not self.options.without_python:
-                pyversion = Version(self._python_version)
-                libformatdata["py_major"] = pyversion.major
-                libformatdata["py_minor"] = pyversion.minor
+                pyversion = Version(self._python_version).as_list
+                libformatdata["py_major"] = pyversion[0]
+                libformatdata["py_minor"] = pyversion[1]
 
             def add_libprefix(n):
                 """ On MSVC, static libraries are built with a 'lib' prefix. Some libraries do not support shared, so are always built as a static library. """
@@ -1698,12 +1698,12 @@ def filter_transform_module_libraries(names):
                     self.cpp_info.components["stacktrace"].defines.append("BOOST_STACKTRACE_GNU_SOURCE_NOT_REQUIRED")
 
             if not self.options.without_python:
-                pyversion = Version(self._python_version)
-                self.cpp_info.components["python{}{}".format(pyversion.major, pyversion.minor)].requires = ["python"]
+                pyversion = Version(self._python_version).as_list
+                self.cpp_info.components[f"python{pyversion[0]}{pyversion[1]}"].requires = ["python"]
                 if not self._shared:
                     self.cpp_info.components["python"].defines.append("BOOST_PYTHON_STATIC_LIB")
 
-                self.cpp_info.components["numpy{}{}".format(pyversion.major, pyversion.minor)].requires = ["numpy"]
+                self.cpp_info.components[f"numpy{pyversion[0]}{pyversion[1]}"].requires = ["numpy"]
 
             if self._is_msvc or self._is_clang_cl:
                 # https://github.com/conan-community/conan-boost/issues/127#issuecomment-404750974


Test patch: