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

Ship binaries for 32-bit ARM architecture #9670

Closed
Jonahss opened this issue Jul 22, 2021 · 20 comments
Closed

Ship binaries for 32-bit ARM architecture #9670

Jonahss opened this issue Jul 22, 2021 · 20 comments

Comments

@Jonahss
Copy link

Jonahss commented Jul 22, 2021

I installed rust-analyzer for VSCode and an error message popped up:

Unfortunately we don't ship binaries for your platform yet.
You need to manually clone rust-analyzer repository and run
`cargo xtask install --server` to build the language server from sources.
If you feel that your platform should be supported,
please create an issue about that here and we will consider it.

I'm working on an embedded Rust project on my Raspberry Pi. I'm using VSCode's "remote ssh" mode, where the code lives on the Raspberry Pi but I'm developing remotely from my Macbook.

I'll try building from source, but adding the issue here because the helpful error message suggested it.

@lnicola
Copy link
Member

lnicola commented Jul 22, 2021

We have AArch64 (64-bit ARM) binaries, but not 32-bit ones. Our memory usage tends to get a bit high, and the 3GB available on 32-bit might sometimes be tight, depending on how much code you have.

But you don't need to compile it, you can get a it from rustup. It's available in the nightly toolchain as rust-analyzer-preview, and you can set the path to it in the Code config.

That doesn't mean you can use nightly for your project, you can keep on using stable as the default toolchain.

@jonas-schievink
Copy link
Contributor

Most Raspberry Pis are AArch64, maybe you've installed a 32-bit OS by accident? What does uname -a print?

Using rust-analyzer should work on a Raspberry Pi 4, but you'll probably want the version with 8 GB of RAM.

@lnicola
Copy link
Member

lnicola commented Jul 22, 2021

I think Raspbian is still 32-bit: https://www.raspberrypi.org/software/operating-systems/

@jonas-schievink
Copy link
Contributor

Oh

@Jonahss
Copy link
Author

Jonahss commented Jul 25, 2021

Well, I got it working after building from source. For now, my project is very tiny, so the memory usage is not a problem.
It looks like there might be an official 64bit release of Raspberry Pi OS in August.

@lnicola
Copy link
Member

lnicola commented Jul 25, 2021

Is there any reason why you couldn't use the version in rustup?

@Jonahss
Copy link
Author

Jonahss commented Jul 25, 2021

Is there any reason why you couldn't use the version in rustup?

I didn't try. I had already started compiling by the time I posted the original issue. It took about an hour on my Raspbery Pi 4. If I had to do it again, I'd try rustup.

@lnicola
Copy link
Member

lnicola commented Jul 25, 2021

Oh, okay.

an hour

Ugh.

@Jonahss
Copy link
Author

Jonahss commented Jul 25, 2021

I thought that was pretty good for the Raspberry Pi!

@cr1901
Copy link

cr1901 commented Jul 27, 2022

I would personally still be interested in 32-bit ARM binaries, if only to avoid any extra manual work of having to install binaries and have new versions of the VSCode plugin just "do the right thing". In the interim, down to 36 minutes on a 4-core SBC w/ 2GB RAM:

    Finished release [optimized] target(s) in 36m 39s
   Replacing /home/wjones/.cargo/bin/rust-analyzer
    Replaced package `rust-analyzer v0.0.0 (/home/wjones/src/rust/rust-analyzer/crates/rust-analyzer)` with `rust-analyzer v0.0.0 (/home/wjones/src/rust/rust-analyzer/crates/rust-analyzer)` (executable `rust-analyzer`)
wjones@DietPi:~/src/rust/rust-analyzer$ uname -a
Linux DietPi 4.19.69-rockchip #5.95 SMP PREEMPT Mon Sep 2 07:34:36 CEST 2019 armv7l GNU/Linux

Is there any reason why you couldn't use the version in rustup?

Although I guess this should be obvious in retrospect, the docs didn't make it clear that a rust-analyzer installed from rustup works regardless of the toolchain you're using and there's no e.g. toolchain overrides needed to invoke the analyzer.

If rust-analyzer uses the default install path, using rustup from now on is fine w/ me.

@bjorn3
Copy link
Member

bjorn3 commented Jul 28, 2022

There is an open rustup PR to add a rustup wrapper for rust-analyzer.

@jonas-schievink
Copy link
Contributor

(rust-lang/rustup#3022 adds the wrapper)

@jonas-schievink jonas-schievink changed the title Ship binaries for ARM architecture Ship binaries for 32-bit ARM architecture Jul 28, 2022
@jonas-schievink
Copy link
Contributor

VS Code does seem to support 32-bit ARM, and according to https://code.visualstudio.com/api/working-with-extensions/publishing-extension#platformspecific-extensions it has a linux-armhf target. We could try to publish an extension bundle for that.

@lnicola
Copy link
Member

lnicola commented Jul 28, 2022

Yeah. Windows 32-bit has also been requested quite often.

@jonas-schievink
Copy link
Contributor

With #12920, the prerelease version 0.4.1154 now provides a 32-bit ARM Linux release. Please try it out to see if it works.

@cr1901
Copy link

cr1901 commented Aug 2, 2022

@jonas-schievink The pre-release appears to be working correctly on my SBC, thanks for adding it!

INFO [8/1/2022, 8:58:14 PM]: Using server binary at /home/wjones/.vscode-server/extensions/rust-lang.rust-analyzer-0.4.1154-linux-armhf/server/rust-analyzer
wjones@DietPi:~/src/rust/pi-ctl$ uname -a
Linux DietPi 4.19.69-rockchip #5.95 SMP PREEMPT Mon Sep 2 07:34:36 CEST 2019 armv7l GNU/Linux

@jonas-schievink
Copy link
Contributor

Great to hear! It would be good if someone could test on a Raspberry Pi too, since those are used quite often.

@cr1901
Copy link

cr1901 commented Aug 23, 2022

#13081 may apply to this issue as well- it does on my SBC running Buster. I'll upgrade to Bullseye soon.

However, the plugin itself downloads the binary just fine (which then results in the GLIBC 2.29 error), so workaround until I upgrade is this comment. Also, make sure to replace nightly-x86_64-unknown-linux-gnu with nightly-armv7-unknown-linux-gnueabihf or equivalent, like I managed to forget :).

@lnicola
Copy link
Member

lnicola commented Aug 23, 2022

If your plugin downloads anything, that's probably #11080.

@lnicola
Copy link
Member

lnicola commented Feb 11, 2023

arm-unknown-linux-gnueabihf was added in #12920. I don't know if we want to build for other ARM variants. Maybe newer ones?

@lnicola lnicola closed this as completed Feb 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants