Deno script to set up a rust project for cross compilation for RPi if required, build, and rsync it up to the pi.
- Check if we are in a cargo project.
- Check if lld linker is installed.
- Check if we have the correct rust toolchain installed and install if not.
- Check if we have the correct
.cargo/config.toml
setup for lld, and if not set it up. - Build the project.
- Rsync the project onto the raspberry pi.
I suspect this will only work if you use pure rust code, so out of luck if you use C bindings etc. unless it supports cross compilation.
- Deno runtime. You can get this from deno.land
deno run --allow-run --allow-read --allow-write path/to/main.ts -- [email protected]
Best to create a script for this with an absolute path to main.ts
.