conan-io / conan-center-index

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

Building boost with C++20 fails for gcc < 11 and clang < 14 because these don't support necessary features to build cobalt #24216

Closed samuel-emrys closed 3 months ago

samuel-emrys commented 3 months ago

Building boost/1.85.0 with cppstd=20 fails for gcc < 11 and clang < 14 because, whilst these compilers support C++20 (a requirement to build cobalt), they are partial implementations, so they fail to build cobalt. cobalt should be turned off as a default option for these compiler versions.

This ticket is in response to a recent change to build cobalt by default on build of boost that have cppstd=20 and version >= 1.85.0

The changes introduced in #24149 ensure that cobalt is only build when cppstd=20, but this only fixes part of the problem with cobalt. It also needs to check that gcc >= 11 and clang >= 14.

The problem here is just that cobalt is building by default when valid_min_cppstd(self, 20), but the logic should be Version(self.settings.compiler.version) >= self._min_cobalt_compiler_version() and valid_min_cppstd(self, 20)

Perhaps this check is better placed in config_options than the line I've commented on though.

_Derived from the following comment: https://github.com/conan-io/conan-center-index/pull/24149#discussion_r1625940762_

samuel-emrys commented 3 months ago

@uilianries as requested

uilianries commented 3 months ago

@samuel-emrys That validation is related to Conan 1.x and when not using cppstd defined. Is it your case?

samuel-emrys commented 3 months ago

No, this is related to conan 2, where cppstd is being defined - cppstd=20 is being set.

uilianries commented 3 months ago

@samuel-emrys Usually we would use check_min_cppstd when cppstd is defined in Conan 2.x, no checking the compiler compatibility, but what the user is defined in profile (settings), so it would fail for you as well in case you compiler does not support C++20 as well.

In Boost the context is different because an option can require a different standard and we want to tell to the user what component requires what C++ standard. Otherwise, check_min_cppstd would be enough. That's why we use validate_min_cppstd.

It's true GCC8 partially implements C++20 and we don't run it in the CI, but only GCC9 as closest version. So, is it something blocking you? Do you have a build log with that failure?

samuel-emrys commented 3 months ago

@uilianries i'll see if i can get a build log for you - looks like proof of conan isn't working to do this at the moment.

You only run gcc9 for the conan 1 CI, don't you? In that case, cppstd=20 won't be set, so cobalt won't be built. This probably only affects conan 2. It looks like gcc11 is the only version of gcc for conan 2, and only for cppstd17

uilianries commented 3 months ago

@samuel-emrys correct, so far we run GCC5, 7, 9 and 11 (Conan 1.x) and GCC 11 (Conan 2.x).

samuel-emrys commented 3 months ago

Build log as promised:

$ conan install --requires boost/1.85.0 -s:h compiler.cppstd=20 --build=missing

======== Input profiles ========
Profile host:
[settings]
arch=x86_64
build_type=Release
compiler=gcc
compiler.cppstd=20
compiler.libcxx=libstdc++11
compiler.version=8
os=Linux
[conf]
tools.build:compiler_executables={'c': '/usr/bin/gcc-8', 'cpp': '/usr/bin/g++-8'}
tools.system.package_manager:mode=install
tools.system.package_manager:sudo=True
tools.system.package_manager:tool=apt-get

Profile build:
[settings]
arch=x86_64
build_type=Release
compiler=gcc
compiler.cppstd=20
compiler.libcxx=libstdc++11
compiler.version=8
os=Linux
[conf]
tools.build:compiler_executables={'c': '/usr/bin/gcc-8', 'cpp': '/usr/bin/g++-8'}
tools.system.package_manager:mode=install
tools.system.package_manager:sudo=True
tools.system.package_manager:tool=apt-get

======== Computing dependency graph ========
Graph root
    cli
Requirements
    boost/1.85.0#db9b7d91e0ad8ba0b5878eb24601edb7 - Cache
    bzip2/1.0.8#457c272f7da34cb9c67456dd217d36c4 - Cache
    libbacktrace/cci.20210118#ec1aa63bbc10145c6a299e68e711670c - Cache
    zlib/1.3.1#f52e03ae3d251dec704634230cd806a2 - Cache
Build requirements
    b2/4.10.1#a41eecb267963ddf518e3c177eae60e1 - Cache
Resolved version ranges
    zlib/[>=1.2.11 <2]: zlib/1.3.1

