Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix shellcheck error #78666

Merged
merged 4 commits into from
Nov 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions compiler/rustc_codegen_cranelift/scripts/cargo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ cmd=$1
shift || true

if [[ "$cmd" = "jit" ]]; then
cargo +${TOOLCHAIN} rustc $@ -- --jit
cargo +${TOOLCHAIN} rustc "$@" -- --jit
else
cargo +${TOOLCHAIN} $cmd $@
cargo +${TOOLCHAIN} $cmd "$@"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These have already been fixed https://github.com/bjorn3/rustc_codegen_cranelift/pull/1109, which hasn't been pulled into rust-lang/rust yet. This is going to conflict when I pull it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fi
1 change: 1 addition & 0 deletions compiler/rustc_codegen_cranelift/scripts/config.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env bash
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is deliberately not executable. It is only meant to be sourced.

set -e

unamestr=`uname`
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_codegen_cranelift/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ set -e

export RUSTFLAGS="-Zrun_dsymutil=no"

./build.sh --without-sysroot $@
./build.sh --without-sysroot "$@"

rm -r target/out || true

scripts/tests.sh no_sysroot

./build.sh $@
./build.sh "$@"

scripts/tests.sh base_sysroot
scripts/tests.sh extended_sysroot
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ exit 1
trap "$on_err" ERR
bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
PING_LOOP_PID=$!
$@ &> /tmp/build.log
"$@" &> /tmp/build.log
trap - ERR
kill $PING_LOOP_PID
set -x
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ exit 1
trap "$on_err" ERR
bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
PING_LOOP_PID=$!
$@ &> /tmp/build.log
"$@" &> /tmp/build.log
trap - ERR
kill $PING_LOOP_PID
set -x
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ exit 1
trap "$on_err" ERR
bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
PING_LOOP_PID=$!
$@ &> /tmp/build.log
"$@" &> /tmp/build.log
rm /tmp/build.log
trap - ERR
kill $PING_LOOP_PID
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ exit 1
trap "$on_err" ERR
bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
PING_LOOP_PID=$!
$@ &> /tmp/build.log
"$@" &> /tmp/build.log
rm /tmp/build.log
trap - ERR
kill $PING_LOOP_PID
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ exit 1
trap "$on_err" ERR
bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
PING_LOOP_PID=$!
$@ &> /tmp/build.log
"$@" &> /tmp/build.log
rm /tmp/build.log
trap - ERR
kill $PING_LOOP_PID
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ exit 1
trap "$on_err" ERR
bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
PING_LOOP_PID=$!
$@ &> /tmp/build.log
"$@" &> /tmp/build.log
rm /tmp/build.log
trap - ERR
kill $PING_LOOP_PID
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ exit 1
trap "$on_err" ERR
bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
PING_LOOP_PID=$!
$@ &> /tmp/build.log
"$@" &> /tmp/build.log
rm /tmp/build.log
trap - ERR
kill $PING_LOOP_PID
Expand Down
3 changes: 2 additions & 1 deletion src/ci/docker/host-x86_64/dist-powerpc64-linux/shared.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/sh
hide_output() {
set +x
on_err="
Expand All @@ -8,7 +9,7 @@ exit 1
trap "$on_err" ERR
bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
sasurau4 marked this conversation as resolved.
Show resolved Hide resolved
PING_LOOP_PID=$!
$@ &> /tmp/build.log
"$@" &> /tmp/build.log
trap - ERR
kill $PING_LOOP_PID
set -x
Expand Down
3 changes: 2 additions & 1 deletion src/ci/docker/host-x86_64/dist-powerpc64le-linux/shared.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/sh
hide_output() {
set +x
on_err="
Expand All @@ -8,7 +9,7 @@ exit 1
trap "$on_err" ERR
bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
PING_LOOP_PID=$!
$@ &> /tmp/build.log
"$@" &> /tmp/build.log
trap - ERR
kill $PING_LOOP_PID
set -x
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ exit 1
trap "$on_err" ERR
bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
PING_LOOP_PID=$!
$@ &> /tmp/build.log
"$@" &> /tmp/build.log
rm /tmp/build.log
trap - ERR
kill $PING_LOOP_PID
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/sh
set -ex

# Mirrored from https://github.com/crosstool-ng/crosstool-ng/archive/crosstool-ng-1.24.0.tar.gz
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ exit 1
trap "$on_err" ERR
bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
PING_LOOP_PID=$!
$@ &> /tmp/build.log
"$@" &> /tmp/build.log
rm /tmp/build.log
trap - ERR
kill $PING_LOOP_PID
Expand Down
2 changes: 1 addition & 1 deletion src/ci/docker/host-x86_64/dist-various-1/build-rumprun.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ exit 1
trap "$on_err" ERR
bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
PING_LOOP_PID=$!
$@ &> /tmp/build.log
"$@" &> /tmp/build.log
trap - ERR
kill $PING_LOOP_PID
rm /tmp/build.log
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/sh
set -ex

mkdir /usr/local/mips-linux-musl
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/sh
set -ex

mkdir /usr/local/mipsel-linux-musl
Expand Down
1 change: 1 addition & 0 deletions src/ci/docker/host-x86_64/dist-various-2/shared.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env bash
hide_output() {
{ set +x; } 2>/dev/null
on_err="
Expand Down
3 changes: 2 additions & 1 deletion src/ci/docker/host-x86_64/dist-x86_64-linux/shared.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/sh
hide_output() {
set +x
on_err="
Expand All @@ -8,7 +9,7 @@ exit 1
trap "$on_err" ERR
bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
PING_LOOP_PID=$!
$@ &> /tmp/build.log
"$@" &> /tmp/build.log
trap - ERR
kill $PING_LOOP_PID
set -x
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ exit 1
trap "$on_err" ERR
bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
PING_LOOP_PID=$!
$@ &> /tmp/build.log
"$@" &> /tmp/build.log
rm /tmp/build.log
trap - ERR
kill $PING_LOOP_PID
Expand Down
1 change: 1 addition & 0 deletions src/ci/docker/scripts/android-base-apt-get.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/sh
set -ex

apt-get update
Expand Down
1 change: 1 addition & 0 deletions src/ci/docker/scripts/android-ndk.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/sh
set -ex

URL=https://dl.google.com/android/repository
Expand Down
1 change: 1 addition & 0 deletions src/ci/docker/scripts/android-sdk.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/sh
set -ex

export ANDROID_HOME=/android/sdk
Expand Down
1 change: 1 addition & 0 deletions src/ci/docker/scripts/cross-apt-packages.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/sh
apt-get update && apt-get install -y --no-install-recommends \
automake \
bison \
Expand Down
1 change: 1 addition & 0 deletions src/ci/docker/scripts/crosstool-ng-1.24.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/sh
set -ex

# Mirrored from https://github.com/crosstool-ng/crosstool-ng/archive/crosstool-ng-1.24.0.tar.gz
Expand Down
1 change: 1 addition & 0 deletions src/ci/docker/scripts/crosstool-ng.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/sh
set -ex

url="https://github.com/crosstool-ng/crosstool-ng/archive/crosstool-ng-1.22.0.tar.gz"
Expand Down
3 changes: 2 additions & 1 deletion src/ci/docker/scripts/emscripten.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/sh
set -ex

hide_output() {
Expand All @@ -10,7 +11,7 @@ exit 1
trap "$on_err" ERR
bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
PING_LOOP_PID=$!
$@ &> /tmp/build.log
"$@" &> /tmp/build.log
trap - ERR
kill $PING_LOOP_PID
rm -f /tmp/build.log
Expand Down
2 changes: 1 addition & 1 deletion src/ci/docker/scripts/freebsd-toolchain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ exit 1
trap "$on_err" ERR
bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
local ping_loop_pid=$!
$@ &> /tmp/build.log
"$@" &> /tmp/build.log
trap - ERR
kill $ping_loop_pid
set -x
Expand Down
1 change: 1 addition & 0 deletions src/ci/docker/scripts/make3.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/sh
set -ex

curl -f https://ftp.gnu.org/gnu/make/make-3.81.tar.gz | tar xzf -
Expand Down
3 changes: 2 additions & 1 deletion src/ci/docker/scripts/musl-toolchain.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/sh
# This script runs `musl-cross-make` to prepare C toolchain (Binutils, GCC, musl itself)
# and builds static libunwind that we distribute for static target.
#
Expand All @@ -19,7 +20,7 @@ exit 1
trap "$on_err" ERR
bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
PING_LOOP_PID=$!
$@ &> /tmp/build.log
"$@" &> /tmp/build.log
trap - ERR
kill $PING_LOOP_PID
rm /tmp/build.log
Expand Down
5 changes: 3 additions & 2 deletions src/ci/docker/scripts/musl.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/sh
set -ex

hide_output() {
Expand All @@ -10,7 +11,7 @@ exit 1
trap "$on_err" ERR
bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
PING_LOOP_PID=$!
$@ &> /tmp/build.log
"$@" &> /tmp/build.log
trap - ERR
kill $PING_LOOP_PID
rm /tmp/build.log
Expand All @@ -32,7 +33,7 @@ if [ ! -d $MUSL ]; then
fi

cd $MUSL
./configure --enable-optimize --enable-debug --disable-shared --prefix=/musl-$TAG $@
./configure --enable-optimize --enable-debug --disable-shared --prefix=/musl-$TAG "$@"
if [ "$TAG" = "i586" -o "$TAG" = "i686" ]; then
hide_output make -j$(nproc) AR=ar RANLIB=ranlib
else
Expand Down
1 change: 1 addition & 0 deletions src/ci/docker/scripts/rustbuild-setup.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/sh
set -ex

groupadd -r rustbuild && useradd -m -r -g rustbuild rustbuild
Expand Down
1 change: 1 addition & 0 deletions src/ci/docker/scripts/sccache.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/sh
set -ex

case "$(uname -m)" in
Expand Down
1 change: 1 addition & 0 deletions src/ci/init_repo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ modules=($modules)
use_git=""
urls="$(git config --file .gitmodules --get-regexp '\.url$' | cut -d' ' -f2)"
urls=($urls)
# shellcheck disable=SC2068
for i in ${!modules[@]}; do
module=${modules[$i]}
if [[ " $included " = *" $module "* ]]; then
Expand Down
1 change: 1 addition & 0 deletions src/ci/shared.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/false
# shellcheck shell=bash

# This file is intended to be sourced with `. shared.sh` or
# `source shared.sh`, hence the invalid shebang and not being
Expand Down
1 change: 1 addition & 0 deletions src/test/run-make/thumb-none-qemu/script.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/sh
set -exuo pipefail

CRATE=example
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/sh
set -exuo pipefail

function build {
Expand Down