Skip to content

Unify the two BoringSSL codepaths a bit and simplify init #2377

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

Merged
merged 1 commit into from
Mar 3, 2025

Conversation

davidben
Copy link
Contributor

@davidben davidben commented Mar 3, 2025

Although bssl-sys (currently) provides init, it only does so for rust-openssl, and it's more natural for rust-openssl to consistently be responsible for it. Also BoringSSL has not required initialization at all since June 2024.

I've also removed the ambiguous_glob_reexports allowance. I couldn't reproduce whatever triggered it, and it seems unlikely that the two codepaths would have different needs here.

This leaves the remaining non-build unstable_boringssl trigger so minor that perhaps we should just remove it here? It dates to some problematic Android Rust integration. At this point, it's just an external mechanism to get the same output as the build.rs logic around bindgen, mostly because bindgen has perpetual deficiencies w.r.t. correctly binding C, so we need to work around it. Ideally there wouldn't be two sources of those workarounds, but Google's build environments care about build reproducibility and hermeticity, while Rust and Cargo have... very much not achieved this yet. But there's no reason for rust-openssl's build to care about this.

Although bssl-sys (currently) provides init, it only does so for
rust-openssl, and it's more natural for rust-openssl to consistently be
responsible for it. Also BoringSSL has not required initialization at
all since June 2024.

I've also removed the ambiguous_glob_reexports allowance. I couldn't
reproduce whatever triggered it, and it seems unlikely that the two
codepaths would have different needs here.

This leaves the remaining non-build unstable_boringssl trigger so minor
that perhaps we should just remove it here? It dates to some problematic
Android Rust integration. At this point, it's just an external mechanism
to get the same output as the build.rs logic around bindgen, mostly
because bindgen has perpetual deficiencies w.r.t.  correctly binding C,
so we need to work around it. Ideally there wouldn't be two sources of
those workarounds, but Google's build environments care about build
reproducibility and hermeticity, while Rust and Cargo have... very much
not achieved this yet. But there's no reason for rust-openssl's build to
care about this.
@alex
Copy link
Collaborator

alex commented Mar 3, 2025

I don't have a sense of who the users of the boringssl support here are besides you guys and us :-) We use the bindgen path but uhh, I guess we'll keep the unstable_boringssl stuff as long as you don't mind maintaining it?

@alex
Copy link
Collaborator

alex commented Mar 3, 2025

This is a good cleanup regardless, thanks! (And thanks for making a library without initialization APIs.)

@alex alex merged commit f672fcc into sfackler:master Mar 3, 2025
67 checks passed
@davidben davidben deleted the bssl-init branch March 3, 2025 03:08
@davidben
Copy link
Contributor Author

davidben commented Mar 3, 2025

Well, it's extra silly because unstable_boringssl does not reflect what Android are doing anyway. They're actually using bssl-sys to swap out openssl-sys rather than the bindgen output. (But I suspect, since you all still use openssl-sys, they should too.) Anyway, piles of things to fix later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants