I have kind of a complicated setup. It is documented here:
In a nutshell, the problem is this: I am forced to compile a shared library for interoperability with Python to use the shared library as a Rust AWS Lambda function. I am building my shared library in the same environment as much as possible as the Amazon Linux execution environment used by AWS Lambda. Attempting to install
openssl-devel in this environment, however, results in upgrading OpenSSL from the default version of 1.0.1 to 1.0.2. Since my build environment links against 1.0.2 and the runtime environment is the older 1.0.1, my library crashes on startup with an invalid/unexpected OpenSSL version. I must make a shared library for Python/Lambda integration, but I’d like to statically compile OpenSSL in so I don’t run into this issue. Redoing everything in musl doesn’t give me anything as I think a shared library in musl would still want to link against OpenSSL.
Please see the GitHub above as it demonstrates the exact subtle nature of the issue.
How can I tell Cargo/rustc that I would like to statically compile OpenSSL into my shared library?