File tree Expand file tree Collapse file tree 10 files changed +45
-15
lines changed
aarch64-unknown-linux-musl
arm-unknown-linux-musleabihf
loongarch64-unknown-linux-musl
powerpc64le-unknown-linux-musl
x86_64-unknown-linux-musl Expand file tree Collapse file tree 10 files changed +45
-15
lines changed Original file line number Diff line number Diff line change @@ -13,8 +13,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
1313 rsync \
1414 xz-utils
1515
16+ ARG MUSL_VERSION
1617COPY install-musl.sh /
17- RUN /install-musl.sh aarch64
18+ RUN /install-musl.sh aarch64 "$MUSL_VERSION"
1819
1920# FIXME: shouldn't need the `-lgcc` here, shouldn't that be in std?
2021ENV PATH=$PATH:/musl-aarch64/bin:/rust/bin \
Original file line number Diff line number Diff line change @@ -16,8 +16,9 @@ RUN sed -i -E 's/(archive|security)\.ubuntu\.com/old-releases.ubuntu.com/g' \
1616 rsync \
1717 xz-utils
1818
19+ ARG MUSL_VERSION
1920COPY install-musl.sh /
20- RUN /install-musl.sh arm
21+ RUN /install-musl.sh arm "$MUSL_VERSION"
2122
2223ENV PATH=$PATH:/musl-arm/bin:/rust/bin \
2324 CC_arm_unknown_linux_musleabihf=musl-gcc \
Original file line number Diff line number Diff line change @@ -16,8 +16,9 @@ RUN sed -i -E 's/(archive|security)\.ubuntu\.com/old-releases.ubuntu.com/g' \
1616 rsync \
1717 xz-utils
1818
19+ ARG MUSL_VERSION
1920COPY install-musl.sh /
20- RUN /install-musl.sh i686
21+ RUN /install-musl.sh i686 "$MUSL_VERSION"
2122
2223ENV PATH=$PATH:/musl-i686/bin:/rust/bin \
2324 CC_i686_unknown_linux_musl=musl-gcc \
Original file line number Diff line number Diff line change @@ -13,8 +13,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
1313 rsync \
1414 xz-utils
1515
16+ ARG MUSL_VERSION
1617COPY install-musl.sh /
17- RUN /install-musl.sh loongarch64
18+ RUN /install-musl.sh loongarch64 "$MUSL_VERSION"
1819
1920ENV CARGO_TARGET_LOONGARCH64_UNKNOWN_LINUX_MUSL_LINKER=musl-gcc \
2021 CARGO_TARGET_LOONGARCH64_UNKNOWN_LINUX_MUSL_RUNNER="qemu-loongarch64" \
Original file line number Diff line number Diff line change @@ -13,8 +13,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
1313 rsync \
1414 xz-utils
1515
16+ ARG MUSL_VERSION
1617COPY install-musl.sh /
17- RUN /install-musl.sh powerpc64le
18+ RUN /install-musl.sh powerpc64le "$MUSL_VERSION"
1819
1920# FIXME: shouldn't need the `-lgcc` here, shouldn't that be in std?
2021ENV PATH=$PATH:/musl-powerpc64/bin:/rust/bin \
Original file line number Diff line number Diff line change @@ -10,8 +10,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
1010 patch \
1111 rsync
1212
13+ ARG MUSL_VERSION
1314COPY install-musl.sh /
14- RUN /install-musl.sh s390x
15+ RUN /install-musl.sh s390x "$MUSL_VERSION"
1516
1617# FIXME: shouldn't need the `-lgcc` here, shouldn't that be in std?
1718ENV CARGO_TARGET_S390X_UNKNOWN_LINUX_GNU_LINKER=s390x-linux-gnu-gcc \
Original file line number Diff line number Diff line change @@ -11,8 +11,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
1111 rsync \
1212 xz-utils
1313
14+ ARG MUSL_VERSION
1415COPY install-musl.sh /
15- RUN /install-musl.sh x86_64
16+ RUN /install-musl.sh x86_64 "$MUSL_VERSION"
1617
1718ENV PATH=$PATH:/musl-x86_64/bin:/rust/bin \
1819 RUSTFLAGS="-L /musl-x86_64/lib"
Original file line number Diff line number Diff line change 55
66set -eux
77
8+ arch=" $1 "
9+ version=" $2 "
810old_musl=1.1.24
911new_musl=1.2.5
1012
11- case ${1} in
13+ case " $arch " in
1214 loongarch64) musl_version=" $new_musl " ;;
1315 * )
14- [ -n " ${RUST_LIBC_UNSTABLE_MUSL_V1_2_3:- } " ] &&
15- musl_version=" $new_musl " ||
16- musl_version=" $old_musl "
16+ case " $version " in
17+ old) musl_version=" $old_musl " ;;
18+ new) musl_version=" $new_musl " ;;
19+ * )
20+ echo " musl version must be set to either 'old' or 'new'"
21+ exit 1
22+ ;;
23+ esac
1724 ;;
1825esac
1926
Original file line number Diff line number Diff line change 2121# Find the most recent version matching a pattern.
2222version=$(
2323 echo " $index " |
24- jq -er --slurp --arg pat " $pat " '
24+ jq -er --slurp --arg pat " $pat " '
2525 map(select(.vers | test($pat)))
2626 | last
2727 | debug("version:", .)
Original file line number Diff line number Diff line change 1- #! /bin/sh
1+ #! /bin/bash
22
33# Disable SC2086 as it confuses the docker command.
44# shellcheck disable=SC2086
@@ -27,10 +27,26 @@ if [ "${CI:-0}" != "0" ] && [ "$target" = "aarch64-linux-android" ]; then
2727fi
2828
2929run () {
30- echo " Building docker container for target $target "
30+ run_target=" $1 "
31+ echo " Building docker container for target $run_target "
32+
33+ build_args=(
34+ " --tag=libc-$run_target "
35+ " --file=ci/docker/$run_target /Dockerfile"
36+ " ci/"
37+ )
38+
39+ if [[ " $run_target " = * " musl" * ]]; then
40+ if [ -n " ${RUST_LIBC_UNSTABLE_MUSL_V1_2_3:- } " ]; then
41+ build_args+=(" --build-arg=MUSL_VERSION=new" )
42+ else
43+ build_args+=(" --build-arg=MUSL_VERSION=old" )
44+ fi
45+ fi
3146
3247 # use -f so we can use ci/ as build context
33- docker build -t " libc-$target " -f " ci/docker/$target /Dockerfile" ci/
48+ docker build " ${build_args[@]} "
49+
3450 mkdir -p target
3551 if [ -w /dev/kvm ]; then
3652 kvm=" --volume /dev/kvm:/dev/kvm"
You can’t perform that action at this time.
0 commit comments