34
34
include :
35
35
- target : aarch64-unknown-linux-gnu
36
36
os : ubuntu-latest
37
- # # I GIVE UP! For this target, OpenSSL needs to be cross compiled
38
- # # which is driven by openssl-sys crate's custom build script...
39
- # # Linux users with aarch64 (aka ARM64) using musl C lib can go fish (or build from source).
40
- # - target: aarch64-unknown-linux-musl
41
- # os: ubuntu-latest
37
+ - target : aarch64-unknown-linux-musl
38
+ os : ubuntu-latest
42
39
- target : x86_64-unknown-linux-gnu
43
40
os : ubuntu-latest
44
41
- target : x86_64-unknown-linux-musl
73
70
id : is-openssl-vendored
74
71
run : |
75
72
case "${{ matrix.target }}" in
76
- "aarch64-apple-darwin" | "x86_64-apple-darwin" | "aarch64-unknown-linux-gnu" | "aarch64-unknown-linux-musl" | "x86_64-unknown-linux-musl")
73
+ "aarch64-apple-darwin" | "x86_64-apple-darwin") # | "aarch64-unknown-linux-gnu" | "aarch64-unknown-linux-musl" | "x86_64-unknown-linux-musl"
77
74
echo "enabled=--features openssl-vendored" >> $GITHUB_OUTPUT
78
75
;;
79
76
*)
@@ -98,20 +95,20 @@ jobs:
98
95
with :
99
96
target : ${{ matrix.target }}
100
97
101
- # problems with cross-compiling linux with musl
102
- - run : echo "RUSTFLAGS=-D warnings -C target-feature=+crt-static -C link-self-contained=yes" >> "${GITHUB_ENV}"
103
- if : contains(matrix.target, '-linux-musl')
104
- - run : |
105
- echo "CC=aarch64-linux-gnu-gcc" >> "$GITHUB_ENV"
106
- echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER=aarch64-linux-gnu-gcc" >> "$GITHUB_ENV"
107
- if: matrix.target == 'aarch64-unknown-linux-musl'
98
+ - name : Install cross (cargo cross compiler)
99
+ if : matrix.os == 'ubuntu-latest' && (endsWith(matrix.target, 'musl') || startsWith(matrix.target, 'aarch64'))
100
+ uses : taiki-e/install-action@v2
101
+ with :
102
+ tool : cross
108
103
109
- - name : Build
110
- env :
111
- # problems with cross-compiling aarch64 linux with gnu
112
- CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER : /usr/bin/aarch64-linux-gnu-gcc
104
+ - name : Build (native)
105
+ if : ${{!(matrix.os == 'ubuntu-latest' && (endsWith(matrix.target, 'musl') || startsWith(matrix.target, 'aarch64')))}}
113
106
run : cargo build --manifest-path cpp-linter-lib/Cargo.toml --release --bin cpp-linter --target ${{ matrix.target }} ${{ steps.is-openssl-vendored.outputs.enabled }}
114
107
108
+ - name : Build (cross)
109
+ if : matrix.os == 'ubuntu-latest' && (endsWith(matrix.target, 'musl') || startsWith(matrix.target, 'aarch64'))
110
+ run : cross build --manifest-path cpp-linter-lib/Cargo.toml --release --bin cpp-linter --target ${{ matrix.target }} ${{ steps.is-openssl-vendored.outputs.enabled }}
111
+
115
112
- name : Prepare artifacts
116
113
run : mv target/${{ matrix.target }}/release/cpp-linter${{ runner.os == 'Windows' && '.exe' || '' }} ./cpp-linter-${{ matrix.target }}${{ runner.os == 'Windows' && '.exe' || '' }}
117
114
- name : Upload artifacts
0 commit comments