Skip to content

Commit

Permalink
chore: add support for i686 and armv7 targets in CI workflows and con…
Browse files Browse the repository at this point in the history
…figuration (#69)

Signed-off-by: simonsan <[email protected]>
  • Loading branch information
simonsan authored Nov 30, 2024
1 parent 40469b3 commit 4a1fed5
Show file tree
Hide file tree
Showing 8 changed files with 74 additions and 52 deletions.
6 changes: 6 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,9 @@ linker = "aarch64-linux-gnu-gcc"

[target.i686-unknown-linux-gnu]
linker = "i686-linux-gnu-gcc"

[env]
CC_i686-unknown-linux-gnu = "i686-linux-gnu-gcc"
CC_aarch64_unknown_linux_musl = "aarch64-linux-gnu-gcc"
CC_armv7_unknown_linux_gnueabihf = "arm-linux-gnueabihf-gcc"
CC_armv7_unknown_linux_musleabihf = "arm-linux-gnueabihf-gcc"
5 changes: 5 additions & 0 deletions .github/install-arm-linkers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- name: Install armv7 and aarch64 Linkers
if: runner.os == 'Linux'
run: |
sudo apt install gcc-aarch64-linux-gnu
sudo apt install gcc-arm-none-eabi
20 changes: 10 additions & 10 deletions .github/workflows/cross-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,16 @@ jobs:
target: aarch64-unknown-linux-musl
architecture: arm64
use-cross: true
# - os: ubuntu-latest
# os-name: linux
# target: i686-unknown-linux-gnu
# architecture: i686
# use-cross: true
# - os: ubuntu-latest
# os-name: linux
# target: armv7-unknown-linux-gnueabihf
# architecture: armv7
# use-cross: true
- os: ubuntu-latest
os-name: linux
target: i686-unknown-linux-gnu
architecture: i386
use-cross: true
- os: ubuntu-latest
os-name: linux
target: armv7-unknown-linux-gnueabihf
architecture: armv7
use-cross: true

steps:
- name: Checkout repository
Expand Down
37 changes: 18 additions & 19 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,12 @@ jobs:
architecture: x86_64
binary-postfix: ".exe"
use-cross: false
# FIXME: cross-compilation is not working on windows, due to `sha2` and `aws-ls-sys` dependency
# - os: windows-latest
# os-name: windows
# target: x86_64-pc-windows-gnu
# architecture: x86_64
# binary-postfix: ".exe"
# use-cross: true
- os: windows-latest
os-name: windows
target: x86_64-pc-windows-gnu
architecture: x86_64
binary-postfix: ".exe"
use-cross: true
- os: macos-13
os-name: macos
target: x86_64-apple-darwin
Expand Down Expand Up @@ -68,18 +67,18 @@ jobs:
architecture: arm64
binary-postfix: ""
use-cross: true
# - os: ubuntu-latest
# os-name: linux
# target: i686-unknown-linux-gnu
# architecture: i686
# binary-postfix: ""
# use-cross: true
# - os: ubuntu-latest
# os-name: linux
# target: armv7-unknown-linux-gnueabihf
# architecture: armv7
# binary-postfix: ""
# use-cross: true
- os: ubuntu-latest
os-name: linux
target: i686-unknown-linux-gnu
architecture: i386
binary-postfix: ""
use-cross: true
- os: ubuntu-latest
os-name: linux
target: armv7-unknown-linux-gnueabihf
architecture: armv7
binary-postfix: ""
use-cross: true

steps:
- name: Checkout repository
Expand Down
37 changes: 18 additions & 19 deletions .github/workflows/prebuilt-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,12 @@ jobs:
architecture: x86_64
binary-postfix: ".exe"
use-cross: false
# FIXME: cross-compilation is not working on windows, due to `sha2` and `aws-ls-sys` dependency
# - os: windows-latest
# os-name: windows
# target: x86_64-pc-windows-gnu
# architecture: x86_64
# binary-postfix: ".exe"
# use-cross: true
- os: windows-latest
os-name: windows
target: x86_64-pc-windows-gnu
architecture: x86_64
binary-postfix: ".exe"
use-cross: true
- os: macos-13
os-name: macos
target: x86_64-apple-darwin
Expand Down Expand Up @@ -69,18 +68,18 @@ jobs:
architecture: arm64
binary-postfix: ""
use-cross: true
# - os: ubuntu-latest
# os-name: linux
# target: i686-unknown-linux-gnu
# architecture: i686
# binary-postfix: ""
# use-cross: true
# - os: ubuntu-latest
# os-name: linux
# target: armv7-unknown-linux-gnueabihf
# architecture: armv7
# binary-postfix: ""
# use-cross: true
- os: ubuntu-latest
os-name: linux
target: i686-unknown-linux-gnu
architecture: i386
binary-postfix: ""
use-cross: true
- os: ubuntu-latest
os-name: linux
target: armv7-unknown-linux-gnueabihf
architecture: armv7
binary-postfix: ""
use-cross: true

steps:
- name: Checkout repository
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,11 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: "Install armv7 and aarch64 Linkers"
if: "runner.os == 'Linux'"
run: |
sudo apt install gcc-aarch64-linux-gnu
sudo apt install gcc-arm-none-eabi
- uses: swatinem/rust-cache@v2
with:
key: ${{ join(matrix.targets, '-') }}
Expand Down
6 changes: 6 additions & 0 deletions Cross.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[target.i686-unknown-linux-gnu]
image = "ghcr.io/cross-rs/i686-unknown-linux-gnu:edge"
pre-build = [
"dpkg --add-architecture $CROSS_DEB_ARCH",
"apt-get update && apt-get --assume-yes install gcc-multilib-i686-linux-gnu gcc-i686-linux-gnu",
]
10 changes: 6 additions & 4 deletions dist-workspace.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ ci = "github"
# The installers to generate for each app
installers = ["shell", "powershell", "homebrew", "msi"]
# Target platforms to build apps for (Rust target-triple syntax)
targets = ["aarch64-apple-darwin", "aarch64-unknown-linux-gnu", "x86_64-apple-darwin", "x86_64-unknown-linux-gnu", "x86_64-pc-windows-gnu", "x86_64-unknown-linux-musl", "x86_64-pc-windows-msvc"]
targets = ["aarch64-apple-darwin", "aarch64-unknown-linux-gnu", "x86_64-apple-darwin", "x86_64-unknown-linux-gnu", "x86_64-pc-windows-gnu", "x86_64-unknown-linux-musl", "x86_64-pc-windows-msvc", "i686-unknown-linux-gnu"]
# Path that installers should place binaries in
install-path = "CARGO_HOME"
# Whether to install an updater program
Expand All @@ -25,12 +25,14 @@ pr-run-mode = "upload"
tap = "rustic-rs/homebrew-tap"
# Publish jobs to run in CI
publish-jobs = ["homebrew"]
github-build-setup = "../install-arm-linkers.yml"

[dist.github-custom-runners]
aarch64-apple-darwin = "macos-latest"
aarch64-unknown-linux-gnu = "ubuntu-latest"
aarch64-unknown-linux-musl = "ubuntu-latest"
armv7-unknown-linux-gnueabihf = "ubuntu-latest"
armv7-unknown-linux-musleabihf = "ubuntu-latest"
i686-unknown-linux-gnu = "ubuntu-latest"
x86_64-apple-darwin = "macos-13"
x86_64-pc-windows-gnu = "windows-latest"
Expand All @@ -43,8 +45,8 @@ nasm = '*' # Required for building `aws-lc-sys` on Windows

[dist.dependencies.apt]
gcc-aarch64-linux-gnu = { version = '*', targets = ["aarch64-unknown-linux-gnu", "aarch64-unknown-linux-musl"] }
gcc-arm-linux-gnueabihf = { version = '*', targets = ["armv7-unknown-linux-gnueabihf"] }
gcc-arm-linux-gnueabihf = { version = '*', targets = ["armv7-unknown-linux-gnueabihf", "armv7-unknown-linux-musleabihf"] }
gcc-i686-linux-gnu = { version = '*', targets = ["i686-unknown-linux-gnu"] }
gcc-multilib-i686-linux-gnu = { version = '*', targets = ["i686-unknown-linux-gnu"] }
musl-tools = { version = '*', targets = ["aarch64-unknown-linux-musl", "x86_64-unknown-linux-musl"] }
musl-dev = { version = '*', targets = ["aarch64-unknown-linux-musl", "x86_64-unknown-linux-musl"] }
musl-tools = { version = '*', targets = ["aarch64-unknown-linux-musl", "x86_64-unknown-linux-musl", "armv7-unknown-linux-musleabihf"] }
musl-dev = { version = '*', targets = ["aarch64-unknown-linux-musl", "x86_64-unknown-linux-musl", "armv7-unknown-linux-musleabihf"] }

0 comments on commit 4a1fed5

Please sign in to comment.