Update cross-compile documentation
Also, add initial CI test
This commit is contained in:
parent
7aa23f4015
commit
260c166ce9
4 changed files with 36 additions and 4 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -1,3 +1,5 @@
|
|||
/target
|
||||
/logs
|
||||
/output
|
||||
/output
|
||||
.cargo
|
||||
.rustup
|
||||
|
|
19
.woodpecker.yml
Normal file
19
.woodpecker.yml
Normal 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:
|
|
@ -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.
|
||||
|
||||
|
|
15
shell.nix
15
shell.nix
|
@ -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}"
|
||||
'';
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue