Create a musl build #24
Comments
3.7 is out |
I've updated the instructions - rust-lang/rust#28389 |
@aidanhs any updates to the status of this? Is this something that can be done? |
/cc @alexcrichton, I know he was working on musl support and may have some info on the status of this. |
There was a recent thread on this on rust-internals - https://internals.rust-lang.org/t/request-for-adding-free-hardened-bsd-and-linux-musl-to-official-releases/3185 I think the crucial quote is this:
Which I believe roughly translates to: "MUSL doesn't do dynamic builds. Dynamic builds are required for some nightly features and we don't want crippled nightly builds, so MUSL will not become a nightly build." I think the next step is to do one of two things:
As I've mentioned in the topic, adding the ability to dynamically link MUSL binaries will probably not help - it's effectively a different target to static musl, so you'd just end up with nightly releases of dynamic musl :( |
Perhaps I'm missing something, but @aidanhs is it not possible to have a rustc that itself uses dynamic linking (for complier plugins), but that can produce binaries that are statically linked? |
Being brief because my last toying with the rust build system was a while ago: I think the last stage of the rust build system (stage3 iirc) is effectively "let's test if this compiler is self-hosting". So to answer your question: maybe, but this seems like it'd subvert the point of this final stage. (but I may be totally wrong, as I seem to recall that a rustc compiler able to build musl must also be able to build glibc executables for some reason, which raises a question-mark over what I say. I'll delete my comment if it turns out I'm spreading bad information) |
I just built from source a MUSL compiler and it does output glibc binaries unless you ask it to do MUSL.
I'm currently building a docker container to contain the MUSL compiler, but it'd be nicer if I could just use a pre-built compiler. |
@saeta as I find happens very often, @alexcrichton is a few steps ahead and already has dockerfiles for musl rust! https://github.com/alexcrichton/port-of-rust Regarding the |
Oh right! I forgot to close out this issue :) So, the state of things today:
In terms of building a compiler linked against MUSL I'd definitely be up for at the very least supporting that! The first step would just be adding support to the build system to actually do that. Then there'd probably also be some changes to the builder image to for example get a libstdc++ linking against MUSL. If we've got that up and running seems easy enough to add a new builder and a new nightly! (pretty low cost on our end) Does that help @aidanhs and @saeta? I'm gonna close this issue specifically (as we have the nightly MUSL standard library), but feel free to open an issue in rust-lang/rust about enabling a MUSL compiler! |
The new rustup now allows you to download the musl stdlib for use with your compiler, so no compilation needed. See https://internals.rust-lang.org/t/static-binary-support-in-rust/2011/53. |
This issue is to track my desire to have a nightly musl build.
We can't use a release of llvm because 3.7 isn't out yet (https://llvm.org/bugs/show_bug.cgi?id=23364), so I'd say there's nothing to do at the moment.
The text was updated successfully, but these errors were encountered: