Skip to content

Commit

Permalink
ci: Set -u (error on unset) in all script files
Browse files Browse the repository at this point in the history
This is a pretty common flag to reduce errors. Make use of it here.

(backport <rust-lang#4108>)
(cherry picked from commit 59a18de)
  • Loading branch information
tgross35 committed Nov 19, 2024
1 parent c3e2491 commit 18181ec
Show file tree
Hide file tree
Showing 16 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion ci/android-install-ndk.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env sh

set -ex
set -eux

ndk=android-ndk-r27
wget --tries=20 -q "https://dl.google.com/android/repository/${ndk}-linux.zip"
Expand Down
2 changes: 1 addition & 1 deletion ci/android-install-sdk.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env sh

set -ex
set -eux

# Prep the SDK and emulator
#
Expand Down
2 changes: 1 addition & 1 deletion ci/android-sysimage.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

set -ex
set -eux

URL=https://dl.google.com/android/repository/sys-img/android

Expand Down
2 changes: 1 addition & 1 deletion ci/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# The FILTER environment variable can be used to select which target(s) to build.
# For example: set FILTER to vxworks to select the targets that has vxworks in name

set -ex
set -eux

: "${TOOLCHAIN?The TOOLCHAIN environment variable must be set.}"
: "${OS?The OS environment variable must be set.}"
Expand Down
2 changes: 1 addition & 1 deletion ci/docker/wasm32-unknown-emscripten/node-wrapper.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

set -e
set -eux

me="$1"
shift
Expand Down
2 changes: 1 addition & 1 deletion ci/emscripten-entry.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

set -ex
set -eux

# shellcheck disable=SC1091
source /emsdk-portable/emsdk_env.sh &> /dev/null
Expand Down
2 changes: 1 addition & 1 deletion ci/emscripten.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

set -ex
set -eux

# Note: keep in sync with:
# https://github.com/rust-lang/rust/blob/master/src/ci/docker/scripts/emscripten.sh
Expand Down
2 changes: 1 addition & 1 deletion ci/install-musl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Install musl and musl-sanitized linux kernel headers
# to musl-{$1} directory

set -ex
set -eux

musl_version=1.1.24
musl="musl-${musl_version}"
Expand Down
2 changes: 1 addition & 1 deletion ci/install-rust.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env sh
# This is intended to be used in CI only.

set -ex
set -eux

echo "Setup toolchain"
toolchain=
Expand Down
2 changes: 1 addition & 1 deletion ci/linux-s390x.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env sh

set -ex
set -eux

mkdir -m 777 /qemu
cd /qemu
Expand Down
2 changes: 1 addition & 1 deletion ci/linux-sparc64.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env sh

set -ex
set -eux

mkdir -m 777 /qemu
cd /qemu
Expand Down
2 changes: 1 addition & 1 deletion ci/run-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# Small script to run tests for a target (or all targets) inside all the
# respective docker images.

set -ex
set -eux

# Default to assuming the CARGO_HOME is one directory up (to account for a `bin`
# subdir) from where the `cargo` binary in `$PATH` lives.
Expand Down
2 changes: 1 addition & 1 deletion ci/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Builds and runs tests for a particular target passed as an argument to this
# script.

set -ex
set -eux

mirrors_url="https://ci-mirrors.rust-lang.org/libc"

Expand Down
2 changes: 1 addition & 1 deletion ci/style.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

set -ex
set -eux

if [ -n "${CI:-}" ]; then
rustup toolchain install nightly -c rustfmt --allow-downgrade
Expand Down
2 changes: 1 addition & 1 deletion ci/test-runner-linux
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

set -e
set -eux

arch="$1"
prog="$2"
Expand Down
2 changes: 1 addition & 1 deletion ci/wasi.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

set -ex
set -eux

apt-get update
apt-get install -y --no-install-recommends \
Expand Down

0 comments on commit 18181ec

Please sign in to comment.