Skip to content

Commit 4707c5d

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.
1 parent 4c96512 commit 4707c5d

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
@@ -9,16 +9,20 @@ env:
99
CARGO_TERM_VERBOSE: true
1010
LIBC_CI: 1
1111

12+
defaults:
13+
run:
14+
shell: bash
15+
1216
jobs:
1317
style_check:
1418
name: Style check
1519
runs-on: ubuntu-22.04
1620
steps:
1721
- uses: actions/checkout@v4
1822
- name: Setup Rust toolchain
19-
run: sh ./ci/install-rust.sh
23+
run: ./ci/install-rust.sh
2024
- name: Check style
21-
run: sh ci/style.sh
25+
run: ./ci/style.sh
2226

2327
build_channels_linux:
2428
name: Build Channels Linux
@@ -37,9 +41,9 @@ jobs:
3741
steps:
3842
- uses: actions/checkout@v4
3943
- name: Setup Rust toolchain
40-
run: TOOLCHAIN=${{ matrix.toolchain }} sh ./ci/install-rust.sh
44+
run: TOOLCHAIN=${{ matrix.toolchain }} ./ci/install-rust.sh
4145
- name: Execute build.sh
42-
run: TOOLCHAIN=${{ matrix.toolchain }} sh ./ci/build.sh
46+
run: TOOLCHAIN=${{ matrix.toolchain }} ./ci/build.sh
4347

4448
build_channels_macos:
4549
name: Build Channels macOS
@@ -59,9 +63,9 @@ jobs:
5963
steps:
6064
- uses: actions/checkout@v4
6165
- name: Setup Rust toolchain
62-
run: TOOLCHAIN=${{ matrix.target.toolchain }} sh ./ci/install-rust.sh
66+
run: TOOLCHAIN=${{ matrix.target.toolchain }} ./ci/install-rust.sh
6367
- name: Execute build.sh
64-
run: TOOLCHAIN=${{ matrix.target.toolchain }} sh ./ci/build.sh
68+
run: TOOLCHAIN=${{ matrix.target.toolchain }} ./ci/build.sh
6569

6670
build_channels_windows:
6771
name: Build Channels Windows
@@ -80,7 +84,7 @@ jobs:
8084
run: rustup self update
8185
shell: bash
8286
- name: Execute build.sh
83-
run: TOOLCHAIN=${{ matrix.toolchain }} sh ./ci/build.sh
87+
run: TOOLCHAIN=${{ matrix.toolchain }} ./ci/build.sh
8488
shell: bash
8589

8690
macos:
@@ -94,9 +98,9 @@ jobs:
9498
steps:
9599
- uses: actions/checkout@v4
96100
- name: Setup Rust toolchain
97-
run: TARGET=${{ matrix.target }} sh ./ci/install-rust.sh
101+
run: TARGET=${{ matrix.target }} ./ci/install-rust.sh
98102
- name: Execute run.sh
99-
run: sh ./ci/run.sh ${{ matrix.target }}
103+
run: ./ci/run.sh ${{ matrix.target }}
100104

101105
windows:
102106
name: Windows
@@ -124,10 +128,10 @@ jobs:
124128
run: rustup self update
125129
shell: bash
126130
- name: Setup Rust toolchain
127-
run: TARGET=${{ matrix.target }} sh ./ci/install-rust.sh
131+
run: TARGET=${{ matrix.target }} ./ci/install-rust.sh
128132
shell: bash
129133
- name: Execute run.sh
130-
run: sh ./ci/run.sh ${{ matrix.target }}
134+
run: ./ci/run.sh ${{ matrix.target }}
131135
shell: bash
132136

133137

@@ -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
@@ -199,7 +199,7 @@ esac
199199
for target in $targets; do
200200
if echo "$target" | grep -q "$filter"; then
201201
if [ "${OS}" = "windows" ]; then
202-
TARGET="$target" sh ./ci/install-rust.sh
202+
TARGET="$target" ./ci/install-rust.sh
203203
test_target build "$target"
204204
else
205205
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)