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

Boost: fix error when building without fiber + improve stacktrace support #5420

Merged
merged 10 commits into from
May 18, 2021

Conversation

madebr
Copy link
Contributor

@madebr madebr commented May 3, 2021

Specify library name and version: boost/all


  • I've read the guidelines for contributing.
  • I've followed the PEP8 style guides for Python code in the recipes.
  • I've used the latest Conan client version.
  • I've tried at least one configuration locally with the
    conan-center hook activated.

@conan-center-bot

This comment has been minimized.

@DavidAntliff
Copy link

DavidAntliff commented May 4, 2021

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

Happy to give this a try, but how do I point Conan at this PR recipe?

Incidentally, I understand that Boost only looks for addr2line if it can't find libbacktrace - is that right? I tried adding libbacktrace/cci.20210118 to my [requires] section in conanfile.txt in the hope that Boost-1.76.0 might detect and use it, but it did not.

@madebr
Copy link
Contributor Author

madebr commented May 4, 2021

@DavidAntliff

Happy to give this a try, but how do I point Conan at this PR recipe?

Thanks!
You can checkout this pr by running:

git fetch origin pull/5420/head:pr_5420
git checkout pr_5420
conan create recipes/boost/all boost/1.76.0@

See https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/checking-out-pull-requests-locally for the details

Incidentally, I understand that Boost only looks for addr2line if it can't find libbacktrace - is that right?

Boost.Stacktrace supplies multiple back-ends for stacktrace: noop, libbacktrace, addr2line, windbg and windbg_cached.
All of them are built in parallel. (Or at least those enabled, or available on a platform.)
You need to link to only one of them. See the test_package: it tests all back-ends separately.

I tried adding libbacktrace/cci.20210118 to my [requires] section in conanfile.txt in the hope that Boost-1.76.0 might detect and use it, but it did not.

You don't need to add libbacktrace/cci.20210118 to your conanfile.txt/py.
The boost recipe automatically adds it to the dependency tree when you add the -o boost:with_stacktrace_backtrace=True argument to conan create ... boost/1.76.0@.

@DavidAntliff
Copy link

Ah, ok, I should add some more detail to my situation. I am having trouble with Boost and addr2line (and libbacktrace) in the context of an x86-64 cross-compilation environment for armhf (Raspberry Pi). I am building inside a pretty austere docker container on GitLabCI. This means that simply running commands like conan create recipes/boost/all boost/1.76.0@ would need to be done inside the container, which I can do, it's just not as trivial as I thought :)

This is also why my addr2line is actually /bin/arm-linux-gnueabihf-addr2line - it's the arm toolchain's version of it.

In my situation, there is no libbacktrace in the docker container, so I had hoped that adding it to Conan would build and install it into the cross-compilation sysroot, but it didn't seem to do that (or if it did, Boost didn't detect it).

Incidentally, how do I add -o boost:with_stacktrace_backtrace=True to my conanfile.txt?

@madebr
Copy link
Contributor Author

madebr commented May 4, 2021

Incidentally, how do I add -o boost:with_stacktrace_backtrace=True to my conanfile.txt?

See https://docs.conan.io/en/latest/reference/conanfile_txt.html#options
So here, it should be:

[options]
boost:with_stacktrace_backtrace=True
boost:addr2line_location=/bin/arm-linux-gnueabihf-addr2line

But I'm not confident that this will work for cross building: arm-linux-gnueabihf-addr2line is a cross building tool.
I think boost_stacktrace_addr2line expects an arm native executable. Not one that runs on x86_64.

@DavidAntliff
Copy link

But I'm not confident that this will work for cross building

That's a good point - it's called at run-time, so I should provide the path to the installed addr2line on the RPi.

Is addr2line still used if libbacktrace is enabled/available?

I'll try these things out and report back if this PR helps.

@madebr
Copy link
Contributor Author

madebr commented May 4, 2021

But I'm not confident that this will work for cross building

That's a good point - it's called at run-time, so I should provide the path to the installed addr2line on the RPi.

It's still a mess.
During configuration (=before building boost), it tries to build and run this executable: https://github.com/boostorg/stacktrace/blob/develop/build/has_addr2line.cpp
This is on the build machine.

But the boost_stacktrace_addr2line is supposed to run on a host machine (arm in your case), which might have other paths.

