@@ -34,11 +34,11 @@ jobs:
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
+ # 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
42
42
- target : x86_64-unknown-linux-gnu
43
43
os : ubuntu-latest
44
44
- target : x86_64-unknown-linux-musl
@@ -99,19 +99,33 @@ jobs:
99
99
target : ${{ matrix.target }}
100
100
101
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'
108
-
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
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'
108
+
109
+ - name : Install cross (cargo cross compiler)
110
+ if : matrix.os == 'ubuntu-latest' && (endsWith(matrix.target, 'musl') || startsWith(matrix.target, 'aarch64'))
111
+ uses : taiki-e/install-action@v2
112
+ with :
113
+ tool : cross
114
+
115
+ - name : Build (native)
116
+ # env:
117
+ # # problems with cross-compiling aarch64 linux with gnu
118
+ # CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: /usr/bin/aarch64-linux-gnu-gcc
119
+ if : ${{!(matrix.os == 'ubuntu-latest' && (endsWith(matrix.target, 'musl') || startsWith(matrix.target, 'aarch64')))}}
113
120
run : cargo build --manifest-path cpp-linter-lib/Cargo.toml --release --bin cpp-linter --target ${{ matrix.target }} ${{ steps.is-openssl-vendored.outputs.enabled }}
114
121
122
+ - name : Build (cross)
123
+ # env:
124
+ # # problems with cross-compiling aarch64 linux with gnu
125
+ # CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: /usr/bin/aarch64-linux-gnu-gcc
126
+ if : matrix.os == 'ubuntu-latest' && (endsWith(matrix.target, 'musl') || startsWith(matrix.target, 'aarch64'))
127
+ run : cross build --manifest-path cpp-linter-lib/Cargo.toml --release --bin cpp-linter --target ${{ matrix.target }} ${{ steps.is-openssl-vendored.outputs.enabled }}
128
+
115
129
- name : Prepare artifacts
116
130
run : mv target/${{ matrix.target }}/release/cpp-linter${{ runner.os == 'Windows' && '.exe' || '' }} ./cpp-linter-${{ matrix.target }}${{ runner.os == 'Windows' && '.exe' || '' }}
117
131
- name : Upload artifacts
0 commit comments