======== Computing necessary packages ========
boost/1.85.0: Checking 1 compatible configurations
boost/1.85.0: Compatible configurations not found in cache, checking servers
boost/1.85.0: 'cc9834956bfddf1e91a567af336872c31c2fa7be': compiler.cppstd=gnu20
Requirements
    boost/1.85.0#db9b7d91e0ad8ba0b5878eb24601edb7:513d61f177aea392acfcc93948c5fb179f67cc46 - Build
    bzip2/1.0.8#457c272f7da34cb9c67456dd217d36c4:75807e7575ecc0f6141344f7c4f5e86106b92ec2#e7bb1e1a36f70eb86ffd41962a2a1150 - Cache
    libbacktrace/cci.20210118#ec1aa63bbc10145c6a299e68e711670c:897e6fde718e72637d92b0b8ed929893a1976238#4c0f438ea996f61be0f064f6dfe9e58f - Cache
    zlib/1.3.1#f52e03ae3d251dec704634230cd806a2:897e6fde718e72637d92b0b8ed929893a1976238#69c09a3755a75a9d4e6823a96f3c2758 - Cache
Build requirements
    b2/4.10.1#a41eecb267963ddf518e3c177eae60e1:63fead0844576fc02943e16909f08fcdddd6f44b#a31a98f757dcf4d3f03ed629ccde26b7 - Download (conan-center-index-mirror)

======== Installing packages ========

-------- Downloading 1 package --------
b2/4.10.1: Retrieving package 63fead0844576fc02943e16909f08fcdddd6f44b from remote 'conan-center-index-mirror'
b2/4.10.1: Package installed 63fead0844576fc02943e16909f08fcdddd6f44b
b2/4.10.1: Downloaded package revision a31a98f757dcf4d3f03ed629ccde26b7
bzip2/1.0.8: Already installed! (2 of 5)
libbacktrace/cci.20210118: Already installed! (3 of 5)
zlib/1.3.1: Already installed! (4 of 5)
boost/1.85.0: Sources downloaded from 'conan-center-index-mirror'
boost/1.85.0: Calling source() in /home/user/.conan2/p/boostd5b7f929ac10e/s/src
boost/1.85.0: Downloading 124.0MB 7009fe1faa1697476bdc7027703a2badb84e849b7b0baad5086b087b971f8617
boost/1.85.0: Downloaded 72.0MB 58% 7009fe1faa1697476bdc7027703a2badb84e849b7b0baad5086b087b971f8617
boost/1.85.0: Sources for ['https://boostorg.jfrog.io/artifactory/main/release/1.85.0/source/boost_1_85_0.tar.bz2', 'https://sourceforge.net/projects/boost/files/boost/1.85.0/boost_1_85_0.tar.bz2'] found in remote backup https://artifactory.example.com/artifactory/generic-conan-center-backup-sources/
boost/1.85.0: Apply patch (conan): Optional flag to specify iconv from either libc of libiconv

-------- Installing package boost/1.85.0 (5 of 5) --------
boost/1.85.0: Building from source
boost/1.85.0: Package boost/1.85.0:513d61f177aea392acfcc93948c5fb179f67cc46
boost/1.85.0: Building your package in /home/user/.conan2/p/b/boost8af09f9c6fc7c/b
boost/1.85.0: Calling generate()
boost/1.85.0: Generators folder: /home/user/.conan2/p/b/boost8af09f9c6fc7c/b/build-release/conan
boost/1.85.0: Generating aggregated env files
boost/1.85.0: Generated aggregated env files: ['conanbuild.sh', 'conanrun.sh']
boost/1.85.0: Calling build()
boost/1.85.0: WARN: replace_in_file didn't find pattern '/* thread_local */' in '/home/user/.conan2/p/boostd5b7f929ac10e/s/src/boost/stacktrace/detail/libbacktrace_impls.hpp' file.
boost/1.85.0: WARN: replace_in_file didn't find pattern '/* static __thread */' in '/home/user/.conan2/p/boostd5b7f929ac10e/s/src/boost/stacktrace/detail/libbacktrace_impls.hpp' file.
boost/1.85.0: WARN: replace_in_file didn't find pattern 'local generic-os = [ set.difference $(all-os) : aix darwin vxworks solaris osf hpux ] ;' in '/home/user/.conan2/p/boostd5b7f929ac10e/s/src/tools/build/src/tools/gcc.jam' file.
boost/1.85.0: WARN: replace_in_file didn't find pattern 'local no-threading = android beos haiku sgi darwin vxworks ;' in '/home/user/.conan2/p/boostd5b7f929ac10e/s/src/tools/build/src/tools/gcc.jam' file.
boost/1.85.0: WARN: Patching user-config.jam
boost/1.85.0: WARN:
using zlib : 1.3.1 : <include>"/home/user/.conan2/p/zlibc65a5e419880a/p/include" <search>"/home/user/.conan2/p/zlibc65a5e419880a/p/lib" <name>z ;
using bzip2 : 1.0.8 : <include>"/home/user/.conan2/p/bzip260e7f6f9e08c1/p/include" <search>"/home/user/.conan2/p/bzip260e7f6f9e08c1/p/lib" <name>bz2 ;
using "gcc" :  :  "/usr/bin/g++-8" :
<compileflags>"-I/home/user/.conan2/p/libba2814d8dc90710/p/include" <linkflags>"-L/home/user/.conan2/p/libba2814d8dc90710/p/lib"  ;
boost/1.85.0: WARN: b2 -q numa=on target-os=linux architecture=x86 address-model=64 binary-format=elf abi=sysv --layout=system --user-config=/home/user/.conan2/p/boostd5b7f929ac10e/s/src/tools/build/user-config.jam -sNO_ZLIB=0 -sNO_BZIP2=0 -sNO_LZMA=1 -sNO_ZSTD=1 boost.locale.icu=off --disable-icu boost.locale.iconv=on boost.locale.iconv.lib=libc threading=multi visibility=hidden link=static variant=release --with-atomic --with-charconv --with-chrono --with-cobalt --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-url --with-wave toolset=gcc cxxstd=2a define=_GLIBCXX_USE_CXX11_ABI=1 pch=on -sLIBBACKTRACE_PATH=/home/user/.conan2/p/libba2814d8dc90710/p linkflags="" cxxflags="-fPIC -DBOOST_STACKTRACE_ADDR2LINE_LOCATION=/usr/bin/addr2line" install --prefix=/home/user/.conan2/p/b/boost8af09f9c6fc7c/p -j8 --abbreviate-paths -d0 --debug-configuration --build-dir="/home/user/.conan2/p/b/boost8af09f9c6fc7c/b/build-release"
boost/1.85.0: RUN: b2 -q numa=on target-os=linux architecture=x86 address-model=64 binary-format=elf abi=sysv --layout=system --user-config=/home/user/.conan2/p/boostd5b7f929ac10e/s/src/tools/build/user-config.jam -sNO_ZLIB=0 -sNO_BZIP2=0 -sNO_LZMA=1 -sNO_ZSTD=1 boost.locale.icu=off --disable-icu boost.locale.iconv=on boost.locale.iconv.lib=libc threading=multi visibility=hidden link=static variant=release --with-atomic --with-charconv --with-chrono --with-cobalt --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-url --with-wave toolset=gcc cxxstd=2a define=_GLIBCXX_USE_CXX11_ABI=1 pch=on -sLIBBACKTRACE_PATH=/home/user/.conan2/p/libba2814d8dc90710/p linkflags="" cxxflags="-fPIC -DBOOST_STACKTRACE_ADDR2LINE_LOCATION=/usr/bin/addr2line" install --prefix=/home/user/.conan2/p/b/boost8af09f9c6fc7c/p -j8 --abbreviate-paths -d0 --debug-configuration --build-dir="/home/user/.conan2/p/b/boost8af09f9c6fc7c/b/build-release"
notice: found boost-build.jam at /home/user/.conan2/p/boostd5b7f929ac10e/s/src/boost-build.jam
notice: loading B2 from /home/user/.conan2/p/b2b05c07523db95/p/bin/.b2/kernel/bootstrap.jam
notice: Searching '/etc' '/home/user' '/home/user/.conan2/p/b2b05c07523db95/p/bin/.b2/kernel' '/home/user/.conan2/p/b2b05c07523db95/p/bin/.b2/util' '/home/user/.conan2/p/b2b05c07523db95/p/bin/.b2/build' '/home/user/.conan2/p/b2b05c07523db95/p/bin/.b2/tools' '/home/user/.conan2/p/b2b05c07523db95/p/bin/.b2/contrib' '/home/user/.conan2/p/b2b05c07523db95/p/bin/.b2/.' for site-config configuration file 'site-config.jam'.
notice: Configuration file 'site-config.jam' not found in '/etc' '/home/user' '/home/user/.conan2/p/b2b05c07523db95/p/bin/.b2/kernel' '/home/user/.conan2/p/b2b05c07523db95/p/bin/.b2/util' '/home/user/.conan2/p/b2b05c07523db95/p/bin/.b2/build' '/home/user/.conan2/p/b2b05c07523db95/p/bin/.b2/tools' '/home/user/.conan2/p/b2b05c07523db95/p/bin/.b2/contrib' '/home/user/.conan2/p/b2b05c07523db95/p/bin/.b2/.'.
notice: Loading explicitly specified user configuration file:
    /home/user/.conan2/p/boostd5b7f929ac10e/s/src/tools/build/user-config.jam
