Skip to content

Commit 61290c1

Browse files
committed
ci: add support for more arches when pulling cargo-c binary pkgs
Can't use the powerpc64le binary yet because it requires glibc-2.29 and we're on glibc-2.28 due to manylinux_2_28.
1 parent bec84aa commit 61290c1

1 file changed

Lines changed: 17 additions & 8 deletions

File tree

.github/buildlib

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ doecho() {
99
"$@"
1010
}
1111

12+
echo Building pkgcraft-c on ${OSTYPE} for ${HOSTTYPE}
13+
1214
# install rust
1315
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
1416
doecho source "${HOME}"/.cargo/env
@@ -32,19 +34,26 @@ install_pkgs() {
3234

3335
[[ ${OSTYPE} == "linux-"* ]] && install_pkgs
3436

35-
if [[ ${HOSTTYPE} == "x86_64" ]]; then
36-
# install cargo-c via binary package
37-
if [[ ${OSTYPE} == "linux-"* ]]; then
38-
curl -L https://github.com/lu-zero/cargo-c/releases/latest/download/cargo-c-linux.tar.gz | tar xvzf - -C "${HOME}"/.cargo/bin
39-
elif [[ ${OSTYPE} == "darwin"* ]]; then
37+
# install binary cargo-c package if available
38+
if [[ ${OSTYPE} == "linux-"* ]]; then
39+
if [[ ${HOSTTYPE} == "aarch64" ]]; then
40+
curl -L https://github.com/lu-zero/cargo-c/releases/latest/download/cargo-c-aarch64-unknown-linux-musl.tar.gz | tar xvzf - -C "${HOME}"/.cargo/bin
41+
elif [[ ${HOSTTYPE} == "x86_64" ]]; then
42+
curl -L https://github.com/lu-zero/cargo-c/releases/latest/download/cargo-c-x86_64-unknown-linux-musl.tar.gz | tar xvzf - -C "${HOME}"/.cargo/bin
43+
else
44+
SOURCE_CARGO_C=true
45+
fi
46+
elif [[ ${OSTYPE} == "darwin"* ]]; then
47+
if [[ ${HOSTTYPE} == "x86_64" ]]; then
4048
curl -L https://github.com/lu-zero/cargo-c/releases/latest/download/cargo-c-macos.zip > cargo-c.zip
4149
unzip -o cargo-c.zip -d "${HOME}"/.cargo/bin
4250
rm cargo-c.zip
4351
else
44-
echo "unknown OS: ${OSTYPE}"
45-
exit 1
52+
SOURCE_CARGO_C=true
4653
fi
47-
else
54+
fi
55+
56+
if [[ -n ${SOURCE_CARGO_C} ]]; then
4857
# avoid libgit2 usage due to memory problems when emulated under qemu
4958
# https://users.rust-lang.org/t/cargo-uses-too-much-memory-being-run-in-qemu/76531
5059
cargo --config net.git-fetch-with-cli=true update

0 commit comments

Comments
 (0)