Unify the two BoringSSL codepaths a bit and simplify init #2377
+7
−10
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.