Very unusual issue I am facing with raspberry pi

Hi

I am facing very unusual issue with raspberry pi.
Everything was working fine but until last 3 days code is not compiling in raspberry pi.
I format & fresh install raspbian os with rust(1.79) using rustup from shell.

The issue is when I run cargo build --release after all of the dependencies build when it comes to application build its consuming all the CPU & RAM & Swap & making the RPI hang but RPI not crashing nor the build giving any error but its stuck there for hours.

If you have any idea please let me know.
Thanks

Were you using an earlier version of Rust?

In case the issue is memory pressure, you can try running cargo build --release -j1 to reduce the number of jobs that Cargo will run at the same time.

You could also consider cross-compiling on a faster computer and then transferring the compiled program to the Raspberry Pi.

2 Likes

Yes 1.78

I tried with j1 to up to j4 but luck.
Results are all same.

Regarding the cross compile I am facing issue with openssl & other dependencies so dropped that idea.

Does a debug build work?

Yes
Debug build is working as expected

Do you have a way to enlist others to try to reproduce the problem? Is the project open source? Do you have an MRE?

Which Pi? (model / memory)

I'm willing to try to reproduce what you're seeing but I probably won't be able to until this weekend.

I am using RPi 4 with 2GB RAM 4 Core CPU.

Yes I can understand, its not anyway easy to say whats wrong without reproduce.
Let me try to reproduce because the project is huge.

Thanks

1 Like

Make sure you don't have LTO enabled. Maybe even explicitly disable the thinlto that is used by default.

2GB RAM for a "huge project" is very tight, so it's possible that the new compiler or LLVM version started using more RAM, and the Pi is dying a swap death.

Setting up cross-compilation is a hassle, but with a machine that slow, you'll most likely still save time by switching to cross-compilation. Debian x86 to Debian arm is not too hard.

3 Likes

Even less hassle... Raspberry Pi 4 Model B - 8 GB RAM : ID 4564 : Adafruit Industries, Unique & fun DIY electronics and kits

:grinning:

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.