News for hackers. Stuff that matters.
Re:Thoughts on Rust, a few thousand lines in by kazinator on Wednesday January 09, 2019 @04:45PM (#18869248)
> Like Go, Rust can compile statically linked linux binaries.

The GNU C library (needed not only by C programs for C things) doesn't support static linking, so the only way this is possible is to use another library entirely, or raw inlined syscalls (where applicable).

Re:Thoughts on Rust, a few thousand lines in by steveklabnik on Wednesday January 09, 2019 @04:54PM (#18869337)
Yes, we have full support for MUSL. It's a

  $ rustup target add x86_64-unknown-linux-musl
  $ cargo build --target x86_64-unknown-linux-musl
away.
Re:Thoughts on Rust, a few thousand lines in by ekidd on Wednesday January 09, 2019 @05:10PM (#18869488)
Yeah, Rust's musl support is great. We use it heavily at work for all sorts of CLI tools. Many thanks to everybody who worked on this.

(And if you need to link against common C libraries like OpenSSL or PostgreSQL, I maintain a Docker image with the necessary C toolchains, and instructions on how to use it: https://github.com/emk/rust-musl-builder. There are a couple of similar images out there, too, I think.)

Re:Thoughts on Rust, a few thousand lines in by throwaway23H on Wednesday January 09, 2019 @09:04PM (#18870923)
You can also download the cross-compilation tarball for musl at https://static.rust-lang.org/dist/rust-std-1.31.0-x86_64-unk... if you installed rust that way. You'd then build normally:

    $ cargo build --target x86_64-unknown-linux-musl
Re:Thoughts on Rust, a few thousand lines in by jabl on Thursday January 10, 2019 @02:40AM (#18872207)
By default rust links dynamically to glibc, while rust stuff is statically linked. Which I think is a reasonably good default. Most Linux systems provide glibc, and you can deploy binaries to them without those systems needing a rust installation.

Of course, there's the usual issue with glibc symbol versioning, so you probably want to build your binaries on the oldest supported system (say, a centos 6 container).

Re:Thoughts on Rust, a few thousand lines in by dbaupp on Wednesday January 09, 2019 @05:01PM (#18869412)
Rust's main toolchain has first class support for musl: https://rust-lang-nursery.github.io/edition-guide/rust-2018/...