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: Build error for iOS on Mac #3992

Closed
andioz opened this issue Dec 25, 2020 · 35 comments · Fixed by #7146
Closed

[package] boost/1.75.0: Build error for iOS on Mac #3992

andioz opened this issue Dec 25, 2020 · 35 comments · Fixed by #7146
Labels
bug Something isn't working

Comments

@andioz
Copy link
Contributor

andioz commented Dec 25, 2020

I guess this is similar to my other issue for Android #3890, which is solved in the meantime. When building for iOS on Mac with optionshared=Falseonly, we get this error:

ERROR: 
	ConanException: boost/1.75.0 package_info(): Package require 'libiconv' not used in components requires
CMake Error at /Users/zoufala/sandbox/svs-biocapture/bcm/cmake/ProjConan.cmake:179 (message):
  command 'conan install' failed

My profile:

include(default)

[settings]
arch=armv8
compiler=clang
compiler.version=12.0
compiler.libcxx=libc++
os=iOS
os.version=9.0

[build_requires]
darwin-toolchain/1.0.5@theodelrieu/stable

[options]
[env]
@andioz andioz added the bug Something isn't working label Dec 25, 2020
@madebr
Copy link
Contributor

madebr commented Dec 25, 2020

Shouldn't your compiler be apple-clang instead of clang?

If that doesn't change anything, I think the guesses at

@property
def _min_compiler_version_default_cxx11(self):
# Minimum compiler version having c++ standard >= 11
return {
"gcc": 6,
"clang": 6,
"apple-clang": 12, # guess
"Visual Studio": 14, # guess
}.get(str(self.settings.compiler))
@property
def _min_compiler_version_nowide(self):
# Nowide needs c++11 + swappable std::fstream
return {
"gcc": 5,
"clang": 5,
"apple-clang": 12, # guess
"Visual Studio": 14, # guess
}.get(str(self.settings.compiler))
are wrong.
This means that the recipe thinks your compiler supports the c++11 features required by some boost components.
Can you please post a complete output of a build?
An ls of the lib subfolder of the boost package folder would also be useful (to know what libraries were actually installed).

@andioz
Copy link
Contributor Author

andioz commented Dec 25, 2020

ok I have to double check with my colleague, may take some time. I'll come back on this

@andioz
Copy link
Contributor Author

andioz commented Dec 26, 2020

I started testing with a clean environment (I found CONAN_USER_HOME, thats a great help). I changed the compiler in my profile to apple-clang as you mentioned. The error still occurs.

I forgot to set the option boost:shared=False, but I guess this is irrelevant. Here are the details:

% conan config init

WARN: Remotes registry file missing, creating default one in /Users/zoufala/sandbox/andioz/conan-center-index/tmp/.conan/remotes.json
Auto detecting your dev setup to initialize the default profile (/Users/zoufala/sandbox/andioz/conan-center-index/tmp/.conan/profiles/default)
Found apple-clang 12.0
Default settings
	os=Macos
	os_build=Macos
	arch=x86_64
	arch_build=x86_64
	compiler=apple-clang
	compiler.version=12.0
	compiler.libcxx=libc++
	build_type=Release
*** You can change them in /Users/zoufala/sandbox/andioz/conan-center-index/tmp/.conan/profiles/default ***
*** Or override with -s compiler='other' -s ...s***

% cat ../../../tmp/ios_profile

include(default)

[settings]
arch=armv8
compiler=apple-clang
compiler.version=12.0
compiler.libcxx=libc++
os=iOS
os.version=9.0

[build_requires]
darwin-toolchain/1.0.5@theodelrieu/stable

[options]
[env]

% conan create . boost/1.75.0@ -pr ../../../tmp/ios_profile --build=missing


... too long to paste here

boost/1.75.0: Calling package()
boost/1.75.0 package(): Packaged 1 '.txt' file: LICENSE_1_0.txt
boost/1.75.0 package(): Packaged 14262 '.hpp' files
boost/1.75.0 package(): Packaged 145 '.h' files
boost/1.75.0 package(): Packaged 17 files
boost/1.75.0 package(): Packaged 250 '.ipp' files
boost/1.75.0 package(): Packaged 2 '.inc' files: strict_cpp_re.inc, cpp_re.inc
boost/1.75.0 package(): Packaged 34 '.a' files
boost/1.75.0: Package 'ff986c27814475353a57b509830a99a8e6df4a09' created
boost/1.75.0: Created package revision 7440f89ec4018c0fd8218fb6ae5c6233
boost/1.75.0: Library layout suffix: ''
ERROR: 
	ConanException: boost/1.75.0 package_info(): Package require 'libiconv' not used in components requires

