Skip to content

Commit f0e2e48

Browse files
committed
explicit linker setting
trying to fix aarch64-musl build
1 parent 19a72db commit f0e2e48

File tree

2 files changed

+35
-21
lines changed

2 files changed

+35
-21
lines changed

.github/workflows/binary-builds.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,12 @@ jobs:
6666
- name: Install GCC for aarch64 (for cross-compiling openssl)
6767
if: runner.os == 'Linux' && startsWith(matrix.target, 'aarch64')
6868
run: |
69+
sudo apt-get update
70+
sudo apt-get install gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu
6971
if [[ "${{matrix.target}}" == *musl ]]; then
7072
sudo apt-get install musl-dev musl-tools
71-
else
72-
sudo apt-get install gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu
7373
fi
74-
- name: Install musl-gcc (fom compiling OpenSSL)
74+
- name: Install musl-gcc (for compiling OpenSSL)
7575
if: matrix.target == 'x86_64-unknown-linux-musl'
7676
run: sudo apt-get install musl-tools
7777

@@ -96,7 +96,17 @@ jobs:
9696
with:
9797
target: ${{ matrix.target }}
9898

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

102112
- name: Prepare artifacts [Windows]

.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)