-
Notifications
You must be signed in to change notification settings - Fork 2.6k
install-deps.py: add x86_64-unknown-linux-musl target #2532
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
Conversation
This lets me build a statically linked cargo on our linux-cross Docker image with the following commands: $ apt-get install musl-tools # for musl-gcc, which is needed to build openssl $ ./.travis.install.deps.sh $ ./configure --local-rust-root=$(pwd)/rustc --enable-nightly --target=x86_64-unknown-linux-musl $ make $ file target/x86_64-unknown-linux-musl/release/cargo cargo: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), statically linked (..)
Out of curiosity, what's the rationale for a MUSL build of Cargo? We certainly can produce one, but I'm not entirely sure what the use case would be. |
@alexcrichton This came up in IRC: we can provide binaries that can be built on non-ancient distributions and work on any Linux system (unless musl is using new syscalls, I guess), and they can work on NixOS out of the box. @brson seemed to be okay with running |
Hm I may still be a bit confused. You can build Cargo binaries on any Linux distribution, right? Not using MUSL doesn't gate out newer ones, right? Does Cargo not work on NixOS out of the box? If so, how come? I also believe that MUSL claims to support Linux 2.6+ so even though it does try to use newer syscalls in some situations I believe there's always a fallback if the kernel is too old (I recall seeing an instance or two of this at least). Also what's up with |
@alexcrichton another reason is that this cargo would work on musl-based linux distros like alpine. Now they just need a rustc that works over there... |
Ok, after some more discussion with @eddyb on IRC seems reasonable to at least have a build of Cargo for this to me! @japaric this'll actually probably use the |
@alexcrichton tested this on the rust-slave-linux container, and both
|
Nice! Are you sure you didn't need to add more variables to compile OpenSSL for MUSL though? Seems like we should at least inform OpenSSL that the compiler is Those seem like reasonable changes to the container, however. |
I didn't have to.
You did that already. 😃 |
As @alexcrichton from the future descends... Thanks @japaric! If you want to send the updates to the linux container I'll upload a new version and we can configure buildbot to produce a new Cargo |
install-deps.py: add x86_64-unknown-linux-musl target This lets me build a statically linked cargo on our linux-cross Docker image with the following commands: $ apt-get install musl-tools # for musl-gcc, which is needed to build openssl $ ./.travis.install.deps.sh $ ./configure --local-rust-root=$(pwd)/rustc --enable-nightly --target=x86_64-unknown-linux-musl $ make $ file target/x86_64-unknown-linux-musl/release/cargo cargo: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), statically linked (..) --- r? @alexcrichton -- If we want start building cargo for this target on the bots, we'll have to modify the linux-cross Dockerfile to install musl-tools. cc @eddyb
💔 Test failed - cargo-win-gnu-64 |
@bors: retry good ol' high quality MSYS make On Wed, Mar 30, 2016 at 9:32 AM, bors [email protected] wrote:
|
⚡ Previous build results for cargo-cross-linux, cargo-linux-32, cargo-linux-64, cargo-mac-32, cargo-mac-64, cargo-win-gnu-32, cargo-win-msvc-32, cargo-win-msvc-64 are reusable. Rebuilding only cargo-win-gnu-64... |
☀️ Test successful - cargo-cross-linux, cargo-linux-32, cargo-linux-64, cargo-mac-32, cargo-mac-64, cargo-win-gnu-32, cargo-win-gnu-64, cargo-win-msvc-32, cargo-win-msvc-64 |
This lets me build a statically linked cargo on our linux-cross Docker image with the following
commands:
$ apt-get install musl-tools # for musl-gcc, which is needed to build openssl
$ ./.travis.install.deps.sh
$ ./configure --local-rust-root=$(pwd)/rustc --enable-nightly --target=x86_64-unknown-linux-musl
$ make
$ file target/x86_64-unknown-linux-musl/release/cargo
cargo: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), statically linked (..)
r? @alexcrichton -- If we want start building cargo for this target on the bots, we'll have to modify the linux-cross Dockerfile to install musl-tools.
cc @eddyb