conan-io / conan-center-index

Recipes for the ConanCenter repository
https://conan.io/center
MIT License
950 stars 1.73k forks source link

[package] icu/72.1 + boost/1.80.0 (and older): Boost fails to build with ICU #14817

Closed stefan-floeren closed 1 year ago

stefan-floeren commented 1 year ago

Description

Since the update for Conan v2 support (https://github.com/conan-io/conan-center-index/commit/c679b7c6f5642fc49b6a2b1cbb9ecf2f05dbf3c6), Boost no longer builds with the ICU backend.

With the simplest conanfile.txt:

[requires]
boost/1.80.0

[options]
boost:i18n_backend_iconv=off
boost:i18n_backend_icu=True

The boost-internal configuration fails to find ICU:

Performing configuration checks
[...]
    - has_icu builds           : no [2]
[...]
    - icu                      : no [2]
    - icu (lib64)              : no [2]
- Boost.Locale failed to find ICU library to be built.

On investigating the culprit, I suspect the change switching from self.deps_cpp_info["icu"].system_libs to self.dependencies["icu"].cpp_info.system_libs.

deps_cpp_info contains ['pthread', 'm', 'dl', 'stdc++'], the dependencies-entry is empty, although the systemlibs are added to the subcomponents:

icu-data ['stdc++']
icu-data-alias []
icu-uc ['m', 'pthread', 'dl']
icu-i18n ['m']
icu-i18n-alias []
icu-io []
icu-tu ['pthread']
icu-test []

Same for Windows with advapi32.lib vs nothing, with the lib also being mapped to icu-uc.

It seems there is a inconsistency on which lib is expected where and how to use it between v1 and v2.

I'm not sure where this bug actually belongs to:

Package and Environment Details

Conan profile

[settings] os=Linux os_build=Linux arch=x86_64 arch_build=x86_64 compiler=clang compiler.version=11 compiler.libcxx=libstdc++11 build_type=Release [options] [conf] [build_requires] [env]

Steps to reproduce

conan install -u -r conancenter .. --build missing

Logs

Click to expand log ``` Configuration: [settings] arch=x86_64 arch_build=x86_64 build_type=Release compiler=clang compiler.libcxx=libstdc++11 compiler.version=11 os=Linux os_build=Linux [options] [build_requires] [env] icu/72.1: WARN: Can't update, no package in remote boost/1.80.0: WARN: Package binary is corrupted, removing: ffcab2917057cd788768d1cd2861de62394e2516 b2/4.9.2: WARN: Current package is newer than remote upstream one conanfile.txt: Installing package Requirements boost/1.80.0 from 'conancenter' - Cache bzip2/1.0.8 from 'conancenter' - Cache icu/72.1 from 'conancenter' - Cache libbacktrace/cci.20210118 from 'conancenter' - Cache zlib/1.2.13 from 'conancenter' - Cache Packages boost/1.80.0:ffcab2917057cd788768d1cd2861de62394e2516 - Build bzip2/1.0.8:a0279858937b0968952a9784938616e26eb7c2dd - Cache icu/72.1:5a34a782404158bcf48232306a20a330c64df076 - Cache libbacktrace/cci.20210118:d988447fa516eac7400b2f34e2d4b89e42b4b1a8 - Cache zlib/1.2.13:d988447fa516eac7400b2f34e2d4b89e42b4b1a8 - Cache Build requirements b2/4.9.2 from 'conancenter' - Cache Build requirements packages b2/4.9.2:4db1be536558d833e52e862fd84d64d75c2b3656 - Cache Installing (downloading, building) binaries... b2/4.9.2: Already installed! bzip2/1.0.8: Already installed! icu/72.1: Already installed! libbacktrace/cci.20210118: Already installed! zlib/1.2.13: Already installed! boost/1.80.0: Applying build-requirement: b2/4.9.2 boost/1.80.0: WARN: Build folder is dirty, removing it: /home/conan/.conan/data/boost/1.80.0/_/_/build/ffcab2917057cd788768d1cd2861de62394e2516 boost/1.80.0: Building your package in /home/conan/.conan/data/boost/1.80.0/_/_/build/ffcab2917057cd788768d1cd2861de62394e2516 boost/1.80.0: Generator txt created conanbuildinfo.txt boost/1.80.0: Calling generate() boost/1.80.0: Aggregating env generators boost/1.80.0: Calling build() boost/1.80.0: WARN: replace_in_file didn't find pattern '/* thread_local */' in '/home/conan/.conan/data/boost/1.80.0/_/_/source/src/boost/stacktrace/detail/libbacktrace_impls.hpp' file. boost/1.80.0: WARN: replace_in_file didn't find pattern '/* static __thread */' in '/home/conan/.conan/data/boost/1.80.0/_/_/source/src/boost/stacktrace/detail/libbacktrace_impls.hpp' file. boost/1.80.0: WARN: replace_in_file didn't find pattern 'local generic-os = [ set.difference $(all-os) : aix darwin vxworks solaris osf hpux ] ;' in '/home/conan/.conan/data/boost/1.80.0/_/_/source/src/tools/build/src/tools/gcc.jam' file. boost/1.80.0: WARN: replace_in_file didn't find pattern 'local no-threading = android beos haiku sgi darwin vxworks ;' in '/home/conan/.conan/data/boost/1.80.0/_/_/source/src/tools/build/src/tools/gcc.jam' file. boost/1.80.0: WARN: replace_in_file didn't find pattern ' @numa' in '/home/conan/.conan/data/boost/1.80.0/_/_/source/src/libs/fiber/build/Jamfile.v2' file. boost/1.80.0: WARN: Patching user-config.jam boost/1.80.0: WARN: Using the new toolchains and generators without specifying a build profile (e.g: -pr:b=default) is discouraged and might cause failures and unexpected behavior boost/1.80.0: WARN: using zlib : 1.2.13 : "/home/conan/.conan/data/zlib/1.2.13/_/_/package/d988447fa516eac7400b2f34e2d4b89e42b4b1a8/include" "/home/conan/.conan/data/zlib/1.2.13/_/_/package/d988447fa516eac7400b2f34e2d4b89e42b4b1a8/lib" z ; using bzip2 : 1.0.8 : "/home/conan/.conan/data/bzip2/1.0.8/_/_/package/a0279858937b0968952a9784938616e26eb7c2dd/include" "/home/conan/.conan/data/bzip2/1.0.8/_/_/package/a0279858937b0968952a9784938616e26eb7c2dd/lib" bz2 ; using "clang" : : /usr/bin/clang++-11 : "-I/home/conan/.conan/data/libbacktrace/cci.20210118/_/_/package/d988447fa516eac7400b2f34e2d4b89e42b4b1a8/include" "-L/home/conan/.conan/data/libbacktrace/cci.20210118/_/_/package/d988447fa516eac7400b2f34e2d4b89e42b4b1a8/lib" ; boost/1.80.0: WARN: b2 -q numa=on target-os=linux architecture=x86 address-model=64 binary-format=elf abi=sysv --layout=system --user-config=/home/conan/.conan/data/boost/1.80.0/_/_/source/src/tools/build/user-config.jam -sNO_ZLIB=0 -sNO_BZIP2=0 -sNO_LZMA=1 -sNO_ZSTD=1 boost.locale.icu=on boost.locale.iconv=off --disable-iconv threading=multi visibility=hidden link=static variant=release --with-atomic --with-chrono --with-container --with-context --with-contract --with-coroutine --with-date_time --with-exception --with-fiber --with-filesystem --with-graph --with-iostreams --with-json --with-locale --with-log --with-math --with-nowide --with-program_options --with-random --with-regex --with-serialization --with-stacktrace --with-system --with-test --with-thread --with-timer --with-type_erasure --with-wave toolset=clang define=_GLIBCXX_USE_CXX11_ABI=1 pch=on -sICU_PATH=/home/conan/.conan/data/icu/72.1/_/_/package/5a34a782404158bcf48232306a20a330c64df076 linkflags="-stdlib=libstdc++ " cxxflags="-fPIC -stdlib=libstdc++ -DBOOST_STACKTRACE_ADDR2LINE_LOCATION=/usr/bin/addr2line" install --prefix=/home/conan/.conan/data/boost/1.80.0/_/_/package/ffcab2917057cd788768d1cd2861de62394e2516 -j8 --abbreviate-paths -d0 --debug-configuration --build-dir="/home/conan/.conan/data/boost/1.80.0/_/_/build/ffcab2917057cd788768d1cd2861de62394e2516/build-release" notice: found boost-build.jam at /home/conan/.conan/data/boost/1.80.0/_/_/source/src/boost-build.jam notice: loading B2 from /home/conan/.conan/data/b2/4.9.2/_/_/package/4db1be536558d833e52e862fd84d64d75c2b3656/bin/.b2/kernel/bootstrap.jam notice: Searching '/etc' '/home/conan' '/home/conan/.conan/data/b2/4.9.2/_/_/package/4db1be536558d833e52e862fd84d64d75c2b3656/bin/.b2/kernel' '/home/conan/.conan/data/b2/4.9.2/_/_/package/4db1be536558d833e52e862fd84d64d75c2b3656/bin/.b2/util' '/home/conan/.conan/data/b2/4.9.2/_/_/package/4db1be536558d833e52e862fd84d64d75c2b3656/bin/.b2/build' '/home/conan/.conan/data/b2/4.9.2/_/_/package/4db1be536558d833e52e862fd84d64d75c2b3656/bin/.b2/tools' '/home/conan/.conan/data/b2/4.9.2/_/_/package/4db1be536558d833e52e862fd84d64d75c2b3656/bin/.b2/contrib' '/home/conan/.conan/data/b2/4.9.2/_/_/package/4db1be536558d833e52e862fd84d64d75c2b3656/bin/.b2/.' for site-config configuration file 'site-config.jam'. notice: Configuration file 'site-config.jam' not found in '/etc' '/home/conan' '/home/conan/.conan/data/b2/4.9.2/_/_/package/4db1be536558d833e52e862fd84d64d75c2b3656/bin/.b2/kernel' '/home/conan/.conan/data/b2/4.9.2/_/_/package/4db1be536558d833e52e862fd84d64d75c2b3656/bin/.b2/util' '/home/conan/.conan/data/b2/4.9.2/_/_/package/4db1be536558d833e52e862fd84d64d75c2b3656/bin/.b2/build' '/home/conan/.conan/data/b2/4.9.2/_/_/package/4db1be536558d833e52e862fd84d64d75c2b3656/bin/.b2/tools' '/home/conan/.conan/data/b2/4.9.2/_/_/package/4db1be536558d833e52e862fd84d64d75c2b3656/bin/.b2/contrib' '/home/conan/.conan/data/b2/4.9.2/_/_/package/4db1be536558d833e52e862fd84d64d75c2b3656/bin/.b2/.'. notice: Loading explicitly specified user configuration file: /home/conan/.conan/data/boost/1.80.0/_/_/source/src/tools/build/user-config.jam notice: Searching '/home/conan/.conan/data/boost/1.80.0/_/_/source/src/tools/build' for user-config configuration file 'user-config.jam'. notice: Loading user-config configuration file 'user-config.jam' from '/home/conan/.conan/data/boost/1.80.0/_/_/source/src/tools/build'. notice: [zlib] Using pre-installed library notice: [zlib] Condition notice: [bzip2] Using pre-installed library notice: [bzip2] Condition notice: will use '/usr/bin/clang++-11' for clang-linux, condition clang-linux-11 notice: [zlib] zlib is already configured notice: [bzip2] bzip is already configured notice: iostreams: not using lzma compression notice: iostreams: not using zstd compression notice: [python-cfg] Configuring python... notice: [python-cfg] Checking interpreter command "python"... notice: [python-cfg] running command 'python -c "from sys import *; print('version=%d.%d\nplatform=%s\nprefix=%s\nexec_prefix=%s\nexecutable=%s' % (version_info[0],version_info[1],platform,prefix,exec_prefix,executable))" 2>&1' notice: [python-cfg] ...requested configuration matched! notice: [python-cfg] Details of this Python configuration: notice: [python-cfg] interpreter command: "python" notice: [python-cfg] include path: "/opt/pyenv/versions/3.10.4/include/python3.10" notice: [python-cfg] library path: "/opt/pyenv/versions/3.10.4/lib/python3.10/config" "/opt/pyenv/versions/3.10.4/lib" notice: [python-cfg] Checking for NumPy... notice: [python-cfg] running command 'python -c "import sys; sys.stderr = sys.stdout; import numpy; print(numpy.get_include())"' notice: [python-cfg] NumPy disabled. Reason: notice: [python-cfg] python -c "import sys; sys.stderr = sys.stdout; import numpy; print(numpy.get_include())" aborted with notice: [python-cfg] Traceback (most recent call last): File "", line 1, in ModuleNotFoundError: No module named 'numpy' Performing configuration checks - default address-model : 64-bit [1] - default architecture : x86 [1] - compiler supports SSE2 : yes [2] - compiler supports SSE4.1 : yes [2] - has std::atomic_ref : no [2] - has statx : yes [2] - has init_priority attribute : yes [2] - has stat::st_blksize : yes [2] - has stat::st_mtim : yes [2] - has stat::st_mtimensec : no [2] - has stat::st_mtimespec : no [2] - has stat::st_birthtim : no [2] - has stat::st_birthtimensec : no [2] - has stat::st_birthtimespec : no [2] - has fdopendir(O_NOFOLLOW) : yes [2] - has POSIX *at APIs : yes [2] - cxx11_auto_declarations : yes [2] - cxx11_constexpr : yes [2] - cxx11_defaulted_functions : yes [2] - cxx11_final : yes [2] - cxx11_hdr_mutex : yes [2] - cxx11_hdr_tuple : yes [2] - cxx11_lambdas : yes [2] - cxx11_noexcept : yes [2] - cxx11_nullptr : yes [2] - cxx11_rvalue_references : yes [2] - cxx11_template_aliases : yes [2] - cxx11_thread_local : yes [2] - cxx11_variadic_templates : yes [2] - has_icu builds : no [2] - zlib : yes [3] - bzip2 : yes [3] - cxx11_decltype : yes [2] - cxx11_basic_alignas : yes [2] - icu : no [2] - icu (lib64) : no [2] - Boost.Locale failed to find ICU library to be built. boost/1.80.0: boost/1.80.0: ERROR: Package 'ffcab2917057cd788768d1cd2861de62394e2516' build failed boost/1.80.0: WARN: Build folder /home/conan/.conan/data/boost/1.80.0/_/_/build/ffcab2917057cd788768d1cd2861de62394e2516/build-release ERROR: boost/1.80.0: Error in build() method, line 850 self.run(full_command) ConanException: Error 1 while executing b2 -q numa=on target-os=linux architecture=x86 address-model=64 binary-format=elf abi=sysv --layout=system --user-config=/home/conan/.conan/data/boost/1.80.0/_/_/source/src/tools/build/user-config.jam -sNO_ZLIB=0 -sNO_BZIP2=0 -sNO_LZMA=1 -sNO_ZSTD=1 boost.locale.icu=on boost.locale.iconv=off --disable-iconv threading=multi visibility=hidden link=static variant=release --with-atomic --with-chrono --with-container --with-context --with-contract --with-coroutine --with-date_time --with-exception --with-fiber --with-filesystem --with-graph --with-iostreams --with-json --with-locale --with-log --with-math --with-nowide --with-program_options --with-random --with-regex --with-serialization --with-stacktrace --with-system --with-test --with-thread --with-timer --with-type_erasure --with-wave toolset=clang define=_GLIBCXX_USE_CXX11_ABI=1 pch=on -sICU_PATH=/home/conan/.conan/data/icu/72.1/_/_/package/5a34a782404158bcf48232306a20a330c64df076 linkflags="-stdlib=libstdc++ " cxxflags="-fPIC -stdlib=libstdc++ -DBOOST_STACKTRACE_ADDR2LINE_LOCATION=/usr/bin/addr2line" install --prefix=/home/conan/.conan/data/boost/1.80.0/_/_/package/ffcab2917057cd788768d1cd2861de62394e2516 -j8 --abbreviate-paths -d0 --debug-configuration --build-dir="/home/conan/.conan/data/boost/1.80.0/_/_/build/ffcab2917057cd788768d1cd2861de62394e2516/build-release" ```
SpaceIm commented 1 year ago

core conan, for not aggregating the sub-component system-libraries

You can open an issue in conan client repo. It's not clear from conan documentaton to know whether it's a bug or not.

SpaceIm commented 1 year ago

From source code, it seems that the canonical conan v2 way to get all system libs of a dependency, regardless of whether it has components or not, is:

self.dependencies["icu"].cpp_info.aggregated_components().system_libs

But it's not documented in https://docs.conan.io/en/latest/reference/conanfile/dependencies.html, and IMHO it's way too confusing for consumers.

SpaceIm commented 1 year ago

@stefan-floeren can you tell me whether https://github.com/conan-io/conan-center-index/pull/14819 fixes your issue?