Fix Android cross-build with vendored OpenSSL#100
Conversation
Forward vendored OpenSSL library paths to picoquic CMake during Android cargo-ndk builds, isolate Android builds from host pkg-config state, enable minimal picoquic Android builds, and avoid Bash 4-only lowercase expansion in build_picoquic.sh for macOS Bash compatibility.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 872e14735e
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if let Some(crypto) = find_openssl_library(root, "crypto") { | ||
| command.env("OPENSSL_CRYPTO_LIBRARY", crypto); | ||
| } | ||
| if let Some(ssl) = find_openssl_library(root, "ssl") { | ||
| command.env("OPENSSL_SSL_LIBRARY", ssl); |
There was a problem hiding this comment.
Preserve explicit OpenSSL library overrides
When callers set OPENSSL_ROOT_DIR together with explicit OPENSSL_SSL_LIBRARY/OPENSSL_CRYPTO_LIBRARY (which build.rs accepts as a supported override), these new Command.env calls replace the inherited explicit paths before scripts/build_picoquic.sh sees them. In cross-builds where the root is used for headers but the usable target libraries live in a different directory or have a nonstandard name, picoquic will be configured against the first lib{ssl,crypto}.{a,so} under the root instead of the caller-selected libraries, regressing previously working override-based builds.
Useful? React with 👍 / 👎.
|
D'oh! That's exactly what I needed. Thanks. I'll close this PR. |
Summary
This fixes Android
cargo-ndkcross-compilation ofslipstream-clientwith vendored OpenSSL enabled.The changes:
OPENSSL_CRYPTO_LIBRARY/OPENSSL_SSL_LIBRARYpaths to picoquic CMake when available;pkg-configpaths to avoid accidentally picking up Homebrew/macOS OpenSSL;scripts/build_picoquic.shwith portabletr, so the script works with macOS default Bash 3.2.Validation
Validated from an Android Gradle/cargo-ndk integration by building
slipstream-clientsuccessfully for:aarch64-linux-android/arm64-v8ax86_64-linux-android/x86_64armv7-linux-androideabi/armeabi-v7ai686-linux-android/x86The build keeps OpenSSL enabled for
picotls-openssl/ certificate pinning support.