ENTRY

[ESC]
1h171 words

Rust needs better cross compilation

I've been trying to replace my tiny node.js API with a rust equivalent for far too long at this point. Finally got cross compilation working tonight after reinstalling cargo twice, failing to get WSL2 to behave and eventually giving up to use cross and docker.

Why in a sane world I need to create a docker image to cross compile code onto Arm64 is a mystery to me and its just embarrassing for Rust when C# can do it natively with no issues. To add insult to injury I had to strip out the sqlite3 crate and just interact with it via system commands instead as compiling that onto arm confused the poor thing just too badly.

At the very least, they should hide the in-built cargo target option until it actually works and doesn't just spit out obtuse cc compiler and linker errors that reveal nothing helpful.

Oh well, I can be happy that it finally works and I'm freeing up like 30-60MB of my overworked Pi Zeros 400MB memory.

0 replies

Join the conversation