cargo zigbuild

58 points Tyarel8 2 comments

Like a year ago, I made a simple program that reads a temperature from mqtt and sets a gpio pin in my raspberry pi to turn on the heating. Now, I had to change the mqtt topic that I hardcoded (rookie mistake), and I have spent a whole afternoon trying unsuccessfully to cross-compile it from my windows computer to work on the raspberry (it worked before), glibc version issues, etc.

Suffice to say, I found out about cargo zigbuild to use zig as a linker for cross-compilation and it worked first try no issues no configuration.

10/10

https://github.com/rust-cross/cargo-zigbuild