I’m trying to build sn_api using musl and have a problem with openssl (which I thought was removed once before but seems to be back again, maybe I’m thinking of sn_node?).
My compile instruction:
sn_api (f2589e0) $ cargo build --release --target x86_64-unknown-linux-musl
...
error: failed to run custom build command for `openssl-sys v0.9.60`
... lots of error text ...
The openssl dependency comes from the reqwest crate
reqwest says it depends on openssl (but only for linux) in their readme:
Reqwest uses rust-native-tls, which will use the operating system TLS framework if available, meaning Windows and macOS. On Linux, it will use OpenSSL 1.1.
Any thoughts about the best way to resolve this? Should I use gcc instead of musl?
I thought we had got rid of that, there is a feature flag rustls-tls: which would get rid of the openssl dep. I hate these c/c++ deps as they break loads of issues like musl and make life crazy for wasm etc. as well.
This error goes away by installing musl-tools, but I’m getting a dynamically linked binary by default, so I’m trying to re-create what we have in sn-node to properly build using musl-tools but statically-=linked binary. I’ve tried building sn-node myself and I hit the same ring error, so doing whatever we do in our sn-node CI (it seems we use a docker container) should hopefully work for CLI too.