-
Notifications
You must be signed in to change notification settings - Fork 0
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
libssl and zlib not statically linked #10
Comments
Static linking of these libs increase the binary size with 3MB, but still reasonable! |
Maybe in the future this would be an opt-in feature (dynamic vs static), but for now the static binary is more important |
After the above config options, the command
This can be resolved by providing additional build options, either via build flags, of using a
|
This can no also be verified on a clean ubuntu image: https://github.com/digitaldasein/compono/blob/main/README.md#tests |
Successfully tested on Ubuntu for
|
First of all: let's keep an eye on this one: rust-lang/rust#39998
One can check dependencies in the
Cargo.lock
file.To check which dependencies are linked dynamically, run
(Note that not all printed lines are necessarily a dynamic link to a library (e.g. there is rustc-link-lib=static=...))
This returns:
Alternatively, one could find out such info via:
readelf -d target/debug/compono | grep NEEDED
ssh2 and git2 have openssl-rust-binder dependencies,.
By default, it will use
pkg-config
on Linux to find out where libssl is located, and as such link it dynamically (https://docs.rs/openssl/0.10.24/openssl/#automatic)Alternatives
So for the ssh2 crate, we could set: https://docs.rs/crate/ssh2/latest/features, i.e., in the
toml
-config:Flate2, as well as git2 and others use the zlib, but this library seems to be linked dynamically as well.
They all use the libz-sys lib, which has a
static
feature. So, let's use another approach that also works here, i.e., declaring the dependency explicitly in yourCargo.toml
file, that is, with the appropriate features enabled. In this case:The text was updated successfully, but these errors were encountered: