Rust-Analyzer VScode plugin within raspberry pi

Hi all,
Not sure where is the correct place to post this, so hoping that it will save others' time.

Working on DIY project using RPi4, I found that VScode can run remote sessions using SSH.
So I opted-in, and opened a workspace on my RPi, with the goal of learning Rust.

Installed the Rust plugin pack and started seeing plugin errors like missing h files, etc...
I found that gcc-multilib/g++-multilib are not available for aarch64 (ARMv7) on Raspbian (no desktop environment, just terminal/ssh.)

Tried playing with it a little, build from source, compile, hack, gave up.
As a last resort, I saw somewhere the idea of just installing certain/peer packages and link the required files.
So here are my steps:

1. sudo apt install libc6-dev-arm64-cross/stable
2. sudo ln -s  /usr/include/aarch64-linux-gnu/bits /usr/include/bits
3. sudo ln -s  /usr/include/aarch64-linux-gnu/sys/cdefs.h /usr/include/sys/cdefs.h
4. sudo ln -s  /usr/include/aarch64-linux-gnu/gnu/stubs.h /usr/include/gnu/
5. sudo ln -s /usr/include/aarch64-linux-gnu/gnu/stubs-lp64.h /usr/include/gnu/

After issuing the above commands, restarted VScode, and rust-analyzer plugin errors were gone.

If anyone encountered that, feel free to share your solution
J

rust-analyzer does not require any .h files to run, maybe you had the C++ plugin installed as well, and that caused the errors?

Not sure, not a rust expert
Just that the errors (I should've recorded) appeared in VSCode rust-analyser language server output

Currently there's no output so I don't k ow if its working or not.

If one of the crates in your dependency graph builds a C/C++ library as part of it's build process that might be where the errors were coming from.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.