Skip to content
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

Suggested Linux target for binaries #11

Open
epage opened this issue Apr 20, 2018 · 1 comment
Open

Suggested Linux target for binaries #11

epage opened this issue Apr 20, 2018 · 1 comment
Labels

Comments

@epage
Copy link
Contributor

epage commented Apr 20, 2018

From rcoh

Just noticed that x86_64-unknown-linux-musl is tier 2 and the only thing verified is that the standard library compiles. Since most (?) CLI apps for linux are compiled with musl, I wonder if it should be given a higher priority given it's relative usage
https://forge.rust-lang.org/platform-support.html
Especially since Rust requires a very recent libc to run, it's the only way to get Rust to run on slightly older (but still very common) platforms like Debian Wheezy

From burntsushi

using musl is a very simple way to produce an executable with zero dynamic dependencies (ldd rg on the MUSL release binary should say "not a dynamic executable"). it is not always possible. for example, if your binary needs to talk over https, then you probably need to ship a binary that links to the native SSL implementation on your platform. this is likely why cargo and rustup don't ship musl binaries (perhaps among other things).

@epage
Copy link
Contributor Author

epage commented Jun 23, 2018

@vbrandl from #20

Linking Linux binaries against the glibc targets i686-unknown-linux-gnu and x86_64-unknown-linux-gnu will not produce static binaries since it dynamically links against the systems glibc and possibly others (e.g. OpenSSL).

Since binaries produced in CI should work without depending of specific versions of libraries being installed in the users system, I think it is better to link the released binaries against the musl targets (i686-unknown-linux-musl and x86_64-unknown-linux-musl).

While you might have to use helper crates like openssl-probe to make some things work, I prefer truly portable binaries over the alternative.

To link against musl in CI, I use the ekidd/rust-musl-builder image in my CI setup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant