Closed Jean1995 closed 1 year ago
Well, it may be an issue in b2
recipe. Looks like b2
executable is not properly cross-built from macOS x86_64 to M1. Did you try to build b2 from source?
conan install -r conancenter b2/4.9.3@
worked without a problem.
I was also able to just download and build b2 from source, without conan.
EDIT:
conan install -r conancenter proposal/7.4.2@ --build=b2 --build=missing
however is working
conan install -r conancenter proposal/7.4.2@ --build=b2 --build=missing
however is working
It was my question yes.
I believe that pre built b2 binary in conan-center for macOS M1 is illformed, maybe due to a cross-build issue in b2 recipe (pre-built binaries for macOS M1 in conan-center are generated by a cross-build from macOS Intel to macOS M1). @grafikrobot any idea?
@SpaceIm it sounds likely, almost certain. Given that cross-building the b2 engine is not tested nor supported. It's not impossible to do it though. But it would require setting the compiler and flags used to completely override the built-in compiler detection. Doing that would mean using both the use_cxx_env
and toolset=cxx
, additionally setting the CXX
and CXXFLAGS
env vars fully.
From what I can see, it looks like the b2
executable for macos
+armv8
it's actually an x86_64
binary for multiple versions - don't think this was caused by any recent change.
I'd imagine the reason this has not surfaced before has to do with the overwhelming likelihood of 'Rosetta' being installed for M1 users - which will run the executable just fine. If the package contained a library, that would have been a different story.
Will investigate a way to prevent this from happening in the future.
As for cross-building b2 on macOS - thankfully Apple has made this easy. I have tested that passing--cxxflags="-arch arm64"
to build.sh
is enough to build the right thing - However, invoking b2 install
immediately after is going to be a challenge, as the arm64 executable will not run on the intel agents. Is there a way around this? (unless we're okay with building b2 twice!)
@jcar87 you might be able to pass --cxxflags="-arch arm64 -arch x86_64"
to do a universal build. That way you can still run it on the CI host.
Description
I am working on a new Apple M1 with Ventura. If I try to install the
proposal
package, It tries to build boost, but fails with the errorSo something seems to be wrong with building boost.
Package and Environment Details
Conan profile
[settings] os=Macos os_build=Macos arch=armv8 arch_build=armv8 compiler=apple-clang compiler.version=14 compiler.libcxx=libc++ build_type=Release [options] [conf] [build_requires] [env]
Steps to reproduce
conan install -r conancenter proposal/7.4.2@ --build=missing
Logs
Click to expand log
``` Configuration: [settings] arch=armv8 arch_build=armv8 build_type=Release compiler=apple-clang compiler.libcxx=libc++ compiler.version=14 os=Macos os_build=Macos [options] [build_requires] [env] Installing package: proposal/7.4.2 Requirements boost/1.75.0 from 'conancenter' - Cache bzip2/1.0.8 from 'conancenter' - Cache cubicinterpolation/0.1.4 from 'conancenter' - Cache eigen/3.3.9 from 'conancenter' - Cache fmt/8.0.1 from 'conancenter' - Cache libbacktrace/cci.20210118 from 'conancenter' - Cache libiconv/1.17 from 'conancenter' - Cache nlohmann_json/3.10.5 from 'conancenter' - Cache proposal/7.4.2 from 'conancenter' - Cache spdlog/1.9.2 from 'conancenter' - Cache zlib/1.2.13 from 'conancenter' - Cache Packages boost/1.75.0:565bafe4bc7369a9ab2aeeca685911f3e667af11 - Build bzip2/1.0.8:238a93dc813ca1550968399f1f8925565feeff8e - Cache cubicinterpolation/0.1.4:daa7b63aae03f094a03951a7592776a91d416e2e - Build eigen/3.3.9:5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9 - Cache fmt/8.0.1:070f9bf1d15cf4b2a694de71f450816c2d2f2f25 - Cache libbacktrace/cci.20210118:240c2182163325b213ca6886a7614c8ed2bf1738 - Cache libiconv/1.17:240c2182163325b213ca6886a7614c8ed2bf1738 - Cache nlohmann_json/3.10.5:5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9 - Cache proposal/7.4.2:0590cfc41aad0c6060bd42d71fe10635f663bf57 - Build spdlog/1.9.2:0659667fbfe29fe82b26a7bad5ba2576d6ce0197 - Build zlib/1.2.13:240c2182163325b213ca6886a7614c8ed2bf1738 - Cache Build requirements b2/4.9.2 from 'conancenter' - Cache Build requirements packages b2/4.9.2:a5ad5696abf650a25eea8f377806b3d5fe234e6e - Cache Installing (downloading, building) binaries... b2/4.9.2: Already installed! bzip2/1.0.8: Already installed! eigen/3.3.9: Already installed! fmt/8.0.1: Already installed! libbacktrace/cci.20210118: Already installed! libiconv/1.17: Already installed! nlohmann_json/3.10.5: Already installed! zlib/1.2.13: Already installed! boost/1.75.0: Applying build-requirement: b2/4.9.2 boost/1.75.0: WARN: Build folder is dirty, removing it: /Users/jean/.conan/data/boost/1.75.0/_/_/build/565bafe4bc7369a9ab2aeeca685911f3e667af11 boost/1.75.0: Building your package in /Users/jean/.conan/data/boost/1.75.0/_/_/build/565bafe4bc7369a9ab2aeeca685911f3e667af11 boost/1.75.0: Generator txt created conanbuildinfo.txt boost/1.75.0: Calling generate() boost/1.75.0: Aggregating env generators boost/1.75.0: Calling build() boost/1.75.0: WARN: replace_in_file didn't find pattern 'local generic-os = [ set.difference $(all-os) : aix darwin vxworks solaris osf hpux ] ;' in '/Users/jean/.conan/data/boost/1.75.0/_/_/source/src/tools/build/src/tools/gcc.jam' file. boost/1.75.0: WARN: replace_in_file didn't find pattern 'local no-threading = android beos haiku sgi darwin vxworks ;' in '/Users/jean/.conan/data/boost/1.75.0/_/_/source/src/tools/build/src/tools/gcc.jam' file. boost/1.75.0: WARN: replace_in_file didn't find pattern '