I attached the full log here: log.txt

Additional info: running the same for native MacOS (default profile only), I even get errors. But this is strange, when running normally, the error is in test_package. When running with --keep-source --keep-buildI get this:

% conan create . boost/1.75.0@ --keep-source --keep-build  
Exporting package recipe
boost/1.75.0 exports: File 'conandata.yml' found. Exporting it...
boost/1.75.0 exports: Copied 1 '.yml' file: conandata.yml
boost/1.75.0: Calling export()
boost/1.75.0 export() method: Copied 1 '.yml' file: dependencies-1.75.0.yml
boost/1.75.0 exports_sources: Copied 15 '.patch' files
boost/1.75.0: The stored package has not changed
boost/1.75.0: Exported revision: 4915494169a8e645ec01d3f49073e417
Configuration:
[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]

boost/1.75.0: Forced build from source
boost/1.75.0 (test package): Installing package
Requirements
    boost/1.75.0 from local cache - Cache
    bzip2/1.0.8 from 'conan-center' - Cache
    libiconv/1.16 from 'conan-center' - Cache
    zlib/1.2.11 from 'conan-center' - Cache
Packages
    boost/1.75.0:d8e8e6181ea3a679ea2441e9703270817233cdf4 - Build
    bzip2/1.0.8:75fe66fbfe61230e9fcbb361f13b6b3baa483e0a - Cache
    libiconv/1.16:647afeb69d3b0a2d3d316e80b24d38c714cc6900 - Cache
    zlib/1.2.11:647afeb69d3b0a2d3d316e80b24d38c714cc6900 - Cache
Build requirements
    b2/4.2.0 from 'conan-center' - Cache
Build requirements packages
    b2/4.2.0:46f53f156846659bf39ad6675fa0ee8156e859fe - Cache

Installing (downloading, building) binaries...
b2/4.2.0: Already installed!
bzip2/1.0.8: Already installed!
libiconv/1.16: Already installed!
libiconv/1.16: Appending PATH environment var: /Users/zoufala/sandbox/andioz/conan-center-index/tmp/.conan/data/libiconv/1.16/_/_/package/647afeb69d3b0a2d3d316e80b24d38c714cc6900/bin
zlib/1.2.11: Already installed!
boost/1.75.0: Applying build-requirement: b2/4.2.0
boost/1.75.0: Won't be built as specified by --keep-build
boost/1.75.0: Building your package in /Users/zoufala/sandbox/andioz/conan-center-index/tmp/.conan/data/boost/1.75.0/_/_/build/d8e8e6181ea3a679ea2441e9703270817233cdf4
boost/1.75.0: Generated conaninfo.txt
boost/1.75.0: Generated conanbuildinfo.txt
boost/1.75.0: Generating the package
boost/1.75.0: Package folder /Users/zoufala/sandbox/andioz/conan-center-index/tmp/.conan/data/boost/1.75.0/_/_/package/d8e8e6181ea3a679ea2441e9703270817233cdf4
boost/1.75.0: Calling package()
boost/1.75.0 package(): Packaged 1 '.txt' file: LICENSE_1_0.txt
boost/1.75.0: Package 'd8e8e6181ea3a679ea2441e9703270817233cdf4' created
boost/1.75.0: Created package revision 75acdd96400a40e3aa1358e4fc9efe49
boost/1.75.0: Library layout suffix: ''
boost/1.75.0: WARN: Lib folder doesn't exist, can't collect libraries: /Users/zoufala/sandbox/andioz/conan-center-index/tmp/.conan/data/boost/1.75.0/_/_/package/d8e8e6181ea3a679ea2441e9703270817233cdf4/lib
ERROR: 
	ConanException: boost/1.75.0 package_info(): Package require 'zlib' not used in components requires

@andioz
Copy link
Contributor Author

andioz commented Dec 26, 2020

And here is the libs content from the package:

ll ../../../tmp/.conan/data/boost/1.75.0/_/_/package/ff986c27814475353a57b509830a99a8e6df4a09/lib

total 85736
    0 drwxr-xr-x  36 zoufala  staff     1152 Dec 26 11:39 .
    0 drwxr-xr-x   8 zoufala  staff      256 Dec 26 13:22 ..
  112 -rw-r--r--   1 zoufala  staff    55920 Dec 26 11:38 libboost_atomic.a
  376 -rw-r--r--   1 zoufala  staff   190440 Dec 26 11:38 libboost_chrono.a
  600 -rw-r--r--   1 zoufala  staff   303888 Dec 26 11:38 libboost_container.a
  184 -rw-r--r--   1 zoufala  staff    91848 Dec 26 11:38 libboost_context.a
  632 -rw-r--r--   1 zoufala  staff   323216 Dec 26 11:38 libboost_contract.a
  240 -rw-r--r--   1 zoufala  staff   119152 Dec 26 11:38 libboost_coroutine.a
    8 -rw-r--r--   1 zoufala  staff     3568 Dec 26 11:38 libboost_date_time.a
    8 -rw-r--r--   1 zoufala  staff     3840 Dec 26 11:38 libboost_exception.a
 1040 -rw-r--r--   1 zoufala  staff   529968 Dec 26 11:38 libboost_filesystem.a
 3120 -rw-r--r--   1 zoufala  staff  1594000 Dec 26 11:39 libboost_graph.a
  392 -rw-r--r--   1 zoufala  staff   199392 Dec 26 11:38 libboost_iostreams.a
 9344 -rw-r--r--   1 zoufala  staff  4783248 Dec 26 11:39 libboost_log.a
10488 -rw-r--r--   1 zoufala  staff  5367880 Dec 26 11:39 libboost_log_setup.a
  664 -rw-r--r--   1 zoufala  staff   335960 Dec 26 11:38 libboost_math_c99.a
  664 -rw-r--r--   1 zoufala  staff   339720 Dec 26 11:38 libboost_math_c99f.a
  664 -rw-r--r--   1 zoufala  staff   336136 Dec 26 11:38 libboost_math_c99l.a
 3400 -rw-r--r--   1 zoufala  staff  1737576 Dec 26 11:38 libboost_math_tr1.a
 3440 -rw-r--r--   1 zoufala  staff  1760592 Dec 26 11:38 libboost_math_tr1f.a
 3400 -rw-r--r--   1 zoufala  staff  1737736 Dec 26 11:38 libboost_math_tr1l.a
  496 -rw-r--r--   1 zoufala  staff   250792 Dec 26 11:38 libboost_prg_exec_monitor.a
 3288 -rw-r--r--   1 zoufala  staff  1681056 Dec 26 11:38 libboost_program_options.a
  128 -rw-r--r--   1 zoufala  staff    64584 Dec 26 11:38 libboost_random.a
 5608 -rw-r--r--   1 zoufala  staff  2871080 Dec 26 11:39 libboost_regex.a
 3512 -rw-r--r--   1 zoufala  staff  1794368 Dec 26 11:38 libboost_serialization.a
   56 -rw-r--r--   1 zoufala  staff    27424 Dec 26 11:38 libboost_stacktrace_basic.a
   16 -rw-r--r--   1 zoufala  staff     7976 Dec 26 11:38 libboost_stacktrace_noop.a
    8 -rw-r--r--   1 zoufala  staff     3488 Dec 26 11:38 libboost_system.a
 7784 -rw-r--r--   1 zoufala  staff  3982016 Dec 26 11:38 libboost_test_exec_monitor.a
  600 -rw-r--r--   1 zoufala  staff   306360 Dec 26 11:38 libboost_thread.a
  160 -rw-r--r--   1 zoufala  staff    79648 Dec 26 11:38 libboost_timer.a
  264 -rw-r--r--   1 zoufala  staff   133624 Dec 26 11:38 libboost_type_erasure.a
 7704 -rw-r--r--   1 zoufala  staff  3940640 Dec 26 11:38 libboost_unit_test_framework.a
15144 -rw-r--r--   1 zoufala  staff  7749760 Dec 26 11:38 libboost_wave.a
 2192 -rw-r--r--   1 zoufala  staff  1121760 Dec 26 11:38 libboost_wserialization.a

