conan-io / conan-center-index

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

[package] boost/1.85.0: Build error on ubuntu20/focal #24343

Open KiteAnton opened 2 weeks ago

KiteAnton commented 2 weeks ago

Description

Building boost/1.85.0 started to fail on ubuntu20/focal some days ago. The same setup builds on Ubuntu22/jammy.

Package and Environment Details

Conan profile

======== Input profiles ======== Profile host: [settings] arch=x86_64 build_type=Release compiler=gcc compiler.cppstd=gnu14 compiler.libcxx=libstdc++11 compiler.version=9 os=Linux

Profile build: [settings] arch=x86_64 build_type=Release compiler=gcc compiler.cppstd=gnu14 compiler.libcxx=libstdc++11 compiler.version=9 os=Linux

Steps to reproduce

  1. Create conanfile.txt according to documentation (https://conan.io/center/recipes/boost?version=) [requires] boost/1.85.0 [generators] CMakeDeps CMakeToolchain [layout] cmake_layout

2 Create conan profile conan profile detect

  1. Install conan packages conan install conanfile --build=missing

Logs

Click to expand log ``` -------- 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:0f58eab1646ea1083f74d8308efb35a5976ff70f boost/1.85.0: Building your package in /root/.conan2/p/b/boost1e3fb56c591de/b boost/1.85.0: Calling generate() boost/1.85.0: Generators folder: /root/.conan2/p/b/boost1e3fb56c591de/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 '/root/.conan2/p/boost2b9e9cf3e9a3e/s/src/boost/stacktrace/detail/libbacktrace_impls.hpp' file. boost/1.85.0: WARN: replace_in_file didn't find pattern '/* static __thread */' in '/root/.conan2/p/boost2b9e9cf3e9a3e/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 '/root/.conan2/p/boost2b9e9cf3e9a3e/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 '/root/.conan2/p/boost2b9e9cf3e9a3e/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 : "/root/.conan2/p/b/zlib2233a00ab326d/p/include" "/root/.conan2/p/b/zlib2233a00ab326d/p/lib" z ; using bzip2 : 1.0.8 : "/root/.conan2/p/b/bzip24b626a241ad24/p/include" "/root/.conan2/p/b/bzip24b626a241ad24/p/lib" bz2 ; using "gcc" : : "/usr/bin/g++-9" : "-I/root/.conan2/p/b/libba7dfefc1af33ed/p/include" "-L/root/.conan2/p/b/libba7dfefc1af33ed/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=/root/.conan2/p/boost2b9e9cf3e9a3e/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-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=14 cxxstd-dialect=gnu define=_GLIBCXX_USE_CXX11_ABI=1 pch=on -sLIBBACKTRACE_PATH=/root/.conan2/p/b/libba7dfefc1af33ed/p linkflags="" cxxflags="-fPIC -DBOOST_STACKTRACE_ADDR2LINE_LOCATION=/usr/bin/addr2line" install --prefix=/root/.conan2/p/b/boost1e3fb56c591de/p -j32 --abbreviate-paths -d0 --debug-configuration --build-dir="/root/.conan2/p/b/boost1e3fb56c591de/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=/root/.conan2/p/boost2b9e9cf3e9a3e/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-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=14 cxxstd-dialect=gnu define=_GLIBCXX_USE_CXX11_ABI=1 pch=on -sLIBBACKTRACE_PATH=/root/.conan2/p/b/libba7dfefc1af33ed/p linkflags="" cxxflags="-fPIC -DBOOST_STACKTRACE_ADDR2LINE_LOCATION=/usr/bin/addr2line" install --prefix=/root/.conan2/p/b/boost1e3fb56c591de/p -j32 --abbreviate-paths -d0 --debug-configuration --build-dir="/root/.conan2/p/b/boost1e3fb56c591de/b/build-release" b2: /lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by b2) boost/1.85.0: ERROR: Package '0f58eab1646ea1083f74d8308efb35a5976ff70f' build failed boost/1.85.0: WARN: Build folder /root/.conan2/p/b/boost1e3fb56c591de/b/build-release ERROR: boost/1.85.0: Error in build() method, line 1130 self.run(full_command) ConanException: Error 1 while executing ```
jcar87 commented 2 weeks ago

Hi @KiteAnton - thanks so much for reporting this with such detail.

I've been able to reproduce this.

All packages for Conan 2.x are built by our CI with gcc11, including for executables - this explains the error for `GLIBCXX_3.4.29' - as that is the libstdc++ version for gcc11 (as per https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html)

I think the problem here is that since the b2 recipe does not include the compiler setting (i suspect it should) - it is not correctly triggering a re-build on different versions of gcc - such as gcc9 for ubuntu focal.

We'll try to fix this quickly today - thanks!!

In the meantime as a workaround, you can ask Conan to rebuild b2 with --build=b2, which would cause it to not use the binaries available in the remote.

samuel-emrys commented 2 weeks ago

Related: #17034 , #18415 - I think this would be a good thing to include in some linter to prevent settings.compiler from being deleted @jcar87. It will be a problem for all tool_requires binaries that remove settings.compiler.

jcar87 commented 2 weeks ago

Related: #17034 , #18415 - I think this would be a good thing to include in some linter to prevent @jcar87. It will be a problem for all tool_requires binaries that remove settings.compiler.

This would be case by case basis - not a blanket rule. Removing the compiler setting is valid in those cases where we can guarantee an old enough version of libstdc++ to be useful, or when if we link against it statically and it has no other dependencies.

Preserving the settings.compiler is a possible solution, but there are others. On the other hand, we can't maintain support for "too old" gcc forever, however in this case arguably gcc11 is "too new".

samuel-emrys commented 2 weeks ago

Yes, there were no problems when the minimum was gcc5, which was when the current practice of deleting settings.compiler evolved. One of the two needs to be addressed (or expansion of the libc/libcxx model).

jcar87 commented 2 weeks ago

we have published new package revisions for b2/5.2.1 in Conan 2, built with an older version of gcc (gcc-7 in this case). These should not exhibit the problem reported here.

You can either:

Then boost should use this newer revision and build fine.

grafikrobot commented 2 weeks ago

I think the problem here is that since the b2 recipe does not include the compiler setting (i suspect it should)

Seems it would need to include the std library version in the ID. The compiler itself is irrelevant at the point of running/loading. And depending on the runtime link, static or dynamic, it would change if the C or C++ std lib version should be included.