Skip to content

Commit fd17d8d

Browse files
committed
fix(ci): set CC for musl target so cc-rs finds the C compiler
cc-rs probes for aarch64-linux-musl-gcc by default, which does not exist on the Ubuntu CI host. Set CC_<target> explicitly to a wrapper that also disables _FORTIFY_SOURCE for consistency with the CXX wrapper.
1 parent f6c136b commit fd17d8d

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

.github/workflows/release-dev.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,15 @@ jobs:
213213
> /usr/local/bin/musl-g++
214214
chmod +x /usr/local/bin/musl-g++
215215
216+
# Point both CC and CXX at wrappers that disable _FORTIFY_SOURCE.
217+
# CC must be set explicitly or cc-rs probes for aarch64-linux-musl-gcc
218+
# which does not exist on the Ubuntu CI host.
219+
printf '#!/bin/sh\nexec cc -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0 "$@"\n' \
220+
> /usr/local/bin/musl-cc
221+
chmod +x /usr/local/bin/musl-cc
222+
216223
TARGET_ENV=$(echo "${{ matrix.target }}" | tr '-' '_')
224+
echo "CC_${TARGET_ENV}=/usr/local/bin/musl-cc" >> "$GITHUB_ENV"
217225
echo "CXX_${TARGET_ENV}=/usr/local/bin/musl-g++" >> "$GITHUB_ENV"
218226
219227
- name: Scope workspace to CLI crates

.github/workflows/release-tag.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,15 @@ jobs:
235235
> /usr/local/bin/musl-g++
236236
chmod +x /usr/local/bin/musl-g++
237237
238+
# Point both CC and CXX at wrappers that disable _FORTIFY_SOURCE.
239+
# CC must be set explicitly or cc-rs probes for aarch64-linux-musl-gcc
240+
# which does not exist on the Ubuntu CI host.
241+
printf '#!/bin/sh\nexec cc -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0 "$@"\n' \
242+
> /usr/local/bin/musl-cc
243+
chmod +x /usr/local/bin/musl-cc
244+
238245
TARGET_ENV=$(echo "${{ matrix.target }}" | tr '-' '_')
246+
echo "CC_${TARGET_ENV}=/usr/local/bin/musl-cc" >> "$GITHUB_ENV"
239247
echo "CXX_${TARGET_ENV}=/usr/local/bin/musl-g++" >> "$GITHUB_ENV"
240248
241249
- name: Scope workspace to CLI crates

0 commit comments

Comments
 (0)