-
Notifications
You must be signed in to change notification settings - Fork 232
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
ODR issues with openssl/boringssl and other bazel libraries #306
Comments
It's certainly not beautiful, but I think you can work around this by creating your own workspace(name = "boost_openssl_override")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "boringssl",
url = "https://github.com/hedronvision/boringssl/archive/0f5d9c12d1291b0f29eba5c5dc7f9750bfab0032.tar.gz",
sha256 = "0c39e858689c7f3b3cfc0d88af9ec4aa615158a470ebf459dff06bd096a3ac9b",
strip_prefix = "boringssl-0f5d9c12d1291b0f29eba5c5dc7f9750bfab0032",
)
new_local_repository(
name = "openssl",
path = ".",
build_file_content = """
alias(
name = "ssl",
actual = "@boringssl//:ssl",
visibility = ["//visibility:public"],
)
""",
)
http_archive(
name = "com_github_nelhage_rules_boost",
url = "https://github.com/nelhage/rules_boost/archive/2abec7db70327bc0b4bbdb33c90ff096d0c95872.tar.gz",
strip_prefix = "rules_boost-2abec7db70327bc0b4bbdb33c90ff096d0c95872",
sha256 = "37a2568bbda4a61dc2467ad226a1dae93ee9496646217e141003ce9ec5aeb9ce",
)
load("@com_github_nelhage_rules_boost//:boost/boost.bzl", "boost_deps")
boost_deps() That will keep I would recommend replacing |
Use |
Thanks, I tried the repo_mapping solution for both grpc
But then it looked like boost was still downloading its own openssl and I couldn't get rid of the ODR issue. |
Please do report back what you learn! I'd have recommended those solutions, too. |
Thinking more about it, one other thing worth checking is the ordering in WORKSPACE, since I think that'll affect whether or not it'll work. I'd propose an ordering like:
But the last two could be switched--or you could use the version of boringssl pulled in by one of the two libraries. The important part is that the http_archive with the repo_mapping be listed later than the other. |
I had the exact ordering that you suggested i.e. bring in |
👍🏻 Figured I'd raise it just in case; delighted to hear you were ahead of me. Curious! |
@RajivKurian, any updates? I know I'm curious what you learned solving this :) |
It looks like for the asio-ssl target, boost brings in boringssl but calls it openssl.
When we use other libraries in our project (like GRPC) that also depend on boringssl, it leads to ODR issues.
It also seems that the
maybe
bazel helper doesn't work here, because rules_boost brings in boringssl but calls it openssl.So we cannot just define boringssl outside and have a single version that both rules_boost and grpc pick up.
Here is a sample error in an ASAN build when using GRPC and rules_boost:
Is there any suggestion (besides possibly building openssl just for rules_boost), where we could work around this? Would it be possible to call the project boringssl instead, so we can easily supply a single version?
The text was updated successfully, but these errors were encountered: