-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Boost: fix error when building without fiber + improve stacktrace support #5420
Conversation
I detected other pull requests that are modifying boost/all recipe:
This message is automatically generated by https://github.com/ericLemanissier/conan-center-conflicting-prs so don't hesitate to report issues/improvements there. |
This comment has been minimized.
This comment has been minimized.
Happy to give this a try, but how do I point Conan at this PR recipe? Incidentally, I understand that Boost only looks for |
Thanks! 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
Boost.Stacktrace supplies multiple back-ends for stacktrace: noop, libbacktrace, addr2line, windbg and windbg_cached.
You don't need to add |
Ah, ok, I should add some more detail to my situation. I am having trouble with Boost and This is also why my In my situation, there is no Incidentally, how do I add |
See https://docs.conan.io/en/latest/reference/conanfile_txt.html#options [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: |
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 I'll try these things out and report back if this PR helps. |
It's still a mess. 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. I'm not sure yet, because it is possible to define a different
You can only use one at a time.
Once again, thanks! |
This comment has been minimized.
This comment has been minimized.
7b39ef5
to
6eb09e5
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
19c7c1c
to
0a19a2f
Compare
Sure. I'm cross-compiling on an Intel x86_64 machine. Here's my Conan profile:
In case it helps, here's the Dockerfile for the container I'm building within (Docker is on an x86_64 host):
After building the Docker image, I'm doing this:
Please let me know if I can provide any more info. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
The m4 error is because your intel machine is attempting to run an host_profile:
build profile:
When building boost inside the docker using
, I was able to create boost but the stacktrace test_package fails to build with the following error:
I believe this is a problem with libunwind, not with boost. (I'm not sure though) |
All green in build 10 (
|
@uilianries 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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
# 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 */") |
There was a problem hiding this comment.
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?
# 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) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
Was this tested on macOS? It seems to have broken our build. |
Only on the c3i ci. |
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 |
@garethsb conan-center-index/recipes/boost/all/conanfile.py Lines 330 to 332 in 73b6ce4
Is |
Specify library name and version: boost/all
boost_stacktrace_addr2line
problem described in [package] boost/1.75.0: Build error for iOS on Mac #3992boost_stacktrace_backtrace
boost_stacktrace_noop
,boost_stacktrace_basic
,boost_stacktrace_windbg
,boost_stacktrace_windbg_cached
conan-center hook activated.