Skip to content

Commit d8f9dce

Browse files
committed
skip building aarch64-unknown-linux-musl target
I GIVE UP Has something to do with cross-compiling OpenSSL. I don't think all the cross-compiling env vars are propagated to the custom build script in `openssl-sys` crate.
1 parent caec23f commit d8f9dce

File tree

2 files changed

+43
-24
lines changed

2 files changed

+43
-24
lines changed

.github/workflows/binary-builds.yml

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,11 @@ jobs:
3434
include:
3535
- target: aarch64-unknown-linux-gnu
3636
os: ubuntu-latest
37-
- target: aarch64-unknown-linux-musl
38-
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
3942
- target: x86_64-unknown-linux-gnu
4043
os: ubuntu-latest
4144
- target: x86_64-unknown-linux-musl
@@ -66,12 +69,12 @@ jobs:
6669
- name: Install GCC for aarch64 (for cross-compiling openssl)
6770
if: runner.os == 'Linux' && startsWith(matrix.target, 'aarch64')
6871
run: |
72+
sudo apt-get update
73+
sudo apt-get install gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu
6974
if [[ "${{matrix.target}}" == *musl ]]; then
7075
sudo apt-get install musl-dev musl-tools
71-
else
72-
sudo apt-get install gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu
7376
fi
74-
- name: Install musl-gcc (fom compiling OpenSSL)
77+
- name: Install musl-gcc (for compiling OpenSSL)
7578
if: matrix.target == 'x86_64-unknown-linux-musl'
7679
run: sudo apt-get install musl-tools
7780

@@ -96,7 +99,18 @@ jobs:
9699
with:
97100
target: ${{ matrix.target }}
98101

102+
# problems with cross-compiling linux with musl
103+
- run: echo "RUSTFLAGS=-D warnings -C target-feature=+crt-static -C link-self-contained=yes" >> "${GITHUB_ENV}"
104+
if: contains(matrix.target, '-linux-musl')
105+
- run: |
106+
echo "CC=aarch64-linux-gnu-gcc" >> "$GITHUB_ENV"
107+
echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER=aarch64-linux-gnu-gcc" >> "$GITHUB_ENV"
108+
if: matrix.target == 'aarch64-unknown-linux-musl'
109+
99110
- name: Build
111+
env:
112+
# problems with cross-compiling aarch64 linux with gnu
113+
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: /usr/bin/aarch64-linux-gnu-gcc
100114
run: cargo build --manifest-path cpp-linter-cli/Cargo.toml --release --bin cpp-linter-cli --target ${{ matrix.target }} ${{ steps.is-openssl-vendored.outputs.enabled }}
101115

102116
- name: Prepare artifacts [Windows]
@@ -160,7 +174,8 @@ jobs:
160174
matrix:
161175
target:
162176
- aarch64-unknown-linux-gnu
163-
- aarch64-unknown-linux-musl
177+
# skip this target due to cross-compiling OpenSSL for musl C lib
178+
# - aarch64-unknown-linux-musl
164179
- x86_64-unknown-linux-gnu
165180
- x86_64-unknown-linux-musl
166181
- aarch64-apple-darwin

.github/workflows/run-dev-tests.yml

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ jobs:
4848
with:
4949
tool: cargo-nextest,cargo-llvm-cov,cargo-binstall
5050

51+
- name: Install llvm-cov-pretty (HTL report generator)
52+
run: cargo binstall -y llvm-cov-pretty
53+
5154
- uses: actions/setup-python@v5
5255
with:
5356
python-version: 3.x
@@ -83,36 +86,37 @@ jobs:
8386
python -m pip install clang-tools
8487
clang-tools --install ${{ matrix.version }}
8588
86-
- name: Collect Coverage (for codecov.io)
87-
if: matrix.version == '16' && runner.os == 'Linux'
89+
- name: Collect Coverage
8890
working-directory: cpp-linter-lib
8991
env:
9092
CLANG_VERSION: ${{ matrix.version }}
91-
run: cargo llvm-cov --hide-instantiations --lib --codecov --output-path .coverage.json nextest
92-
93-
- uses: codecov/codecov-action@v3
94-
if: matrix.version == '16' && runner.os == 'Linux'
95-
with:
96-
token: ${{secrets.CODECOV_TOKEN}}
97-
files: cpp-linter-lib/.coverage.json
98-
fail_ci_if_error: true # optional (default = false)
99-
100-
- name: Install llvm-cov-pretty (HTL report generator)
101-
if: matrix.version != '16' && runner.os != 'Linux'
102-
run: cargo binstall -y llvm-cov-pretty
93+
run: cargo llvm-cov --hide-instantiations --lib --no-report nextest
10394

104-
- name: Collect Coverage (for HTML report)
105-
if: matrix.version != '16' && runner.os != 'Linux'
95+
- name: Generate Coverage HTML report
10696
working-directory: cpp-linter-lib
10797
env:
10898
CLANG_VERSION: ${{ matrix.version }}
10999
run: |
110-
cargo llvm-cov --hide-instantiations --lib --json --output-path .coverage.json nextest
100+
cargo llvm-cov report --json --output-path .coverage.json
111101
llvm-cov-pretty .coverage.json
112102
113103
- name: Upload coverage data
114104
uses: actions/upload-artifact@v4
115-
if: matrix.version != '16' && runner.os != 'Linux'
116105
with:
117106
name: HTML_report-${{ runner.os }}-clang_v${{ matrix.version }}
118107
path: target/llvm-cov-pretty
108+
109+
- name: Generate Coverage lcov report
110+
if: matrix.version == '16' && runner.os == 'Linux'
111+
working-directory: cpp-linter-lib
112+
env:
113+
CLANG_VERSION: ${{ matrix.version }}
114+
run: |
115+
cargo llvm-cov report --lcov --output-path lcov.info
116+
117+
- uses: codecov/codecov-action@v3
118+
if: matrix.version == '16' && runner.os == 'Linux'
119+
with:
120+
token: ${{secrets.CODECOV_TOKEN}}
121+
files: cpp-linter-lib/lcov.info
122+
fail_ci_if_error: true # optional (default = false)

0 commit comments

Comments
 (0)