@madebr
Copy link
Contributor

madebr commented Dec 27, 2020

Thanks for the logs!

By taking a glance at them, it looks like the wild guess (also shown in #3992 (comment)) was too optimistic.
Can you try bumping "apple-clang": 12 to 13?

FYI: I'm working on a pr which has better error reporting #3999

@andioz
Copy link
Contributor Author

andioz commented Dec 27, 2020

I tried to change both guesses in conanfile.py from 12to 13, but the result is the same. I still see some messages in build output like BOOST_PRAGMA_MESSAGE("CAUTION: One or more C++11 features were found to be unavailable").

I cannot believe that apple-clang 12 (the current version) doesn't support all C++11 features? Maybe there is some other part in the configuration wrong. Even with disabling some parts by bumping min required version to 13 doesn't help.

I get the feeling we are hunting down the wrong way. Maybe the problem is simply something different. Where does this exception come from? ConanException: boost/1.75.0 package_info(): Package require 'libiconv' not used in components requires. Some expectations in package_info() are wrong, as far as I can say now. But where exactly?

Running with disabled log and locale it works (still with C++11 missing feature messages):

conan create . boost/1.75.0@ -pr ../../../tmp/ios_profile -o boost:without_log=True -o boost:without_locale=True

@andioz
Copy link
Contributor Author

andioz commented Dec 27, 2020

This behaviour puzzles me too. I take it as a hint to a similar problem in package_info(): after running a successful build, re-run with keeping everything:

conan create . boost/1.75.0@ -pr ../../../tmp/ios_profile -o boost:without_log=True -o boost:without_locale=True --keep-source --keep-build

I get a similar error but for zlib:

ConanException: boost/1.75.0 package_info(): Package require 'zlib' not used in components requires

How come? I don't understand, should be the same as before but just skipping compilation?

@SSE4
Copy link
Contributor

SSE4 commented Dec 27, 2020

by default, apple-clang works in C++03 mode:

clang++ -dM -E -x c++ /dev/null | grep __cplusplus
#define __cplusplus 199711L

this can be changed by passing -std:

clang++ -dM -E -x c++ -std=c++17 /dev/null | grep __cplusplus
#define __cplusplus 201703L

this I guess can be achieved by b2 cxxstd flag, which recipe will activate automatically if you specify -s compiler.cppstd=20 for example

@SSE4
Copy link
Contributor

SSE4 commented Dec 27, 2020

@madebr btw, I don't understand the relation between C++ standard and libiconv/zlib targets, could you clarify that?

@andioz
Copy link
Contributor Author

andioz commented Dec 27, 2020

this I guess can be achieved by b2 cxxstd flag, which recipe will activate automatically if you specify -s compiler.cppstd=20 for example

Ah ok, then I would say setting the proper options for b2 should be part of the recipe, right?

@SSE4
Copy link
Contributor

SSE4 commented Dec 27, 2020

Ah ok, then I would say setting the proper options for b2 should be part of the recipe, right?

they are already:

if self.settings.get_safe("compiler.cppstd"):

@andioz
Copy link
Contributor Author

andioz commented Dec 27, 2020

I see. But this means, this setting has to come either from command line options or the used profile? In the generated default profile for MacOS (and I guess Linux too) this value doesn't exist? Do you suggest to set it manually for every platform? I'm not sure about side effects for other packages used in a big project... But to be honest, I think I know not enough right now about that.

@SSE4
Copy link
Contributor

SSE4 commented Dec 27, 2020

the cppstd option should be set within the conan profile, or via command line.
still, I don't think it has anything to do with the error generated. the exception goes from the conan itself:
https://github.com/conan-io/conan/blob/808b4635f0915e93a6d5c2794c1c73ca9b606bd1/conans/model/build_info.py#L282
that's hard to diagnose, I gonna try to reproduce it locally.
from that I understand, some conan component referenced requirement which wasn't required by the conanfile itself. this indicated error in the recipe logic.
IMO it shouldn't happen regardless of cppstd value.

@andioz
Copy link
Contributor Author

andioz commented Dec 27, 2020

I can confirm, after resetting the guesses to 12 (13 produces a different error), that running

conan create . boost/1.75.0@ -pr ../../../tmp/ios_profile -s compiler.cppstd=11

generates no more messages about missing c++11 features, and the config checks looks better now.

Performing configuration checks

    - default address-model    : 64-bit
    - default architecture     : arm
    - C++11 mutex              : yes
    - lockfree boost::atomic_flag : no
    - has stat::st_mtim        : no
    - has stat::st_mtimensec   : no
    - has stat::st_mtimespec   : yes
    - has stat::st_birthtim    : no
    - has stat::st_birthtimensec : no
    - has stat::st_birthtimespec : yes
    - has statx                : no
    - has statx syscall        : no
    - cxx11_auto_declarations  : yes
    - cxx11_constexpr          : yes
    - cxx11_defaulted_functions : yes
    - cxx11_final              : yes
    - cxx11_hdr_mutex          : yes
    - cxx11_hdr_tuple          : yes
    - cxx11_lambdas            : yes
    - cxx11_noexcept           : yes
    - cxx11_nullptr            : yes
    - cxx11_rvalue_references  : yes
    - cxx11_template_aliases   : yes
    - cxx11_thread_local       : yes
    - cxx11_variadic_templates : yes
    - has_icu builds           : no
    - zlib                     : no
    - bzip2                    : no
    - cxx11_alignas            : yes
    - cxx11_decltype           : yes
    - iconv (libc)             : no
    - iconv (separate)         : no
- Boost.Locale needs either iconv or ICU library to be built.
- Boost.Locale needs either iconv or ICU library to be built.
    - native atomic int32 supported : yes
    - native syslog supported  : yes
    - pthread supports robust mutexes : no
    - gcc visibility           : yes
    - long double support      : yes
    - cxx11_static_assert      : yes
    - std::fstream is moveable and swappable : yes
    - Has Large File Support   : no
    - libbacktrace builds      : no
    - addr2line builds         : no
    - WinDbg builds            : no
    - WinDbgCached builds      : no
    - BOOST_COMP_GNUC >= 4.3.0 : no

But the libiconv error is still there

@andioz
Copy link
Contributor Author

andioz commented Dec 27, 2020

IMO it shouldn't happen regardless of cppstd value.

Agree

@SSE4
Copy link
Contributor

SSE4 commented Dec 27, 2020

seems like the real problem is that boost_locale was never built, despite it was required and reported:

- locale                   : building

the actual error seems to be (config.log):

clang-darwin.compile.c++ /Users/sse4/.conan/data/boost/1.75.0/_/_/build/53bde1cdf83b28b2dd82acd6c937460579299dbc/boost/bin.v2/libs/locale/build/clng-drwn-12.0/dbg/trgt-os-iphn/thrd-mlt/vsblt-hdn/has_iconv_libc_obj.o
clang-darwin.link /Users/sse4/.conan/data/boost/1.75.0/_/_/build/53bde1cdf83b28b2dd82acd6c937460579299dbc/boost/bin.v2/libs/locale/build/clng-drwn-12.0/dbg/trgt-os-iphn/thrd-mlt/vsblt-hdn/has_iconv
ld: unknown option: --start-group
clang: error: linker command failed with exit code 1 (use -v to see invocation)

@SSE4
Copy link
Contributor

SSE4 commented Dec 27, 2020

seems to be the same issue as:
boostorg/build#678
boostorg/build#438
the only workaround I see for now is to add -o boost:without_locale=True (probably -o boost:without_iostreams=True as well)

@SSE4
Copy link
Contributor

SSE4 commented Dec 27, 2020

for @madebr
that's the condition in recipe that skips adding iconv if locale was never built:

if all(l in detected_libraries for l in module_libraries):

may you change it to print something more human-readable warning, e.g.:

requested to build "boost_locale", but it wasn't actually built, try adding the option `-o boost:without_locale`

@madebr
Copy link
Contributor

madebr commented Dec 27, 2020

I've created #3999 to have better error reporting.
It does not have @SSE4's suggestion (yet).

@andioz
Can you try building boost (without any compiler.cppstd in your profile) with #3999?

conan create recipes/boost/all boost/1.75.0@ -s compiler.cppstd=11

The pr does not change anything for apple-clang,
so my earlier remarks about the default c++ standard of apple-clang are still valid.

@andioz
Copy link
Contributor Author

andioz commented Dec 27, 2020

OK, the build passed. I cleared the cache before building, and this build is on MacOS for MacOS (no extra profile used), I used exactly the command line from above.

boost_strict_macos.log

Any other configuration to check?

@madebr
Copy link
Contributor

madebr commented Dec 27, 2020

Good to know that cppstd=11 works on Macos.

I suppose

conan create recipes/boost/all boost/1.75.0@

will fail with missing boost_locale, boost_nowide, boost_json, ... instead of an error about a non-used conan dependency?

@andioz
Copy link
Contributor Author

andioz commented Dec 27, 2020

Here I get again the boost warnings about missing C++11 features, and it ends with errors about missing c++11 features? noexeceptfor example.

boost_strict_macos_without_cppstd.log

@andioz
Copy link
Contributor Author

andioz commented Dec 27, 2020

Building for iOS with cppstd=11 seems to work for the library, but the test_package fails.

boost_strict_ios.log

Undefined symbols, looks something is missing here

@andioz
Copy link
Contributor Author

andioz commented Dec 27, 2020

Android build on MacOS passes.

@andioz
Copy link
Contributor Author

andioz commented Jan 25, 2021

@madebr
I tried the newest package(s) on Mac for iOS, but still get errors. I add the output of the second run, it's shorter. I want to build boost with default settings, I think it should work.

Extra note: for Android, I get a similar error but only for boost_stacktrace_addr2line (on Linux, not tested yet on MacOS, but will try - yupp same on MacOS for Android).

% conan create recipes/boost/all boost/1.75.0@ -b missing -pr tmp/ios_profile

Exporting package recipe
boost/1.75.0 exports: File 'conandata.yml' found. Exporting it...
boost/1.75.0 exports: Copied 1 '.yml' file: conandata.yml
boost/1.75.0: Calling export()
boost/1.75.0 export() method: Copied 1 '.yml' file: dependencies-1.75.0.yml
boost/1.75.0 exports_sources: Copied 15 '.patch' files
  1.75.0:
  - base_path: source_subfolder
    patch_file: patches/boost_build_qcc_fix_debug_build_parameter_since_1_74.patch
  - base_path: source_subfolder
    patch_file: patches/python_base_prefix_since_1_74.patch
sources:
  1.75.0:
    sha256: 953db31e016db7bb207f11432bef7df100516eeb746843fa0486a222e3fd49cb
    url:
    - https://dl.bintray.com/boostorg/release/1.75.0/source/boost_1_75_0.tar.bz2
    - https://sourceforge.net/projects/boost/files/boost/1.75.0/boost_1_75_0.tar.bz2

boost/1.75.0: The stored package has not changed
boost/1.75.0: Exported revision: 46cb5b63cd4242715428262bb7417fa0
Configuration:
[settings]
arch=armv8
arch_build=x86_64
build_type=Release
compiler=apple-clang
compiler.libcxx=libc++
compiler.version=12.0
os=iOS
os.version=9.0
os_build=Macos
[options]
[build_requires]
*: ios-cmake/3.1.2
[env]

boost/1.75.0 (test package): Installing package
Requirements
    boost/1.75.0 from local cache - Cache
    bzip2/1.0.8 from 'conan-center' - Cache
    libiconv/1.16 from 'conan-center' - Cache
    zlib/1.2.11 from 'conan-center' - Cache
Packages
    boost/1.75.0:eec375f0968a248d30686a8f0dfba384e45dbd53 - Cache
    bzip2/1.0.8:b49b9943025a3fd8f72562eb343425cfaf6f3229 - Cache
    libiconv/1.16:3789018b2882bf53cb9ed8e9abd38b829172fe47 - Cache
    zlib/1.2.11:3789018b2882bf53cb9ed8e9abd38b829172fe47 - Cache
Build requirements
    ios-cmake/3.1.2 from 'conan-center' - Cache
Build requirements packages
    ios-cmake/3.1.2:5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9 - Cache

Cross-build from 'Macos:x86_64' to 'iOS:armv8'
Installing (downloading, building) binaries...
bzip2/1.0.8: Already installed!
ios-cmake/3.1.2: Already installed!
ios-cmake/3.1.2: Setting toolchain options to: -DPLATFORM=OS64 -DDEPLOYMENT_TARGET=9.0 -DARCHS=arm64 -DENABLE_BITCODE=True -DENABLE_ARC=True -DENABLE_VISIBILITY=False -DENABLE_STRICT_TRY_COMPILE=False
ios-cmake/3.1.2: Setting CONAN_CMAKE_PROGRAM to: -DPLATFORM=OS64 -DDEPLOYMENT_TARGET=9.0 -DARCHS=arm64 -DENABLE_BITCODE=True -DENABLE_ARC=True -DENABLE_VISIBILITY=False -DENABLE_STRICT_TRY_COMPILE=False
libiconv/1.16: Already installed!
libiconv/1.16: Appending PATH environment var: /Users/zoufala/sandbox/github/andioz/conan-center-index/tmp/.conan/data/libiconv/1.16/_/_/package/3789018b2882bf53cb9ed8e9abd38b829172fe47/bin
zlib/1.2.11: Already installed!
boost/1.75.0: Already installed!
boost/1.75.0: WARN: Boost component 'locale' is missing libraries. Try building boost with '-o boost:without_locale'.
boost/1.75.0: WARN: Boost component 'stacktrace_addr2line' is missing libraries. Try building boost with '-o boost:without_stacktrace_addr2line'.
ERROR: boost/1.75.0: Error in package_info() method, line 1336
        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_addr2line', 'boost_locale'}

@kaptenhonek
Copy link

Have you found any workarounds for android? I get the same error about boost_stacktrace_addr2line

@madebr
Copy link
Contributor

madebr commented Apr 6, 2021

@andioz @kaptenhonek

boost_stacktrace_addr2line is built if b2 is able to build (and run) the following source: https://github.com/boostorg/stacktrace/blob/develop/build/has_addr2line.cpp

The boost recipe currently does not have a way to override the location of the addr2line executable.
What is the name/location of it for android/ios?
Maybe the boost recipe needs a way to pass the value of BOOST_STACKTRACE_ADDR2LINE_LOCATION.

@madebr
Copy link
Contributor

madebr commented Apr 6, 2021

@andioz
Does the current conan recipe still fail with a missing boost_locale library?
Can you please rebuild and post the complete log?
Posting the tree layout of the libiconv package would also be useful.

@andioz
Copy link
Contributor Author

andioz commented Apr 7, 2021

I have to update my dev environment first. I got rid of boost in my project, therefore I didn’t continue on this. But I will check, give me some time and hold on...

@andioz
Copy link
Contributor Author

andioz commented Apr 7, 2021

Here we go. I have a fresh .conan directory, python venv up-to-date. I ran both my "old" single profile method and a "new" dual profile method. Same error for both variants. libiconv tree layout: I assume you mean the build directory - this one is attached here too.

ios-build-single-profile.log
ios-build-dual-profile.log
libiconv-build-tree.txt

@madebr
Copy link
Contributor

madebr commented Apr 7, 2021

@andioz

  • I meant the tree of the libiconv package folder because that one is the folder used by boost.
    But your boost logs contain its content:

    libiconv/1.16 package(): Packaged 1 file: iconv
    libiconv/1.16 package(): Packaged 1 '.LIB' file: COPYING.LIB
    libiconv/1.16 package(): Packaged 3 '.h' files: libcharset.h, localcharset.h, iconv.h
    libiconv/1.16 package(): Packaged 2 '.a' files: libcharset.a, libiconv.a
    
  • The boost logs do not contain the actual boost log. Did you remove it from the logs to reduce file size?

  • The logs show that -sICONV_PATH=/Users/zoufala/sandbox/github/andioz/conan-center-index/tmp/.conan/data/libiconv/1.16/_/_/package/3789018b2882bf53cb9ed8e9abd38b829172fe47 is passed to b2 (=boost build tool).
    But the tool says - Boost.Locale needs either iconv or ICU library to be built.

Can you try the following:
Compile this source: https://github.com/boostorg/locale/blob/develop/build/has_iconv.cpp
with the following command with the same settings as the failing boost package.

$CXX has_iconv.cpp -I/Users/zoufala/sandbox/github/andioz/conan-center-index/tmp/.conan/data/libiconv/1.16/_/_/package/3789018b2882bf53cb9ed8e9abd38b829172fe47/include -L/Users/zoufala/sandbox/github/andioz/conan-center-index/tmp/.conan/data/libiconv/1.16/_/_/package/3789018b2882bf53cb9ed8e9abd38b829172fe47/lib -liconv

You might need to tweak the used paths.
But I want to test here whether linking to only libiconv.a is sufficient.

Re the addr2line error, I'm not sure how to address it on Macos.
The b2 detection is not really configurable.

Alternatively, we can just remove it when it's present but unwanted,
and fail when it is needed, but not present.

@andioz
Copy link
Contributor Author

andioz commented Apr 8, 2021

Ah sorry, here is the package tree for completeness:

tmp/.conan/data/libiconv/1.16/_/_/package/3789018b2882bf53cb9ed8e9abd38b829172fe47/
├── bin
│   └── iconv
├── conaninfo.txt
├── conanmanifest.txt
├── include
│   ├── iconv.h
│   ├── libcharset.h
│   └── localcharset.h
├── lib
│   ├── libcharset.a
│   └── libiconv.a
└── licenses
    └── COPYING.LIB

I didn't remove anything from the logs, it should be complete. But as you mention it: I recognized a relatively long timeout (more than a minute) after the line - wave: building. Looks like the output is suppressed here.

I'm still trying to figure out the required command line arguments for the compiler to check has_iconv.cpp, need feed back from a teammate, I'm not a regular Mac user...

@andioz
Copy link
Contributor Author

andioz commented Apr 10, 2021

OK, I managed to compile, I hope it is what you want:

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang \
  -x c++ -target arm64-apple-ios9.0 \
    -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.4.sdk \
    tmp/.conan/data/boost/1.75.0/_/_/source/source_subfolder/libs/locale/build/has_iconv.cpp -I/Users/zoufala/sandbox/github/andioz/conan-center-index/tmp/.conan/data/libiconv/1.16/_/_/package/3789018b2882bf53cb9ed8e9abd38b829172fe47/include -L/Users/zoufala/sandbox/github/andioz/conan-center-index/tmp/.conan/data/libiconv/1.16/_/_/package/3789018b2882bf53cb9ed8e9abd38b829172fe47/lib -liconv

This produces an a.out file without error or warning:

% ll a.out
1928 -rwxr-xr-x  1 zoufala  staff  984768 Apr 10 10:15 a.out
%

@DavidAntliff
Copy link

DavidAntliff commented May 3, 2021

@madebr

boost_stacktrace_addr2line is built if b2 is able to build (and run) the following source: https://github.com/boostorg/stacktrace/blob/develop/build/has_addr2line.cpp

The boost recipe currently does not have a way to override the location of the addr2line executable.
What is the name/location of it for android/ios?
Maybe the boost recipe needs a way to pass the value of BOOST_STACKTRACE_ADDR2LINE_LOCATION.

I'm running into a similar problem with Boost 1.69 when trying to cross-build boost for a Raspberry Pi. The cross-compilation toolchain has addr2line as /bin/arm-linux-gnueabihf-addr2line however I can't seem to find a way to get Boost to pick it up, leading to:

    - addr2line builds         : no

...

boost/1.69.0: WARN: Boost component 'stacktrace_addr2line' is missing libraries. Try building boost with '-o boost:without_stacktrace_addr2line'.
ERROR: boost/1.69.0: Error in package_info() method, line 1404
	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_addr2line'}

Interestingly, I was previously using boost-1.69.0@conan/stable (now deprecated) and this seemed to work just fine with the same toolchain (build reports - addr2line builds : yes), so I'm not sure what's different. I can't run this one any more after the bintray sunsetting.

I was able to work around it with a boost:without_stacktrace=True but that disables the entire stacktrace component which doesn't seem like an appropriate action.

I know I have an older version of Boost but the issue seems to be the same and therefore I'm very interested in parts of this discussion.

On further reflection, I'm wondering if the issue is really with detecting libbacktrace rather than addr2line which seems more like a fall-back. However I don't know enough about the Boost build system to confirm.

EDIT: I've duplicated the same issue with Boost 1.76.0.

@madebr
Copy link
Contributor

madebr commented May 3, 2021

To everybody having a problem with boost_stacktrace_addr2line in this thread,
can they please try #5420 and report their results?

It allows to override the location of the addr2line executable with the addr2line_location option.

Thanks!

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
Development

Successfully merging a pull request may close this issue.

5 participants