Skip to content

Commit

Permalink
.github: cross-compile riscv64 Linux asset (#798)
Browse files Browse the repository at this point in the history
Continue the recent `zig cc` work [1], such that the next configlet
release will have two new release assets:

    configlet_4.0.0-beta.14_linux_riscv64.tar.gz
    configlet_4.0.0-beta.14_linux_riscv64.tar.gz.minisig

where the archive contains the executable:

    $ file ./configlet
    ./configlet: ELF 64-bit LSB executable, UCB RISC-V, RVC, double-float ABI, version 1 (SYSV), statically linked, stripped

The riscv64-linux-musl target will have Tier 1 Zig support [2].

Refs: #24

[1] 0e8d665, ".github, config: use Zig to cross-compile arm64 Linux asset", 2023-08-13
[2] https://ziglang.org/download/0.11.0/release-notes.html#Support-Table
  • Loading branch information
ee7 authored Aug 17, 2023
1 parent f280445 commit a962b18
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
10 changes: 9 additions & 1 deletion .github/bin/cross-compile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,15 @@ zig_target="${ZIG_TARGET}"

cross_compile() {
local target="$1"
local arch='arm64'

local zig_arch
zig_arch="$(cut -d'-' -f1 <<< "${target}")"
local arch
case "${zig_arch}" in
aarch64) arch='arm64' ;;
*) arch="${zig_arch}" ;;
esac

local os
os="$(cut -d'-' -f2 <<< "${target}")"
local nim_os
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ jobs:
- runs-on: ubuntu-22.04
zig_target: aarch64-linux-musl

- runs-on: ubuntu-22.04
zig_target: riscv64-linux-musl

- runs-on: macos-12
zig_target: aarch64-macos-none

Expand Down

0 comments on commit a962b18

Please sign in to comment.