So I'ld argue that boost.stacktrace addr2line backend not support cross building at the moment.
If this is the case, perhaps we should open an issue at https://github.com/boostorg/stacktrace

I'm not sure yet, because it is possible to define a different BOOST_STACKTRACE_ADDR2LINE_LOCATION macro during building boost and when using the boost library.

Is addr2line still used if libbacktrace is enabled/available?

You can only use one at a time.
But the boost.build script is able to build both libraries.

I'll try these things out and report back if this PR helps.

Once again, thanks!

@conan-center-bot

This comment has been minimized.

@madebr madebr force-pushed the boost_without_fiber branch from 7b39ef5 to 6eb09e5 Compare May 4, 2021 03:04
@conan-center-bot

This comment has been minimized.

@madebr madebr closed this May 4, 2021
@madebr madebr reopened this May 4, 2021
@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@madebr madebr force-pushed the boost_without_fiber branch from 19c7c1c to 0a19a2f Compare May 6, 2021 00:20
@DavidAntliff
Copy link

Can I see your complete profile?
Are you cross building on an intel machine or natively on a raspberry pi?

Sure. I'm cross-compiling on an Intel x86_64 machine. Here's my Conan profile:

target_host=arm-linux-gnueabihf
toolchain=/opt/cross-pi-gcc-8.3.0-2
cc_compiler=gcc
cxx_compiler=g++

[env]
# NOTE. When the CONAN_CMAKE_FIND_ROOT_PATH variable is set the build breaks...
#CONAN_CMAKE_FIND_ROOT_PATH=$toolchain/$target_host
PATH=[$PATH:$toolchain/bin]
CHOST=$target_host
AR=$target_host-ar
AS=$target_host-as
RANLIB=$target_host-ranlib
LD=$target_host-ld
STRIP=$target_host-strip
CC=$target_host-$cc_compiler
CXX=$target_host-$cxx_compiler

[settings]
# We are cross-compiling to RPi4 (armv7hf) Linux
os=Linux
arch=armv7hf
compiler=gcc
compiler.version=8.3
compiler.libcxx=libstdc++11
build_type=Release

In case it helps, here's the Dockerfile for the container I'm building within (Docker is on an x86_64 host):

FROM ubuntu:20.04

RUN sed -i 's|http://archive.|http://nz.archive.|g' /etc/apt/sources.list

RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
    build-essential gcc g++ binutils libc6-dev git bison cvs flex gperf \
    texinfo automake  valgrind wget xz-utils unzip help2man patch gawk \
    make libtool libtool-bin libncurses5-dev libpq-dev libssl-dev php-cli \
    php-xml xsltproc python3-all python3-all-dev python3-pip python3-venv \
    python3-wheel

# GCC 8.3.0 - abhiTronix's raspberry-pi-cross-compilers precompiled binaries
RUN wget "https://sourceforge.net/projects/raspberry-pi-cross-compilers/files/Raspberry Pi GCC Cross-Compiler Toolchains/Buster/GCC 8.3.0/Raspberry Pi 3A+, 3B+, 4/cross-gcc-8.3.0-pi_3+.tar.gz" -O /tmp/cross-gcc-8.3.0-pi_3+.tar.gz
RUN tar -xf /tmp/cross-gcc-8.3.0-pi_3+.tar.gz -C /opt
RUN chown -R 1000:1000 /opt/cross-pi-gcc-8.3.0-2

# CMake
ADD https://github.com/Kitware/CMake/releases/download/v3.18.2/cmake-3.18.2.tar.gz /tmp/cmake.tar.gz
RUN mkdir /cmake && tar -xf /tmp/cmake.tar.gz -C /cmake --strip-components 1
RUN cd /cmake && ./bootstrap
RUN cd /cmake && make
RUN cd /cmake && make install

# Conan
RUN pip3 install pip --upgrade
RUN pip3 install conan

# https://github.com/boxboat/fixuid
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y curl

RUN addgroup --gid 1000 docker && \
    adduser --uid 1000 --ingroup docker --home /home/docker --shell /bin/sh --disabled-password --gecos "" docker

ADD https://github.com/boxboat/fixuid/releases/download/v0.5/fixuid-0.5-linux-amd64.tar.gz /tmp/fixuid-0.5-linux-amd64.tar.gz
RUN tar -xf /tmp/fixuid-0.5-linux-amd64.tar.gz -C /usr/local/bin 
RUN chown root:root /usr/local/bin/fixuid
RUN chmod 4755 /usr/local/bin/fixuid
RUN mkdir -p /etc/fixuid
RUN USER=docker && \
    GROUP=docker && \
    printf "user: $USER\ngroup: $GROUP\npaths:\n  - /work" > /etc/fixuid/config.yml

