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

Add support for aarch64-unknown-linux-musl (alpine armv8) #2003

Closed
gidjituser opened this issue Sep 18, 2019 · 23 comments
Closed

Add support for aarch64-unknown-linux-musl (alpine armv8) #2003

gidjituser opened this issue Sep 18, 2019 · 23 comments
Labels
fixed-next-release This issue will be fixed in the next release of rustup.

Comments

@gidjituser
Copy link

gidjituser commented Sep 18, 2019

Cannot install rust on an arm based alpine linux distribution. In my case armv8 (64-bit). musl is only supported on x86.

It would be great to support the platform aarch64-unknown-linux-musl

@kinnison
Copy link
Contributor

This looks like it ought to be possible, based on the platform support list. I guess someone needs to work out the right docker bits. Should be an easy contribution if you want to give it a go. I'm willing to help if someone shows up on our Discord too.

@gidjituser
Copy link
Author

gidjituser commented Sep 20, 2019

Thanks. I am pretty new to rust, however I will try and give it a stab.

I am currently using latest docker edge for the platform capability.

FROM balenalib/aarch64-alpine
# Install build tools
RUN apk add --no-cache build-base gcc pkgconfig curl file git openssl-dev 
ENV PATH=/root/.cargo/bin:$PATH
# Install Rust
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y 
docker buildx build --platform linux/arm64 -t my/rust-image .

rustup-init.sh fails in get_bitness() as head -c 5 /proc/self/exe errors with Bad descriptor. Might need an alternative to getting bitness (32 or 64 bit) without dependencies.

@mati865
Copy link
Contributor

mati865 commented Sep 23, 2019

There is no possibility to do it right now because aarch64-unknown-linux-musl is target only (does not provide cargo and rustc) because Rust does not have enough CI budget.

@kinnison
Copy link
Contributor

So it is :( I shall remove the easy/mentor tags for now, thanks @mati865

@gidjituser
Copy link
Author

Thanks for the updates. Currently rust arm64 docker images are quite large. Cannot use alpine or build static as that requires musl. Hopefully this will get in the pipeline at some point.

@alex
Copy link
Member

alex commented Aug 19, 2020

Is this the sort of thing that would be enabled by the ongoing work to add aarch64 CI for Rust, and making it a T1 platform? (rust-lang/rfcs#2959)

@rbtcollins
Copy link
Contributor

Probably; I can't imagine that rustup wouldn't be able to install a Tier 1 triple.

@alex
Copy link
Member

alex commented Aug 19, 2020

Actually, I guess I have a slightly more important question: Does this require an aarch64 builder, or could it be done in src/ci/docker/host-x86_64/dist-aarch64-linux/Dockerfile, which cross-compiles currently?

I'm happy to provide a PR in that case -- if this is just a case of CI budget, I think the move to GHA has addressed that.

@alex
Copy link
Member

alex commented Aug 19, 2020

(Ugh, I just realized this issue was on the rustup repo, and not the rust one)

geoffreyblake added a commit to geoffreyblake/infra that referenced this issue Aug 19, 2020
- Alpine Linux -- missing rustup precompiled binary -- Issue: rust-lang/rustup#2003
- manylinux1
- manylinux2010
@tcurdt
Copy link

tcurdt commented Sep 11, 2020

Could someone please explain the path forward to get official arm binaries for rustup?
I suspect interest in arm will increase even more with Apple moving away from Intel.
Is it really just build minutes missing?

@kinnison
Copy link
Contributor

The platform has to be tier one or two, with the compiler and cargo available for the target before rustup can begin to be made available.

@tcurdt
Copy link

tcurdt commented Sep 11, 2020

@kinnison Thanks for the quick response.

So IIUC from reading this:

https://doc.rust-lang.org/nightly/rustc/platform-support.html

cargo and rustc are not supported as host systems yet.

Maybe a stupid question: What needs to be done to get support for a host platform? I would have thought that's the easy part.

@kinnison
Copy link
Contributor

I think you need to talk to the compiler team for that.

@alex
Copy link
Member

alex commented Sep 11, 2020

rust-lang/rust#75721 is probably a better ticket to track for this

@alex
Copy link
Member

alex commented Sep 16, 2020

With rust-lang/rust#76420 these are now being built in CI. Dunno what's involved in making rustup aware of them, if anything.

@kinnison
Copy link
Contributor

First step would be to write support into our linux workflow template, regenerate the workflows with this new target enabled for PRs, and submit a PR to test if it builds.

@IronOxidizer
Copy link

Is that the last piece needed to build
https://static.rust-lang.org/rustup/dist/aarch64-unknown-linux-musl/rustup-init
?

@kinnison
Copy link
Contributor

Well, once it's proven out in CI, we then have to clean it up to only build it on the stable branch, get that PR merged, and then it'll turn up in the next release. It'd be worth checking that rustup-init.sh identifies the platform properly too, otherwise that'll fail.

@Gelbpunkt
Copy link
Contributor

Anyone working on this? Might give it a shot, but I have no experience with the rustup codebase. If anyone else is working on this or has more experience, I'll happily wait for them to finish it 😄

@kinnison
Copy link
Contributor

To my knowledge, nobody is working on this yet.

@est31
Copy link
Member

est31 commented Nov 18, 2020

This is implemented in #2493, right?

@kinnison kinnison added fixed-next-release This issue will be fixed in the next release of rustup. and removed enhancement labels Nov 18, 2020
@kinnison
Copy link
Contributor

Yep, well spotted.

@kinnison
Copy link
Contributor

Rustup 1.23.0 is now out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed-next-release This issue will be fixed in the next release of rustup.
Projects
None yet
Development

No branches or pull requests

9 participants