-
Notifications
You must be signed in to change notification settings - Fork 960
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
[bug] bazel generator not usable for packages with multiple libs, like openssl #11559
Comments
The alwayslink option has of course the disadvantage that it will blow up the size from the consumer But I have no idea how that could be solved otherwise, since we do not know the required order of the libs. It could be an option to make the cc_import visibility public, then consumers can create their own version of a cc_library, and have the library just exporting the interface, but that is also complicated. With alwayslink, the recipes can at least be used ... |
additional info: conan writes the order of libraries correct, anyhow, the reason why I have the problem: this happens with buildozer unfortunately, buildozer uses buildifier to format the BUILD file, and that flips the order shall I change the PR so it adds a so maybe adding the comment would be a good idea, what do you think, @czoido ? |
Hi @a4z, |
yes, the |
Great, I'll mark this for the next release. Thanks for the contribution. |
* Add alwayslink attribute to bazel static library import Fixes #11559 There is no test currently for the static library only version Test exists only for the case when shared_with_interface_libs contains elements. * Remove always link in favor of do not sort * fix tests * Update conans/test/unittests/tools/google/test_bazeldeps.py Co-authored-by: czoido <mrgalleta@gmail.com>
Environment Details
Steps to reproduce
Use the bazel generator and use libcurl on Linux in your project, so it depends on openssl.
libcurl will not be usable in your bazel project, since libcrypto.a and libssl.a appear in the wrong order for the linker
Solution
To make the order work, the
alwayslink = True
attribute should be set on the cc_import libsSo this:
should look like that
in the generated BUILD file for openssl
we can also discuss if it would not make sense to set
visibility = ["//visibility:public"],
on the cc_import part, since there are use cases where users use only libcrypto , but not libssl from openssl, but that might be a different issueThe text was updated successfully, but these errors were encountered: