cross build, will the result work on my machine
This commit is contained in:
@@ -7,10 +7,6 @@ on:
|
|||||||
- "v*"
|
- "v*"
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
env:
|
|
||||||
# When using cargo-zigbuild for *-gnu targets, link against this glibc baseline (wider VPS compatibility).
|
|
||||||
WAKEY_CC_GLIBC_VERSION: "2.28"
|
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
|
|
||||||
@@ -59,29 +55,17 @@ jobs:
|
|||||||
pnpm install --frozen-lockfile
|
pnpm install --frozen-lockfile
|
||||||
pnpm build
|
pnpm build
|
||||||
|
|
||||||
- name: Build control-plane (linux-gnu; zig + older glibc when available)
|
- name: Build control-plane (linux-gnu)
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
GLIBC_VER="${WAKEY_CC_GLIBC_VERSION:-2.28}"
|
|
||||||
GNU_TARGETS=(x86_64-unknown-linux-gnu aarch64-unknown-linux-gnu)
|
|
||||||
|
|
||||||
use_zig=false
|
# x86_64 builds natively; aarch64 needs cross
|
||||||
if command -v zig >/dev/null 2>&1 && cargo zigbuild -h >/dev/null 2>&1; then
|
echo "Building control-plane x86_64-unknown-linux-gnu (native)"
|
||||||
use_zig=true
|
cargo build --release --target x86_64-unknown-linux-gnu -p wakey-control-plane
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$use_zig" = true ]; then
|
echo "Building control-plane aarch64-unknown-linux-gnu (cross)"
|
||||||
echo "cargo-zigbuild + zig found: building control-plane with glibc ${GLIBC_VER}"
|
cross build --release --target aarch64-unknown-linux-gnu -p wakey-control-plane
|
||||||
for base in "${GNU_TARGETS[@]}"; do
|
|
||||||
cargo zigbuild --release --target "${base}.${GLIBC_VER}" -p wakey-control-plane
|
|
||||||
done
|
|
||||||
else
|
|
||||||
echo "zig or cargo zigbuild not available: using plain cargo build (binary needs glibc >= host)"
|
|
||||||
for base in "${GNU_TARGETS[@]}"; do
|
|
||||||
cargo build --release --target "$base" -p wakey-control-plane
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Package rootfs tarball
|
- name: Package rootfs tarball
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
|
|||||||
Reference in New Issue
Block a user