|
|
|
|
|
by dijit
1381 days ago
|
|
it's pretty trivial to create static binaries in Rust, but things like openssl won't compile since openssl depends on glibc. Two commands to get you running: 1) rustup target add x86_64-unknown-linux-musl 2) cargo build --target=x86_64-unknown-linux-musl |
|
One thing Go has going for it is that they have a more complete standard library so you can do without the pain of cross-compiling—which is what you're doing if most of your libs assume you're in a glibc environment but you really want musl.
I know because I recently tried compiling a Rust application that had to run on an air-gapped older Debian machine with an old glibc, and the easiest solution was to set up a debian container, download Rust and compile there, instead of fixing all the cargo deps that didn't like to be built with musl.