ci: change gnu libraries to musl

This commit is contained in:
iff 2025-02-12 17:00:03 +01:00
parent 28a59f8fda
commit 4a1ec3276d
2 changed files with 20 additions and 7 deletions

View file

@ -23,24 +23,28 @@ jobs:
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
target: x86_64-unknown-linux-musl
deb: true
rpm: true
musl: true
- os: ubuntu-latest
target: i686-unknown-linux-gnu
target: i686-unknown-linux-musl
deb: true
rpm: true
cross: true
musl: true
- os: ubuntu-latest
target: aarch64-unknown-linux-gnu
target: aarch64-unknown-linux-musl
deb: true
rpm: true
cross: true
musl: true
- os: ubuntu-latest
target: armv7-unknown-linux-gnueabihf
target: armv7-unknown-linux-musleabihf
deb: true
rpm: true
cross: true
musl: true
- os: ubuntu-latest
target: aarch64-linux-android
cross: true
@ -67,16 +71,25 @@ jobs:
target: ${{ matrix.target }}
profile: minimal
- name: Install musl
if: matrix.musl == true
run: sudo apt-get install -y musl-tools
- name: Caching
uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.target }}
- name: Build
if: ${{ matrix.cross == false}}
if: ${{ matrix.cross == false && matrix.musl == false }}
run:
cargo build --release --workspace --locked --target ${{ matrix.target }}
- name: Build (musl)
if: ${{ matrix.cross == false && matrix.musl == true }}
run:
cargo build --release --workspace --no-default-features --locked --target ${{ matrix.target }}
- name: Build (cross)
if: ${{ matrix.cross == true}}
# cross 0.2.5 broken for android

View file

@ -201,7 +201,7 @@ get_architecture() {
local _ostype _cputype _bitness _arch _clibtype
_ostype="$(uname -s)"
_cputype="$(uname -m)"
_clibtype="gnu"
_clibtype="musl"
if [ "${_ostype}" = Linux ]; then
if [ "$(uname -o || true)" = Android ]; then
@ -329,7 +329,7 @@ get_architecture() {
esac
# Detect 64-bit linux with 32-bit userland
if [ "${_ostype}" = unknown-linux-gnu ] && [ "${_bitness}" -eq 32 ]; then
if [ "${_ostype}" = unknown-linux-musl ] && [ "${_bitness}" -eq 32 ]; then
case ${_cputype} in
x86_64)
# 32-bit executable for amd64 = x32