Closed benjamin-awd closed 3 months ago
Hey Ben, thanks for the contribution!
I don't think it makes sense to merge this PR, and unlike #609 I wouldn't consider this a general issue.
Some crates have dependencies on system libraries, like libssl in this case. These are shared libraries (typically written in C) that are managed via system package managers rather than cargo. While we can add them to the image, there are hundreds of possible libraries a crate might depend on, so I don't think it makes sense to add all of them for image size and security reasons.
If you need to use a crate that relies on a system library that's not installed by default, you have two options:
features = ["vendored"]
). Many other such crates also support vendoring.In the future, I could imagine a more general solution that allows you to specify system packages you need as well.
In this case, openssl-sys supports vendoring, which means that the crate can build and statically link the c library into the binary (you can enable that with features = ["vendored"]). Many other such crates also support vendoring.
This is pretty cool, but unfortunately ran into another error 'Can't locate FindBin.pm in @INC' (I think the C library expects perl to be installed)
We're going to take your latter suggestion and maintain a custom image
Similar to https://github.com/ArroyoSystems/arroyo/pull/609 this fixes a bug that occurs at runtime when attempting to compile a UDF.
The following error was resolved by installing libssl-dev, based on this thread.