RUN rm -rf /tmp/*
RUN rm -rf /cmake

USER docker:docker
ENTRYPOINT ["fixuid"]

After building the Docker image, I'm doing this:

$ docker run --rm -it <image-id>
$ cd /home/docker
$
$ git clone https://github.com/conan-io/conan-center-index.git
...
$ cd conan-center-index/
$ git fetch origin pull/5420/head:pr_5420
...
$ git checkout pr_5420
$ git rev-parse HEAD
0a19a2f836dd24c95e6ff20137b741115f0f0e81
$
$ cd
$ git clone <myproject>   # get my conan profile, as above
...
$ cd myproject    # contains my ARMHF conan profile in conan_profile/default
$ conan config install conan_profile/default --target-folder profiles
Copying file default to /home/docker/.conan/profiles/.
$ conan config init
WARN: Remotes registry file missing, creating default one in /home/docker/.conan/remotes.json

$ cd ~/conan-center-index/recipes/boost/all
$ conan create --build=missing . boost/1.76.0@
...
boost/1.76.0: Exported revision: b372aef197498cf30d4c418e7fe1b430
Configuration:
[settings]
arch=armv7hf
build_type=Release
compiler=gcc
compiler.libcxx=libstdc++11
compiler.version=8.3
os=Linux
[options]
[build_requires]
[env]
AR=arm-linux-gnueabihf-ar
AS=arm-linux-gnueabihf-as
CC=arm-linux-gnueabihf-gcc
CHOST=arm-linux-gnueabihf
CXX=arm-linux-gnueabihf-g++
LD=arm-linux-gnueabihf-ld
PATH=[$PATH:/opt/cross-pi-gcc-8.3.0-2/bin]
RANLIB=arm-linux-gnueabihf-ranlib
STRIP=arm-linux-gnueabihf-strip
...
libbacktrace/cci.20210118: Applying build-requirement: libtool/2.4.6
libbacktrace/cci.20210118: Applying build-requirement: automake/1.16.3
libbacktrace/cci.20210118: Applying build-requirement: autoconf/2.69
libbacktrace/cci.20210118: Applying build-requirement: m4/1.4.18
libbacktrace/cci.20210118: Configuring sources in /home/docker/.conan/data/libbacktrace/cci.20210118/_/_/source
Downloading dedbe13fda00253fe5d4f2fb812c909729ed5937.tar.gz completed [649.57k]                        

libbacktrace/cci.20210118: Copying sources to build folder
libbacktrace/cci.20210118: Building your package in /home/docker/.conan/data/libbacktrace/cci.20210118/_/_/build/a0aa1a48c38cb1e870f82421850b5716afea1c03
libbacktrace/cci.20210118: Generator txt created conanbuildinfo.txt
libbacktrace/cci.20210118: Calling build()
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: /home/docker/.conan/data/automake/1.16.3/_/_/package/258f6f05ca54813b3d7180161753df7f9ccf7e1d/bin/aclocal --force -I config
autom4te: need GNU m4 1.4 or later: /home/docker/.conan/data/m4/1.4.18/_/_/package/3386fb6a91a12a047a2d351791c92b1cd6efb4e2/bin/m4
aclocal: error: /home/docker/.conan/data/autoconf/2.69/_/_/package/cb054d0b3e1ca595dc66bc2339d40f1f8f04ab31/bin/autom4te failed with exit status: 1
autoreconf: /home/docker/.conan/data/automake/1.16.3/_/_/package/258f6f05ca54813b3d7180161753df7f9ccf7e1d/bin/aclocal failed with exit status: 1
libbacktrace/cci.20210118: 
libbacktrace/cci.20210118: ERROR: Package 'a0aa1a48c38cb1e870f82421850b5716afea1c03' build failed
libbacktrace/cci.20210118: WARN: Build folder /home/docker/.conan/data/libbacktrace/cci.20210118/_/_/build/a0aa1a48c38cb1e870f82421850b5716afea1c03
ERROR: libbacktrace/cci.20210118: Error in build() method, line 58
	self.run("autoreconf -fiv", run_environment=True)
	ConanException: Error 1 while executing autoreconf -fiv

Please let me know if I can provide any more info.

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@madebr
Copy link
Contributor Author

madebr commented May 7, 2021

@DavidAntliff

The m4 error is because your intel machine is attempting to run an arm m4 executable.
When cross building, you need to use a build and host profile.
I've added a patch that fixed building the boost_stacktrace libraries on arm.
For this, I've used the conanio/gcc10-armv7hf docker image with the following profiles:

host_profile:

[settings]
os=Linux
arch=armv7hf
compiler=gcc
compiler.version=10
compiler.libcxx=libstdc++
build_type=Release
[options]
[build_requires]
[env]
CC=/usr/bin/arm-linux-gnueabihf-gcc
CXX=/usr/bin/arm-linux-gnueabihf-g++
AR=/usr/bin/arm-linux-gnueabihf-ar
LD=/usr/bin/arm-linux-gnueabihf-g++

build profile:

[settings]
os=Linux
arch=x86_64
compiler=gcc
compiler.version=10
compiler.libcxx=libstdc++
build_type=Release
[options]
[build_requires]
[env]

When building boost inside the docker using

conan create . boost/1.76.0@ -pr:h ./host_profile -pr:b ./build_profile

, I was able to create boost but the stacktrace test_package fails to build with the following error:

[ 17%] Building CXX object CMakeFiles/stacktrace_backtrace_exe.dir/stacktrace.cpp.o
/usr/bin/arm-linux-gnueabihf-g++-10 -DBOOST_STACKTRACE_USE_BACKTRACE -DLZMA_API_STATIC -DTEST_STACKTRACE_IMPL=2 -D_GLIBCXX_USE_CXX11_ABI=0 -isystem /home/conan/.conan/data/boost/1.76.0/_/_/package/d3db62ef012c6dbb410499f13a373072d0ddd6ca/include -isystem /home/conan/.conan/data/libunwind/1.5.0/_/_/package/65c2959ffe650794ce878bc719c84f79dba9fb37/include -isystem /home/conan/.conan/data/xz_utils/5.2.4/_/_/package/8c34e1d1c4c9d04af8efa9638d25d1f0e8e69e4f/include -isystem /home/conan/.conan/data/libbacktrace/cci.20210118/_/_/package/8c34e1d1c4c9d04af8efa9638d25d1f0e8e69e4f/include -O3 -DNDEBUG -o CMakeFiles/stacktrace_backtrace_exe.dir/stacktrace.cpp.o -c /boost/boost/all/test_package/stacktrace.cpp
[ 21%] Linking CXX executable bin/stacktrace_backtrace_exe
/opt/pyenv/versions/3.7.5/lib/python3.7/site-packages/cmake/data/bin/cmake -E cmake_link_script CMakeFiles/stacktrace_backtrace_exe.dir/link.txt --verbose=1
/usr/bin/arm-linux-gnueabihf-g++-10 -O3 -DNDEBUG -rdynamic CMakeFiles/stacktrace_backtrace_exe.dir/stacktrace.cpp.o -o bin/stacktrace_backtrace_exe   -L/home/conan/.conan/data/boost/1.76.0/_/_/package/d3db62ef012c6dbb410499f13a373072d0ddd6ca/lib  -L/home/conan/.conan/data/libunwind/1.5.0/_/_/package/65c2959ffe650794ce878bc719c84f79dba9fb37/lib  -Wl,-rpath,/home/conan/.conan/data/boost/1.76.0/_/_/package/d3db62ef012c6dbb410499f13a373072d0ddd6ca/lib:/home/conan/.conan/data/libunwind/1.5.0/_/_/package/65c2959ffe650794ce878bc719c84f79dba9fb37/lib /home/conan/.conan/data/boost/1.76.0/_/_/package/d3db62ef012c6dbb410499f13a373072d0ddd6ca/lib/libboost_stacktrace_backtrace.a -ldl -lrt /home/conan/.conan/data/libunwind/1.5.0/_/_/package/65c2959ffe650794ce878bc719c84f79dba9fb37/lib/libunwind-ptrace.a /home/conan/.conan/data/libunwind/1.5.0/_/_/package/65c2959ffe650794ce878bc719c84f79dba9fb37/lib/libunwind-setjmp.a /home/conan/.conan/data/libunwind/1.5.0/_/_/package/65c2959ffe650794ce878bc719c84f79dba9fb37/lib/libunwind-coredump.a /home/conan/.conan/data/libunwind/1.5.0/_/_/package/65c2959ffe650794ce878bc719c84f79dba9fb37/lib/libunwind-generic.a /home/conan/.conan/data/libunwind/1.5.0/_/_/package/65c2959ffe650794ce878bc719c84f79dba9fb37/lib/libunwind.a /home/conan/.conan/data/xz_utils/5.2.4/_/_/package/8c34e1d1c4c9d04af8efa9638d25d1f0e8e69e4f/lib/liblzma.a -lpthread /home/conan/.conan/data/libbacktrace/cci.20210118/_/_/package/8c34e1d1c4c9d04af8efa9638d25d1f0e8e69e4f/lib/libbacktrace.a 
/usr/lib/gcc-cross/arm-linux-gnueabihf/10/../../../../arm-linux-gnueabihf/bin/ld: CMakeFiles/stacktrace_backtrace_exe.dir/stacktrace.cpp.o: in function `boost::stacktrace::detail::unwind_callback(_Unwind_Context*, void*)':
stacktrace.cpp:(.text._ZN5boost10stacktrace6detail15unwind_callbackEP15_Unwind_ContextPv[_ZN5boost10stacktrace6detail15unwind_callbackEP15_Unwind_ContextPv]+0xc): undefined reference to `_Unwind_GetIP'
/usr/lib/gcc-cross/arm-linux-gnueabihf/10/../../../../arm-linux-gnueabihf/bin/ld: stacktrace.cpp:(.text._ZN5boost10stacktrace6detail15unwind_callbackEP15_Unwind_ContextPv[_ZN5boost10stacktrace6detail15unwind_callbackEP15_Unwind_ContextPv]+0x16): undefined reference to `_Unwind_GetIP'
collect2: error: ld returned 1 exit status

I believe this is a problem with libunwind, not with boost. (I'm not sure though)

@conan-center-bot
Copy link
Collaborator

All green in build 10 (53cb5aecb6c47cbaf062bbbc0975cc62d98525ad):

  • boost/1.70.0@:
    All packages built successfully! (All logs)

  • boost/1.69.0@:
    All packages built successfully! (All logs)

  • boost/1.71.0@:
    All packages built successfully! (All logs)

  • boost/1.72.0@:
    All packages built successfully! (All logs)

  • boost/1.73.0@:
    All packages built successfully! (All logs)

  • boost/1.75.0@:
    All packages built successfully! (All logs)

  • boost/1.74.0@:
    All packages built successfully! (All logs)

  • boost/1.76.0@:
    All packages built successfully! (All logs)

@madebr
Copy link
Contributor Author

madebr commented May 10, 2021

@uilianries
@prince-chrismc @SpaceIm

Can you please review this pr?

@@ -672,8 +700,7 @@ def _build_bcp(self):
with tools.vcvars(self.settings) if self._is_msvc else tools.no_op():
with tools.chdir(folder):
command = "%s -j%s --abbreviate-paths toolset=%s" % (self._b2_exe, tools.cpu_count(), self._toolset)
if "debug_level" in self.options:
command += " -d%d" % self.options.debug_level
command += " -d%d" % self.options.debug_level
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for finally fixing this 😄 #4121

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but it was already fixed in #4121, isn't it?

Copy link
Contributor Author

@madebr madebr May 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed.
This is #4121 (comment)

debug_level is never removed from the options object, so there's no need for get_safe.
It is removed from package_id, but that does not matter.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was my optional suggestion here, #4121 (comment)... just some clean up

Comment on lines +738 to +747
# Older clang releases require a thread_local variable to be initialized by a constant value
tools.replace_in_file(os.path.join(self.source_folder, self._source_subfolder, "boost", "stacktrace", "detail", "libbacktrace_impls.hpp"),
"/* thread_local */", "thread_local", strict=False)
tools.replace_in_file(os.path.join(self.source_folder, self._source_subfolder, "boost", "stacktrace", "detail", "libbacktrace_impls.hpp"),
"/* static __thread */", "static __thread", strict=False)
if self.settings.compiler == "clang" and tools.Version(self.settings.compiler.version) < 6:
tools.replace_in_file(os.path.join(self.source_folder, self._source_subfolder, "boost", "stacktrace", "detail", "libbacktrace_impls.hpp"),
"thread_local", "/* thread_local */")
tools.replace_in_file(os.path.join(self.source_folder, self._source_subfolder, "boost", "stacktrace", "detail", "libbacktrace_impls.hpp"),
"static __thread", "/* static __thread */")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems odd to be undoing the previous release