notice: Searching '/home/user/.conan2/p/boostd5b7f929ac10e/s/src/tools/build' for user-config configuration file 'user-config.jam'.
notice: Loading user-config configuration file 'user-config.jam' from '/home/user/.conan2/p/boostd5b7f929ac10e/s/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/g++-8' for gcc, condition <toolset>gcc-8
notice: using gcc libraries :: <toolset>gcc-8 :: /usr/bin /usr/lib /usr/lib32 /usr/lib64
notice: using gcc archiver :: <toolset>gcc-8 :: /usr/bin/ar
warning: toolset gcc initialization: can not find tool windres
warning: initialized from /home/user/.conan2/p/boostd5b7f929ac10e/s/src/tools/build/user-config.jam:5
notice: using rc compiler :: <toolset>gcc-8 :: /usr/bin/as
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: "/home/user/.pyenv/versions/3.10.4/include/python3.10"
notice: [python-cfg]   library path: "/home/user/.pyenv/versions/3.10.4/lib/python3.10/config" "/home/user/.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 "<string>", line 1, in <module>
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]
    - cxx11_static_assert      : yes [2]
    - cxx11_variadic_templates : yes [2]
    - cxx11_decltype           : yes [2]
    - GCC libquadmath and __float128 support : no [2]
    - cxx11_hdr_ratio          : yes [2]
    - cxx11_template_aliases   : yes [2]
    - cxx11_char16_t           : yes [2]
    - cxx11_char32_t           : yes [2]
    - cxx20_hdr_concepts       : no [2]
    - cxx20_hdr_concepts       : no [3]
    - has std::atomic_ref      : no [2]
    - has statx                : no [2]
    - has statx syscall        : yes [2]
    - cxx11_rvalue_references  : yes [2]
    - cxx11_scoped_enums       : yes [2]
    - cxx11_noexcept           : yes [2]
    - cxx11_nullptr            : yes [2]
    - cxx11_defaulted_functions : yes [2]
    - cxx11_defaulted_moves    : yes [2]
    - cxx11_deleted_functions  : yes [2]
    - cxx11_function_template_default_args : yes [2]
    - cxx11_final              : yes [2]
    - cxx11_override           : 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 dirent::d_type       : yes [2]
    - has POSIX *at APIs       : yes [2]
    - has fallocate            : yes [2]
    - cxx11_auto_declarations  : yes [2]
    - cxx11_constexpr          : yes [2]
    - cxx11_hdr_mutex          : yes [2]
    - cxx11_hdr_tuple          : yes [2]
    - cxx11_lambdas            : yes [2]
    - cxx11_thread_local       : yes [2]
    - has_icu builds           : no [2]
    - zlib                     : yes [4]
    - bzip2                    : yes [4]
    - cxx11_basic_alignas      : yes [2]
    - iconv (libc)             : yes [2]
    - cxx11_hdr_functional     : yes [2]
    - cxx11_hdr_type_traits    : yes [2]
    - cxx11_range_based_for    : yes [2]
    - cxx11_smart_ptr          : yes [2]
    - native atomic int32 supported : yes [2]
    - native syslog supported  : yes [2]
    - pthread supports robust mutexes : yes [2]
    - Boost.Regex is header-only : yes [2]
    - lockfree boost::atomic_flag : yes [2]
    - compiler supports SSSE3  : yes [2]
    - compiler supports AVX2   : yes [2]
    - gcc visibility           : yes [2]
    - sfinae_expr              : yes [2]
    - cxx11_unified_initialization_syntax : yes [2]
    - cxx11_hdr_initializer_list : yes [2]
    - cxx11_hdr_chrono         : yes [2]
    - cxx11_numeric_limits     : yes [2]
    - cxx11_hdr_array          : yes [2]
    - cxx11_hdr_atomic         : yes [2]
    - cxx11_allocator          : yes [2]
    - cxx11_explicit_conversion_operators : yes [2]
    - cxx14_decltype_auto      : yes [2]
    - cxx14_generic_lambdas    : yes [2]
    - cxx14_return_type_deduction : yes [2]
    - cxx14_variable_templates : yes [2]
    - long double support      : yes [2]
    - Has Large File Support   : yes [2]
    - Has attribute init_priority : yes [2]
    - std_wstreambuf builds    : yes [2]
    - std_wstreambuf           : yes [2]
    - libbacktrace builds      : yes [2]
    - addr2line builds         : yes [2]
    - WinDbg builds            : no [2]
    - cxx11_rvalue_references  : yes [3]
    - WinDbg builds            : no [3]
    - WinDbgCached builds      : no [2]
    - WinDbgCached builds      : no [3]
    - BOOST_COMP_GNUC >= 4.3.0 : yes [2]
    - cxx11_hdr_thread         : yes [2]
    - cxx11_hdr_regex          : yes [2]

