Skip to content

Commit 3e48e4b

Browse files
committed
ci: Use ./ with shebangs rather than sh or bash
The scripts say how they should execute, there isn't any reason to duplicate this wherever they are called. (backport <#4124>) (cherry picked from commit 4707c5d)
1 parent 92597e6 commit 3e48e4b

File tree

29 files changed

+43
-39
lines changed

29 files changed

+43
-39
lines changed

.github/workflows/ci.yaml

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,20 @@ env:
1010
CARGO_TERM_VERBOSE: true
1111
LIBC_CI: 1
1212

13+
defaults:
14+
run:
15+
shell: bash
16+
1317
jobs:
1418
style_check:
1519
name: Style check
1620
runs-on: ubuntu-22.04
1721
steps:
1822
- uses: actions/checkout@v4
1923
- name: Setup Rust toolchain
20-
run: sh ./ci/install-rust.sh
24+
run: ./ci/install-rust.sh
2125
- name: Check style
22-
run: sh ci/style.sh
26+
run: ./ci/style.sh
2327

2428
build_channels_linux:
2529
name: Build Channels Linux
@@ -38,9 +42,9 @@ jobs:
3842
steps:
3943
- uses: actions/checkout@v4
4044
- name: Setup Rust toolchain
41-
run: TOOLCHAIN=${{ matrix.toolchain }} sh ./ci/install-rust.sh
45+
run: TOOLCHAIN=${{ matrix.toolchain }} ./ci/install-rust.sh
4246
- name: Execute build.sh
43-
run: TOOLCHAIN=${{ matrix.toolchain }} sh ./ci/build.sh
47+
run: TOOLCHAIN=${{ matrix.toolchain }} ./ci/build.sh
4448

4549
build_channels_macos:
4650
name: Build Channels macOS
@@ -60,9 +64,9 @@ jobs:
6064
steps:
6165
- uses: actions/checkout@v4
6266
- name: Setup Rust toolchain
63-
run: TOOLCHAIN=${{ matrix.target.toolchain }} sh ./ci/install-rust.sh
67+
run: TOOLCHAIN=${{ matrix.target.toolchain }} ./ci/install-rust.sh
6468
- name: Execute build.sh
65-
run: TOOLCHAIN=${{ matrix.target.toolchain }} sh ./ci/build.sh
69+
run: TOOLCHAIN=${{ matrix.target.toolchain }} ./ci/build.sh
6670

6771
build_channels_windows:
6872
name: Build Channels Windows
@@ -81,7 +85,7 @@ jobs:
8185
run: rustup self update
8286
shell: bash
8387
- name: Execute build.sh
84-
run: TOOLCHAIN=${{ matrix.toolchain }} sh ./ci/build.sh
88+
run: TOOLCHAIN=${{ matrix.toolchain }} ./ci/build.sh
8589
shell: bash
8690

8791
macos:
@@ -95,9 +99,9 @@ jobs:
9599
steps:
96100
- uses: actions/checkout@v4
97101
- name: Setup Rust toolchain
98-
run: TARGET=${{ matrix.target }} sh ./ci/install-rust.sh
102+
run: TARGET=${{ matrix.target }} ./ci/install-rust.sh
99103
- name: Execute run.sh
100-
run: sh ./ci/run.sh ${{ matrix.target }}
104+
run: ./ci/run.sh ${{ matrix.target }}
101105

102106
windows:
103107
name: Windows
@@ -125,10 +129,10 @@ jobs:
125129
run: rustup self update
126130
shell: bash
127131
- name: Setup Rust toolchain
128-
run: TARGET=${{ matrix.target }} sh ./ci/install-rust.sh
132+
run: TARGET=${{ matrix.target }} ./ci/install-rust.sh
129133
shell: bash
130134
- name: Execute run.sh
131-
run: sh ./ci/run.sh ${{ matrix.target }}
135+
run: ./ci/run.sh ${{ matrix.target }}
132136
shell: bash
133137

134138
docker_linux_tier1:
@@ -143,9 +147,9 @@ jobs:
143147
steps:
144148
- uses: actions/checkout@v4
145149
- name: Setup Rust toolchain
146-
run: TARGET=${{ matrix.target }} sh ./ci/install-rust.sh
150+
run: TARGET=${{ matrix.target }} ./ci/install-rust.sh
147151
- name: Execute run-docker.sh
148-
run: sh ./ci/run-docker.sh ${{ matrix.target }}
152+
run: ./ci/run-docker.sh ${{ matrix.target }}
149153

150154
docker_linux_tier2:
151155
name: Docker Linux Tier2
@@ -185,9 +189,9 @@ jobs:
185189
steps:
186190
- uses: actions/checkout@v4
187191
- name: Setup Rust toolchain
188-
run: TARGET=${{ matrix.target }} sh ./ci/install-rust.sh
192+
run: TARGET=${{ matrix.target }} ./ci/install-rust.sh
189193
- name: Execute run-docker.sh
190-
run: sh ./ci/run-docker.sh ${{ matrix.target }}
194+
run: ./ci/run-docker.sh ${{ matrix.target }}
191195

192196
solaris:
193197
name: Solaris
@@ -214,15 +218,15 @@ jobs:
214218
uname -a
215219
run: |
216220
export PATH=$HOME/.rust_solaris/bin:$PATH
217-
bash ./ci/run.sh ${{ matrix.target }}
221+
./ci/run.sh ${{ matrix.target }}
218222
219223
check_cfg:
220224
name: "Check #[cfg]s"
221225
runs-on: ubuntu-22.04
222226
steps:
223227
- uses: actions/checkout@v4
224228
- name: Setup Rust toolchain
225-
run: TOOLCHAIN=nightly sh ./ci/install-rust.sh
229+
run: TOOLCHAIN=nightly ./ci/install-rust.sh
226230
- name: Build with check-cfg
227231
run: LIBC_CHECK_CFG=1 cargo build -Z unstable-options -Z check-cfg
228232

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ We have two automated tests running on
9393
- `cd libc-test && cargo test`
9494
- Use the `skip_*()` functions in `build.rs` if you really need a workaround.
9595
2. Style checker
96-
- [`sh ci/style.sh`](https://github.com/rust-lang/libc/blob/main/ci/style.sh)
96+
- [`./ci/style.sh`](https://github.com/rust-lang/libc/blob/main/ci/style.sh)
9797

9898
## Breaking change policy
9999

ci/android-install-ndk.sh

100644100755
File mode changed.

ci/android-install-sdk.sh

100644100755
File mode changed.

ci/android-sysimage.sh

100644100755
File mode changed.

ci/build.sh

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ esac
201201
for target in $targets; do
202202
if echo "$target" | grep -q "$filter"; then
203203
if [ "${OS}" = "windows" ]; then
204-
TARGET="$target" sh ./ci/install-rust.sh
204+
TARGET="$target" ./ci/install-rust.sh
205205
test_target build "$target"
206206
else
207207
test_target build "$target"

ci/docker/aarch64-linux-android/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ COPY android* /android/
2020
ENV ANDROID_ARCH=aarch64
2121
ENV PATH=$PATH:/android/linux-x86_64/bin:/android/sdk/cmdline-tools/tools:/android/sdk/platform-tools
2222

23-
RUN sh /android/android-install-ndk.sh
24-
RUN sh /android/android-install-sdk.sh $ANDROID_ARCH
23+
RUN /android/android-install-ndk.sh
24+
RUN /android/android-install-sdk.sh $ANDROID_ARCH
2525
RUN mv /root/.android /tmp
2626
RUN chmod 777 -R /tmp/.android
2727
RUN chmod 755 /android/sdk/cmdline-tools/tools/* /android/sdk/emulator/qemu/linux-x86_64/*

ci/docker/aarch64-unknown-linux-musl/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
55
gcc-aarch64-linux-gnu qemu-user
66

77
COPY install-musl.sh /
8-
RUN sh /install-musl.sh aarch64
8+
RUN /install-musl.sh aarch64
99

1010
# FIXME: shouldn't need the `-lgcc` here, shouldn't that be in std?
1111
ENV PATH=$PATH:/musl-aarch64/bin:/rust/bin \

ci/docker/arm-linux-androideabi/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ COPY android* /android/
2020
ENV ANDROID_ARCH=arm
2121
ENV PATH=$PATH:/android/linux-x86_64/bin:/android/sdk/cmdline-tools/tools:/android/sdk/platform-tools
2222

23-
RUN sh /android/android-install-ndk.sh
24-
RUN sh /android/android-install-sdk.sh $ANDROID_ARCH
23+
RUN /android/android-install-ndk.sh
24+
RUN /android/android-install-sdk.sh $ANDROID_ARCH
2525
RUN mv /root/.android /tmp
2626
RUN chmod 777 -R /tmp/.android
2727
RUN chmod 755 /android/sdk/cmdline-tools/tools/* /android/sdk/emulator/qemu/linux-x86_64/*

ci/docker/arm-unknown-linux-musleabihf/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ RUN sed -i -E 's/(archive|security)\.ubuntu\.com/old-releases.ubuntu.com/g' \
88
gcc-arm-linux-gnueabihf qemu-user
99

1010
COPY install-musl.sh /
11-
RUN sh /install-musl.sh arm
11+
RUN /install-musl.sh arm
1212

1313
ENV PATH=$PATH:/musl-arm/bin:/rust/bin \
1414
CC_arm_unknown_linux_musleabihf=musl-gcc \

0 commit comments

Comments
 (0)