Skip to content

Commit 2ac0a79

Browse files
authored
Merge pull request #4568 from tgross35/ci-cleanup
ci: Clean up unused code
2 parents 503ece7 + 0d1d6fd commit 2ac0a79

File tree

12 files changed

+61
-589
lines changed

12 files changed

+61
-589
lines changed

.editorconfig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[*.sh]
2+
# See https://github.com/mvdan/sh/blob/master/cmd/shfmt/shfmt.1.scd#examples
3+
indent_style = space
4+
indent_size = 4
5+
6+
switch_case_indent = true
7+
space_redirects = true

ci/android-install-sdk.sh

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -15,27 +15,27 @@ wget -q --tries=20 "https://dl.google.com/android/repository/commandlinetools-li
1515
unzip -q -d sdk/cmdline-tools "commandlinetools-linux-${sdk}_latest.zip"
1616

1717
case "$1" in
18-
arm | armv7)
19-
api=24
20-
image="system-images;android-${api};default;armeabi-v7a"
21-
;;
22-
aarch64)
23-
api=24
24-
image="system-images;android-${api};google_apis;arm64-v8a"
25-
;;
26-
i686)
27-
api=28
28-
image="system-images;android-${api};default;x86"
29-
;;
30-
x86_64)
31-
api=28
32-
image="system-images;android-${api};default;x86_64"
33-
;;
34-
*)
35-
echo "invalid arch: $1"
36-
exit 1
37-
;;
38-
esac;
18+
arm | armv7)
19+
api=24
20+
image="system-images;android-${api};default;armeabi-v7a"
21+
;;
22+
aarch64)
23+
api=24
24+
image="system-images;android-${api};google_apis;arm64-v8a"
25+
;;
26+
i686)
27+
api=28
28+
image="system-images;android-${api};default;x86"
29+
;;
30+
x86_64)
31+
api=28
32+
image="system-images;android-${api};default;x86_64"
33+
;;
34+
*)
35+
echo "invalid arch: $1"
36+
exit 1
37+
;;
38+
esac
3939

4040
# Try to fix warning about missing file.
4141
# See https://askubuntu.com/a/1078784
@@ -53,9 +53,9 @@ echo '#Fri Nov 03 10:11:27 CET 2017 count=0' >> /root/.android/repositories.cfg
5353
# which produces an insane amount of output.
5454
yes | ./sdk/cmdline-tools/tools/bin/sdkmanager --licenses --no_https | grep -v = || true
5555
yes | ./sdk/cmdline-tools/tools/bin/sdkmanager --no_https \
56-
"platform-tools" \
57-
"platforms;android-${api}" \
58-
"${image}" | grep -v = || true
56+
"platform-tools" \
57+
"platforms;android-${api}" \
58+
"${image}" | grep -v = || true
5959

6060
# The newer emulator versions (31.3.12 or higher) fail to a valid AVD and the test gets stuck.
6161
# Until we figure out why, we use the older version (31.3.11).

ci/docker/switch/Dockerfile

Lines changed: 0 additions & 9 deletions
This file was deleted.

