-
Notifications
You must be signed in to change notification settings - Fork 58
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
The change to BoringSSL breaks builds #102
Comments
We also have this prolem. |
A possible workaround is to replace OpenSSL with BoringSSL in other dependencies. In particular, there are Alternatively, the legacy implementation is still there. It's currently only enabled when targeting WebAssembly. Ideally, there should be a |
If you can write a small test case that reproduces the issue, maybe this is something that can be reported to the maintainers of the |
I can't switch to BoringSSL. How about adding a second feature flag (e.g.
One could enable the legacy implementation by adding |
A second feature flag will not solve the cargo configuration issue: how to automatically enable it when the target is webassembly? |
Could we consider adding features for the JWT algorithms? It will also help reduce the compile time. In our project, we do not use the RSA algorithms at all. |
Please let's stay on topic. |
Can you provide a minimal test case that imports both |
I've been trying, but I can't figure it out for now. I have to make a deeper look this weekend. |
Minimal Cargo.toml:
and main.rs:
That builds just fine. But after doing nothing else than
|
Builds fine on macOS 🤷♂ |
On Linux any of the following changes to reqwest = { version = "0.11.22", default-features = false, features = ["native-tls-vendored"] } reqwest = { version = "0.11.22", default-features = false, features = ["rustls-tls"] } |
Unfortunately, it breaks quite a few of my projects as well. I am using rust-only whenever I can, which was the reason why I changed from I am left with one dependency in all my projects, that demands This forces me to use I would really appreciate it, if I prepared a minimal "crashing" example repo, but at this moment, I do not know a solution to make it work without forking either The repo can be found here: |
Read above. The rust implementation is still there. But I don't know how to automatically enable for WebAssembly or when a cargo flag is given. Tell me how to do it 😀 |
In order to help solve the symbol conflict between OpenSSL and BoringSSL, what would be useful is a minimal test case that only involves these two crates. |
I think the BoringSSL issue referenced above would solve it. But someone has to update all the symbols to add the prefix. This is easy to do, but it still has to be done. I'm sure the maintainers of the boring crate would appreciate it. |
Yes I know that the old one is still there. That's the good thing. :D I don't know if I have enough time later on, but maybe I could prepare a PR for this.
My small test repo does exactly that. It has only |
It should compile with the default flags, including webassembly. So, there's no way in cargo to include a dependency according to the target or a flag? |
Only with the openssl and boring crates. Not with JWT crates. That would be more useful to help the boring maintainers. |
I have never activated feature flags by target arch automatically, I don't know if this is possible. I can test some things later.
Got it, maybe this is easily changed though. |
Platform specific features are an open issue for But the solution from the PR works in my case. The wasm version should work without any feature specification as well. I would like someone else to test this though, I have not done much with wasm and do not currently have any test setup for this. |
Having to add a cargo flags just so that the project would compile is not clean. It would just be an awful hack to work around a limitation of Cargo due to its ancient design. But more importantly, that would be a breaking change for webassembly users. And this is something I'd really like to avoid. Wouldn't a "build.rs" file work either? If not, I can see two possible workarounds:
|
You only need to add the flag if you want to opt-out of the current usage of boring ssl. It is not even a breaking change and could be released as a patch version. edit: Just to be clear: The PR does not change anything about the current behavior. |
I have set up a wasm project myself now. Tbh, it did not even compile to wasm with the current release version 0.12.1, because I made it work and it does indeed compile on wasm (now) without specifying any features at all. Now it does:
|
I'm piping in here without much to add besides that the addition of libc to the dependency chain breaks my build within an alpine-musl build environment (which otherwise relies on rustls for SSL in all other dependencies). |
That is the exact same reason as in my case. Any musl target will break as soon as you add any vendored C libraries.
Feedback would be nice, if this fixes it for you. |
Thanks for the fork! I applied it using a slightly modified line in my Cargo.toml files and it indeed removed libc from the dependency chain: jwt-simple = { git = "https://github.com/sebadob/rust-jwt-simple", branch = "feature-pure-rust", default-features = false, features = ["pure-rust"] } e.g. -[[package]]
-name = "boring"
-version = "4.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8fed6dc629997e8c3c4d1dbd59cf748512b9b0e0fbc509cf9b0e2edca9d24d1a"
-dependencies = [
- "bitflags 2.4.1",
- "boring-sys",
- "foreign-types",
- "libc",
- "once_cell",
-]
-
-[[package]]
-name = "boring-sys"
-version = "4.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "91102749c3c99028f344c3bce1dc54b1aac49d52d03c60c75996f81ebdeaa41c"
-dependencies = [
- "bindgen",
- "cmake",
- "fs_extra",
- "fslock",
-]
- It now builds correctly in my build environment, e.g. FROM rust:1.71.0-alpine3.18 AS build
RUN apk update \
&& apk add musl-dev openssl-dev make bash htop tree py3-pip lld
ENV RUSTFLAGS="-Clink-arg=-fuse-ld=lld"
RUN rustup target add x86_64-unknown-linux-musl |
Hey there,
the change to BoringSSL breaks builds, I now get weird OpenSSL linker errors:
I guess this is because of a conflict betweet OpenSSL and BoringSSL. Am I right?
What can I do to fix this?
The text was updated successfully, but these errors were encountered: