use cargo cross

The problems I had using podman were resolved by realizing that ubuntu-latest
does not actually mean the latest version of Ubuntu (for now) so explicitly
stating the Ubuntu version, installing podman works fine and can build binaries
for Raspberry Pi properly.
This commit is contained in:
Johann150 2021-02-06 17:06:46 +01:00
parent cd821a32c1
commit 3089a4034a
No known key found for this signature in database
GPG key ID: 9EE6577A2A06F8F1
4 changed files with 14 additions and 18 deletions

View file

@ -5,13 +5,13 @@ set -e
# Cross-compiling needs a linker for the respective platforms. If you are on a Debian-based x86_64 Linux,
# you can install them with:
sudo apt -y install gcc-arm-linux-gnueabihf gcc-aarch64-linux-gnu
sudo apt -y install podman gcc-arm-linux-gnueabihf gcc-aarch64-linux-gnu
# Also install cross compilation tool for cargo
cargo install cross
for i in x86_64-unknown-linux-gnu aarch64-unknown-linux-gnu arm-unknown-linux-gnueabihf armv7-unknown-linux-gnueabihf
do
# Make sure the cross-compiled std crate is available.
rustup target add $i
cargo build --verbose --release --target $i
cross build --verbose --release --target $i
cp target/$i/release/agate agate.$i
done