Hacker News new | ask | show | jobs
by throwaway161220 3458 days ago
Sadly it's outdated, only a single version, and missing all the other important rustup features. Ultimately rustup's Linux binaries would benefit from either optionally or exclusively being available in a version that's linked dynamically - or more practically - statically against musl. These would work in default docker images, Ubuntu, Red Hat, Alpine, Void Linux, anywhere that has Linux 2.6 ABI. Stack has started doing this for their GHC builds. Of course, a prerequisite is upstream support for hosting rust in a musl (no glibc) environment. Since Rust has a musl target for static compilation, it's natural to be hosted as well.
1 comments

Well, hosted is trickier due to compiler plugins, but yes. It's workable. In general, please submit bugs upstream or comment on any open issues; this package was created by someone who was working on exactly that!

Once you get rustc, rustup should be fine.

> Well, hosted is trickier due to compiler plugins, but yes.

This has been discussed multiple times in tickets and it's pending. Hopefully soon :).

> please submit bugs upstream or comment on any open issues

Of course but there's nothing I can add to already existing and open issues that hasn't already been discussed. There's a need for rustc dev focus on this just like msvc support in the past.

> Once you get rustc, rustup should be fine.

What do you mean? Being able to build rustup doesn't give you access to rustup toolchains/targets that run on Alpine, if that's what you mean. Or?

I meant that in most distros (I know more about Debian than Alpine), the first step is packaging rustc + cargo, then applications built with it. So I imagined it'd go the same way. rustc and cargo are much harder to package, so after that's done, other applications in Rust tend to be easier.
For bootstrapping it in and for a distro that's the right thing, but if we want to have access to the rustup toolchains and targets, then those require musl-hosting support upstream in order for rustup binaries to be made available which, like on Windows or FreeBSD, are downloaded and used by rustup.

Building rust right now takes enough time that it's hard to recommend a hypothetical from-source mode for rustup that works similar to OCaml's `opam switch compiler-vsn`. If building rustc becomes similarly fast, this can be a good alternative. And in that case having a rustc version in the distro is very useful, as long as it's not older than two releases.

Right. But std with musl is already available from the project; this is mostly about rustc.
Since I follow alpine linux dev a bit, I thought this: https://github.com/alpinelinux/aports/blob/master/testing/ru...

Is the port of rustc to run natively on AL? Bit outdated now but it seemed to work the last time I tried it.

You'd have to enable the testing repo to use it however.

That's for targeting musl, typically used for static linking. That should work when running rustup and rustc on FreeBSD as well.

What we're missing is rustc-on-musl and with that rustup-on-musl.