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: Change assertions to warnings #3900

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions recipes/boost/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -1160,11 +1160,14 @@ def add_libprefix(n):
self.cpp_info.components[module].requires.append("{0}::{0}".format(conan_requirement))

if used_libraries != detected_libraries:
# TODO why do these sometime fail?
Copy link
Contributor

@madebr madebr Dec 15, 2020

Choose a reason for hiding this comment

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

These fail because the boost build script does not build a library if some dependency/requirement is not met.

e.g. Boost.Locale is not built with -o boost:without_locale=False -o boost:i18n_backend=icu -i icu:shared=False.
This is clearly an error.

Also, Boost.Json does not build when the active c++ standard is lower then c++11, even when b2 is run with --with-json.

So these assertions catch errors, that should get fixed in the conanfile.

Because it apparently catches a prpoblem with nowide being built on your system, which I did not see until now.

Copy link
Contributor

@madebr madebr Dec 15, 2020

Choose a reason for hiding this comment

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

Also, currently boost is configured using --without-xxx.
So all modules are enabled except those explicitly disabled.

In #3872 I have changed it to --with-xxx. Hopefully, this will only build those components explicitly enabled.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But there seem to be false positive errors, I only need system, yet boost is not failing because of nowide. What can we do ASAP to get boost working?

Copy link
Contributor

@madebr madebr Dec 15, 2020

Choose a reason for hiding this comment

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

To get it working NOW, try building with -o boost:extra_b2_flags=--without-nowide.
Be aware that this workaround will not work after #3872, because b2 does not allow mixing of --with-xxx and --without-xxx.

Copy link
Contributor

Choose a reason for hiding this comment

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

It's not a false positive btw, it detected a rogue library which should not have been there.

non_used = detected_libraries.difference(used_libraries)
assert len(non_used) == 0, "These libraries were not used in conan components: {}".format(non_used)
if len(non_used) == 0:
self.output.warn("These libraries were not used in conan components: {}".format(non_used))

non_existing = used_libraries.difference(detected_libraries)
assert len(non_existing) == 0, "These libraries were used, but not built: {}".format(non_existing)
if len(non_existing) == 0:
self.output.warn("These libraries were used, but not built: {}".format(non_existing))

if not self.options.without_python:
pyversion = tools.Version(self._python_version)
Expand Down