ci/install-musl.sh

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ case ${1} in
2525
musl_arch=aarch64
2626
kernel_arch=arm64
2727
CC=aarch64-linux-gnu-gcc \
28-
./configure --prefix="/musl-${musl_arch}" --enable-wrapper=yes
28+
./configure --prefix="/musl-${musl_arch}" --enable-wrapper=yes
2929
make install -j4
3030
;;
3131
arm)
3232
musl_arch=arm
3333
kernel_arch=arm
3434
CC=arm-linux-gnueabihf-gcc CFLAGS="-march=armv6 -marm -mfpu=vfp" \
35-
./configure --prefix="/musl-${musl_arch}" --enable-wrapper=yes
35+
./configure --prefix="/musl-${musl_arch}" --enable-wrapper=yes
3636
make install -j4
3737
;;
3838
i686)
@@ -43,7 +43,7 @@ case ${1} in
4343
# Specifically pass -m32 in CFLAGS and override CC when running
4444
# ./configure, since otherwise the script will fail to find a compiler.
4545
CC=gcc CFLAGS="-m32" \
46-
./configure --prefix="/musl-${musl_arch}" --disable-shared --target=i686
46+
./configure --prefix="/musl-${musl_arch}" --disable-shared --target=i686
4747
# unset CROSS_COMPILE when running make; otherwise the makefile will
4848
# call the non-existent binary 'i686-ar'.
4949
make CROSS_COMPILE= install -j4
@@ -58,21 +58,21 @@ case ${1} in
5858
musl_arch=s390x
5959
kernel_arch=s390
6060
CC=s390x-linux-gnu-gcc \
61-
./configure --prefix="/musl-${musl_arch}" --enable-wrapper=yes
61+
./configure --prefix="/musl-${musl_arch}" --enable-wrapper=yes
6262
make install -j4
6363
;;
6464
loongarch64)
6565
musl_arch=loongarch64
6666
kernel_arch=loongarch
6767
CC=loongarch64-linux-gnu-gcc-14 \
68-
./configure --prefix="/musl-${musl_arch}" --enable-wrapper=yes
68+
./configure --prefix="/musl-${musl_arch}" --enable-wrapper=yes
6969
make install -j4
7070
;;
7171
powerpc64*)
7272
musl_arch=powerpc64
7373
kernel_arch=powerpc
7474
CC="${1}-linux-gnu-gcc" CFLAGS="-mlong-double-64" \
75-
./configure --prefix="/musl-${musl_arch}" --enable-wrapper=yes
75+
./configure --prefix="/musl-${musl_arch}" --enable-wrapper=yes
7676
make install -j4
7777
;;
7878
*)
@@ -81,7 +81,6 @@ case ${1} in
8181
;;
8282
esac
8383

84-
8584
# shellcheck disable=SC2103
8685
cd ..
8786
rm -rf "$musl"
@@ -123,8 +122,8 @@ EOF
123122
base=$(basename "$url")
124123
curl --retry 5 -L "$url" > "$base"
125124
case $base in
126-
linux-*) kernel=$base;;
127-
patch-*) patch=$base;;
125+
linux-*) kernel=$base ;;
126+
patch-*) patch=$base ;;
128127
esac
129128
# Check if file is known
130129
grep -o "$base" alpine-sha512sums

ci/install-rust.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ toolchain="${TOOLCHAIN:-nightly}"
99
os="${OS:-}"
1010

1111
case "$(uname -s)" in
12-
Linux*) os=linux ;;
13-
Darwin*) os=macos ;;
14-
MINGW*) os=windows ;;
12+
Linux*) os=linux ;;
13+
Darwin*) os=macos ;;
14+
MINGW*) os=windows ;;
1515
*)
1616
echo "Unknown system $(uname -s)"
1717
exit 1
@@ -51,7 +51,7 @@ if [ "$os" = "windows" ]; then
5151

5252
if [ -n "${ARCH_BITS:-}" ]; then
5353
echo "Fix MinGW"
54-
for i in crt2.o dllcrt2.o libmingwex.a libmsvcrt.a ; do
54+
for i in crt2.o dllcrt2.o libmingwex.a libmsvcrt.a; do
5555
cp -f "/C/ProgramData/Chocolatey/lib/mingw/tools/install/mingw$ARCH_BITS/$ARCH-w64-mingw32/lib/$i" "$(rustc --print sysroot)/lib/rustlib/$TARGET/lib"
5656
done
5757
fi
@@ -71,6 +71,6 @@ until [ $n -ge $N ]; do
7171
break
7272
fi
7373

74-
n=$((n+1))
74+
n=$((n + 1))
7575
sleep 1
7676
done

ci/run-docker.sh

Lines changed: 3 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ echo "${HOME}"
2121
pwd
2222