Maybe?

Suggested change
# Older clang releases require a thread_local variable to be initialized by a constant value
tools.replace_in_file(os.path.join(self.source_folder, self._source_subfolder, "boost", "stacktrace", "detail", "libbacktrace_impls.hpp"),
"/* thread_local */", "thread_local", strict=False)
tools.replace_in_file(os.path.join(self.source_folder, self._source_subfolder, "boost", "stacktrace", "detail", "libbacktrace_impls.hpp"),
"/* static __thread */", "static __thread", strict=False)
if self.settings.compiler == "clang" and tools.Version(self.settings.compiler.version) < 6:
tools.replace_in_file(os.path.join(self.source_folder, self._source_subfolder, "boost", "stacktrace", "detail", "libbacktrace_impls.hpp"),
"thread_local", "/* thread_local */")
tools.replace_in_file(os.path.join(self.source_folder, self._source_subfolder, "boost", "stacktrace", "detail", "libbacktrace_impls.hpp"),
"static __thread", "/* static __thread */")
# Older clang releases require a thread_local variable to be initialized by a constant value
if not (self.settings.compiler == "clang" and tools.Version(self.settings.compiler.version) < 6):
tools.replace_in_file(os.path.join(self.source_folder, self._source_subfolder, "boost", "stacktrace", "detail", "libbacktrace_impls.hpp"),
"/* thread_local */", "thread_local", strict=False)
tools.replace_in_file(os.path.join(self.source_folder, self._source_subfolder, "boost", "stacktrace", "detail", "libbacktrace_impls.hpp"),
"/* static __thread */", "static __thread", strict=False)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is done for a purpose.
The boost conan recipe is a bad recipe in that it modifies and creates sources in the sources folder.
They are not copied to the build folder, or there is not an out-of-tree build going on.
That's why I try to revert the state of the build script to an initial state before patching.
This way when building for e.g. clang-5 and gcc-9, the patch is applied for clang but not for gcc-9.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then probably it is easier if we remove the no_copy_source from the recipe class. Simpler will be better in the long run, although it will take more time to build (but, hey! This is Conan, build once and use a thousand times 😄 ).

Not for this PR, but something to consider.

@@ -124,6 +126,8 @@ class BoostConan(ConanFile):
"extra_b2_flags": "None",
"i18n_backend": "iconv",
"visibility": "hidden",
"addr2line_location": "/usr/bin/addr2line",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how exactly does it work? does it hardcode addr2line location into the libraries?
if so, how is it expected to work if addr2line located in different place on the consumer's machine than on CI machine?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ran strings libboost_stacktrace_addr2line.a and did not find an occurrence of /usr/bin/addr2line.
So I think the library only contains the classes and I think it is possible to override the location of addr2line when compiling by defining some environment variable.

@conan-center-bot conan-center-bot merged commit 73b6ce4 into conan-io:master May 18, 2021
@madebr madebr deleted the boost_without_fiber branch May 18, 2021 10:40
@garethsb
Copy link
Contributor

Was this tested on macOS? It seems to have broken our build.

@madebr
Copy link
Contributor Author

madebr commented May 18, 2021

Only on the c3i ci.
Can you open an issue?

@garethsb
Copy link
Contributor

Will do. The CI logs at https://c3i.jfrog.io/c3i/misc/summary.html?json=https://c3i.jfrog.io/c3i/misc/logs/pr/5420/10/boost/1.75.0//summary.json only show macOS builds with status DUPLICATE or INVALID_CONFIGURATION, does that mean it wasn't?

@madebr
Copy link
Contributor Author

madebr commented May 18, 2021

@garethsb
The problem has undoubtedly something to do with:

if self._stacktrace_addr2line_available:
if os.path.abspath(str(self.options.addr2line_location)) != str(self.options.addr2line_location):
raise ConanInvalidConfiguration("addr2line_location must be an absolute path to addr2line")

Is addr2line available on Macos? What is its location?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[package] boost/1.73: Shared Library Builds broken if you build without fiber
7 participants