Closed cattyhouse closed 5 months ago
Thanks for the tip. I haven't considered compiling with musl instead of glibc. It'll be interesting to see what can of binary sizes I can get with it.
it's about 4MB with feature socks5 only for aarch64-unknown-linux-musl
it looks like to cross compile aarch64-unknown-linux-gnu, vendored is still needed
-tokio-native-tls = "0.3.1"
+tokio-native-tls = { version="0.3.1", features = ["vendored"] }
it's about 4MB with feature socks5 only for aarch64-unknown-linux-musl
I'm surprised. Did you compile with --release
? The current build with glibc is ~800KB
when you use vendored
, and do cross compile, openssl-sys is compiled into the binary, does not matter it is gnu or musl target.
Ah, now I understand. Hmm, you are using Cross to cross-compile? Maybe if you installed openssl in the build environment, then you don't need to use vendored
?
Yeah, maybe. But i like a static linked binary that runs everywhere. I'll apply this patch for my use case.
Yes, that's a good option to have. I'll implement this as a feature flag too.
with this feature enabled in Cargo.toml, it is able to cross compile musl static target with
cargo-zigbuild