mirror of
https://github.com/imjasonh/krust
synced 2026-07-08 06:45:32 +00:00
Use cargo-zigbuild for cross-compilation, add build caching
- Integrate cargo-zigbuild as the default build backend, falling back to cargo build with best-effort linker detection if not installed - Auto-install rustup targets when missing (rustup target add) - Use persistent target/krust/ directory instead of temp dirs so incremental compilation works across runs - Remove .cargo/config.toml from repo (add to .gitignore) since zigbuild handles cross-linker configuration - Improve error messages: suggest cargo-zigbuild when linker not found - Simplify CI to use zigbuild instead of per-target system linkers - Simplify Makefile by removing setup-cross-compile/verify targets - Update README and CLAUDE.md to reflect new approach https://claude.ai/code/session_01EcsZDNeWn56wFqryb4Wq7r
This commit is contained in:
parent
68a9a86e1c
commit
bb76a120c3
8 changed files with 181 additions and 244 deletions
19
.github/workflows/ci.yml
vendored
19
.github/workflows/ci.yml
vendored
|
|
@ -25,10 +25,10 @@ jobs:
|
|||
toolchain: ${{ matrix.rust }}
|
||||
targets: x86_64-unknown-linux-musl,aarch64-unknown-linux-musl
|
||||
components: rustfmt,clippy
|
||||
- name: Install cross-compilation tools for both architectures
|
||||
- name: Install cargo-zigbuild and zig
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y musl-tools gcc-aarch64-linux-gnu gcc-x86-64-linux-gnu
|
||||
sudo snap install zig --classic --beta || sudo apt-get update && sudo apt-get install -y ziglang
|
||||
cargo install cargo-zigbuild
|
||||
- name: Cache cargo registry
|
||||
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v4
|
||||
with:
|
||||
|
|
@ -47,19 +47,6 @@ jobs:
|
|||
|
||||
- run: make check-fmt
|
||||
- run: make lint
|
||||
|
||||
- name: Setup cargo config for CI cross-compilation
|
||||
run: |
|
||||
mkdir -p .cargo
|
||||
cat > .cargo/config.toml << 'EOF'
|
||||
[target.x86_64-unknown-linux-musl]
|
||||
linker = "musl-gcc"
|
||||
|
||||
[target.aarch64-unknown-linux-musl]
|
||||
linker = "aarch64-linux-gnu-gcc"
|
||||
EOF
|
||||
|
||||
- run: make verify-cross-compile
|
||||
- run: make build
|
||||
- run: make test
|
||||
- run: make test-e2e
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue