Update cross-compile documentation
Some checks failed
Basic Cargo Checks / docker-check (push) Successful in 1m19s
ci/woodpecker/push/woodpecker Pipeline failed
Basic Cargo Checks / docker-build (push) Successful in 5m28s

Also, add initial CI test
This commit is contained in:
Blizzard Finnegan 2023-06-22 07:38:58 -04:00
parent 7aa23f4015
commit 260c166ce9
Signed by: blizzardfinnegan
GPG key ID: 61C1E13067E0018E
4 changed files with 36 additions and 4 deletions

4
.gitignore vendored
View file

@ -1,3 +1,5 @@
/target
/logs
/output
/output
.cargo
.rustup

19
.woodpecker.yml Normal file
View file

@ -0,0 +1,19 @@
pipeline:
build:
image: rust:bookworm
commands:
- cargo check
- apt update && apt install -y lld
- cargo build --release --target aarch64-unknown-linux-musl
publish:
image: woodpeckerci/plugin-gitea-release
settings:
base_url: https://git.blizzard.systems
files:
- "target/aarch64-unknown-linux-musl/release/seymour_life"
api_key:
from_secret: API_KEY
target: devel
draft: true
prerelease: true
title:

View file

@ -47,7 +47,7 @@ You can also build without the `--release` flag, which wil take less time, but w
Cross compilation is possible with this project, if you do not have a Raspberry Pi available specifically for compilation. Compilation directly on the Pi is rather intensive, and takes significantly longer than cross-compiling.
If you are compiling on Linux, cross-compilation has a dependency of `lld`. This can be found in your distribution's package manager, or directly distributed by LLVM.
If you are compiling on Linux, cross-compilation has a dependency of `lld`. This can be found in your distribution's package manager, or directly distributed by LLVM. For Nix users, a predefined `shell.nix` file has been provided for your convenience.
If you are compiling on Windows, to safely cross-compile, you must modify the `.cargo/config.toml` file. Replace `lld` with `rust-lld`, then cross-compilation should work properly.

View file

@ -1,4 +1,15 @@
{pkgs ? import <nixpkgs> {} }:
pkgs.mkShell {
nativeBuildInputs = with pkgs; [ cargo rustc ];
pkgs.mkShell rec {
buildInputs = with pkgs; [ lld rustup ];
RUSTUP_HOME = toString ./.rustup;
CARGO_HOME = toString ./.cargo;
RUSTUP_TOOLCHAIN = "stable";
HOST_ARCH = "x86_64-unknown-linux-gnu";
CARGO_BUILD_TARGET = "aarch64-unknown-linux-musl";
shellHook = ''
export PATH=$PATH:${CARGO_HOME}/bin
export PATH=$PATH:${RUSTUP_HOME}/toolchains/${RUSTUP_TOOLCHAIN}-${HOST_ARCH}/bin/
rustup target add "${CARGO_BUILD_TARGET}"
'';
}