Skip to content

Commit f0ec4df

Browse files
Update rust.yml
1 parent 394aa40 commit f0ec4df

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

.github/workflows/rust.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,31 +126,38 @@ jobs:
126126
run: |
127127
cat <<EOF > Cross.toml
128128
[target.x86_64-unknown-linux-musl]
129-
image = "ghcr.io/cross-rs/x86_64-unknown-linux-musl:main"
129+
image = "ghcr.io/cross-rs/x86_64-unknown-linux-musl:0.2.5"
130130
pre-build = ["apk add --no-cache alsa-lib-dev"]
131131
132132
[target.aarch64-unknown-linux-musl]
133-
image = "ghcr.io/cross-rs/aarch64-unknown-linux-musl:main"
133+
image = "ghcr.io/cross-rs/aarch64-unknown-linux-musl:0.2.5"
134134
pre-build = ["apk add --no-cache alsa-lib-dev"]
135135
136136
[target.armv7-unknown-linux-musleabihf]
137-
image = "ghcr.io/cross-rs/armv7-unknown-linux-musleabihf:main"
137+
image = "ghcr.io/cross-rs/armv7-unknown-linux-musleabihf:0.2.5"
138138
pre-build = ["apk add --no-cache alsa-lib-dev"]
139139
140140
[target.arm-unknown-linux-musleabihf]
141-
image = "ghcr.io/cross-rs/arm-unknown-linux-musleabihf:main"
141+
image = "ghcr.io/cross-rs/arm-unknown-linux-musleabihf:0.2.5"
142142
pre-build = ["apk add --no-cache alsa-lib-dev"]
143143
EOF
144144
145145
- name: Install rust target
146146
run: rustup target add $TARGET
147147

148-
# Use 'cross' for MUSL and 'cargo' for everything else
149148
- name: Run build
150149
run: |
151150
if [[ $TARGET == *musl* ]]; then
152151
cross build --release --verbose --target $TARGET
153152
else
153+
# [FIX] Set the pkg-config path for GNU cross-compilation
154+
if [[ $TARGET == 'aarch64-unknown-linux-gnu' ]]; then
155+
export PKG_CONFIG_PATH="/usr/lib/aarch64-linux-gnu/pkgconfig"
156+
elif [[ $TARGET == *arm*-linux-gnueabihf' ]]; then
157+
# This covers both 'armv7' and 'arm' targets
158+
export PKG_CONFIG_PATH="/usr/lib/arm-linux-gnueabihf/pkgconfig"
159+
fi
160+
154161
cargo build --release --verbose --target $TARGET
155162
fi
156163

0 commit comments

Comments
 (0)