2323
# Avoid "no space left on device" failure if running in CI
24-
if [ "${CI:-0}" != "0" ] && [ "$target" = "aarch64-linux-android" ] ; then
24+
if [ "${CI:-0}" != "0" ] && [ "$target" = "aarch64-linux-android" ]; then
2525
docker system prune -af
2626
docker system df
2727
fi
@@ -58,48 +58,11 @@ run() {
5858
sh -c "HOME=/tmp PATH=\$PATH:/rust/bin exec ci/run.sh $target"
5959
}
6060

61-
build_switch() {
62-
echo "Building docker container for target switch"
63-
64-
# use -f so we can use ci/ as build context
65-
docker build -t libc-switch -f "ci/docker/switch/Dockerfile" ci/
66-
mkdir -p target
67-
if [ -w /dev/kvm ]; then
68-
kvm="--volume /dev/kvm:/dev/kvm"
69-
else
70-
kvm=""
71-
fi
72-
73-
cp "$(command -v rustup)" "$(rustc --print sysroot)/bin"
74-
75-
docker run \
76-
--rm \
77-
--user "$(id -u)":"$(id -g)" \
78-
--env LIBC_CI \
79-
--env CARGO_HOME=/cargo \
80-
--env CARGO_TARGET_DIR=/checkout/target \
81-
--volume "$CARGO_HOME":/cargo \
82-
--volume "$(rustc --print sysroot)":/rust:ro \
83-
--volume "$(pwd)":/checkout:ro \
84-
--volume "$(pwd)"/target:/checkout/target \
85-
--volume ~/.rustup:/.rustup:Z \
86-
$kvm \
87-
--init \
88-
--workdir /checkout \
89-
libc-switch \
90-
sh -c "HOME=/tmp RUSTUP_HOME=/tmp PATH=\$PATH:/rust/bin rustup default nightly \
91-
&& rustup component add rust-src --target ci/switch.json \
92-
&& cargo build -Z build-std=core,alloc --target ci/switch.json"
93-
}
94-
9561
if [ -z "$target" ]; then
62+
# Run all docker targets
9663
for d in ci/docker/*; do
9764
run "${d}"
9865
done
9966
else
100-
if [ "$target" != "switch" ]; then
101-
run "$target"
102-
else
103-
build_switch
104-
fi
67+
run "$target"
10568
fi

ci/run.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ case "$target" in
1919
*android*) cmd="$cmd --manifest-path libc-test/Cargo.toml" ;;
2020
*s390x*) cmd="$cmd --manifest-path libc-test/Cargo.toml" ;;
2121
# For all other platforms, test everything in the workspace
22-
*) cmd="$cmd --workspace"
22+
*) cmd="$cmd --workspace" ;;
2323
esac
2424

2525
# garando_errors only compiles on `cfg(any(unix, windows))`
2626
case "$target" in
27-
*wasm*) cmd="$cmd --exclude ctest --exclude ctest-test --exclude ctest-next"
27+
*wasm*) cmd="$cmd --exclude ctest --exclude ctest-test --exclude ctest-next" ;;
2828
esac
2929

3030
if [ "$target" = "s390x-unknown-linux-gnu" ]; then
@@ -37,13 +37,13 @@ if [ "$target" = "s390x-unknown-linux-gnu" ]; then
3737
if [ "$passed" = "0" ]; then
3838
# shellcheck disable=SC2086
3939
if $cmd --no-default-features -- $test_flags; then
40-
passed=$((passed+1))
40+
passed=$((passed + 1))
4141
continue
4242
fi
4343
elif [ "$passed" = "1" ]; then
4444
# shellcheck disable=SC2086
4545
if $cmd -- $test_flags; then
46-
passed=$((passed+1))
46+
passed=$((passed + 1))
4747
continue
4848
fi
4949
elif [ "$passed" = "2" ]; then
@@ -52,7 +52,7 @@ if [ "$target" = "s390x-unknown-linux-gnu" ]; then
5252
break
5353
fi
5454
fi
55-
n=$((n+1))
55+
n=$((n + 1))
5656
sleep 1
5757
done
5858
else

0 commit comments

Comments
 (0)