[1] gcc-8
[2] gcc-8/rls/bst.l-lbc/bst.l-on/bst.l-off/cxstd-2a-iso/lnk-sttc/nm-on/pythn-3.10/thrd-mlt/vsblt-hdn
[3] gcc-8/rls/bst.l-lbc/bst.l-on/bst.l-off/bld-no/cxstd-2a-iso/lnk-sttc/nm-on/pythn-3.10/thrd-mlt/vsblt-hdn
[4] lnk-sttc

Component configuration:

    - atomic                   : building
    - charconv                 : building
    - chrono                   : building
    - cobalt                   : building
    - container                : building
    - context                  : building
    - contract                 : building
    - coroutine                : building
    - date_time                : building
    - exception                : building
    - fiber                    : building
    - filesystem               : building
    - graph                    : building
    - graph_parallel           : not building
    - headers                  : not building
    - iostreams                : building
    - json                     : building
    - locale                   : building
    - log                      : building
    - math                     : building
    - mpi                      : not building
    - nowide                   : building
    - program_options          : building
    - python                   : not building
    - random                   : building
    - regex                    : building
    - serialization            : building
    - stacktrace               : building
    - system                   : building
    - test                     : building
    - thread                   : building
    - timer                    : building
    - type_erasure             : building
    - url                      : building
    - wave                     : building

boost/1.85.0: Package '513d61f177aea392acfcc93948c5fb179f67cc46' built
boost/1.85.0: Build folder /home/user/.conan2/p/b/boost8af09f9c6fc7c/b/build-release
boost/1.85.0: Generating the package
boost/1.85.0: Packaging in folder /home/user/.conan2/p/b/boost8af09f9c6fc7c/p
boost/1.85.0: Calling package()
boost/1.85.0: package(): Packaged 15275 '.hpp' files
boost/1.85.0: package(): Packaged 149 '.h' files
boost/1.85.0: package(): Packaged 323 '.ipp' files
boost/1.85.0: package(): Packaged 2 '.inc' files: strict_cpp_re.inc, cpp_re.inc
boost/1.85.0: package(): Packaged 17 files
boost/1.85.0: package(): Packaged 44 '.a' files
boost/1.85.0: package(): Packaged 1 '.txt' file: LICENSE_1_0.txt
boost/1.85.0: Created package revision 32f210f0c0638e7857579f423b05a471
boost/1.85.0: Package '513d61f177aea392acfcc93948c5fb179f67cc46' created
boost/1.85.0: Full package reference: boost/1.85.0#db9b7d91e0ad8ba0b5878eb24601edb7:513d61f177aea392acfcc93948c5fb179f67cc46#32f210f0c0638e7857579f423b05a471
boost/1.85.0: Package folder /home/user/.conan2/p/b/boost8af09f9c6fc7c/p
boost/1.85.0: WARN: Boost component 'cobalt' is missing libraries. Try building boost with '-o boost:without_cobalt'. (Option is not guaranteed to exist)
ERROR: boost/1.85.0: Error in package_info() method, line 1936
        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_cobalt'}
uilianries commented 3 months ago

@samuel-emrys Thank you!