Skip to content

Commit 8268d76

Browse files
committed
Fix some warnings from shellcheck
1 parent ea86bf9 commit 8268d76

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

ci/run-docker.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ run() {
1414
# will be owned by root
1515
mkdir -p target
1616

17-
if [ $(uname -s) = "Linux" ] && [ -z "${DOCKER_BASE_IMAGE:-}" ]; then
17+
if [ "$(uname -s)" = "Linux" ] && [ -z "${DOCKER_BASE_IMAGE:-}" ]; then
1818
# Share the host rustc and target. Do this only on Linux and if the image
1919
# isn't overridden
2020
run_args=(
@@ -53,9 +53,9 @@ run() {
5353
)
5454
fi
5555

56-
docker ${build_cmd[@]:-build} \
56+
docker "${build_cmd[@]:-build}" \
5757
-t "builtins-$target" \
58-
${build_args[@]:-} \
58+
"${build_args[@]:-}" \
5959
"ci/docker/$target"
6060
docker run \
6161
--rm \
@@ -64,7 +64,7 @@ run() {
6464
-e "CARGO_TARGET_DIR=/builtins-target" \
6565
-v "$(pwd):/checkout:ro" \
6666
-w /checkout \
67-
${run_args[@]:-} \
67+
"${run_args[@]:-}" \
6868
--init \
6969
"builtins-$target" \
7070
sh -c "$run_cmd"

ci/run.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,17 @@ fi
3838

3939
if [ "${TEST_VERBATIM:-}" = "1" ]; then
4040
verb_path=$(cmd.exe //C echo \\\\?\\%cd%\\testcrate\\target2)
41-
cargo build --manifest-path testcrate/Cargo.toml --target $target --target-dir $verb_path --features c
41+
cargo build --manifest-path testcrate/Cargo.toml --target "$target" --target-dir "$verb_path" --features c
4242
fi
4343

4444
if [ -d /builtins-target ]; then
45-
rlib_paths=/builtins-target/"${target}"/debug/deps/libcompiler_builtins-*.rlib
45+
rlib_paths=( /builtins-target/"${target}"/debug/deps/libcompiler_builtins-*.rlib )
4646
else
47-
rlib_paths=target/"${target}"/debug/deps/libcompiler_builtins-*.rlib
47+
rlib_paths=( target/"${target}"/debug/deps/libcompiler_builtins-*.rlib )
4848
fi
4949

5050
# Remove any existing artifacts from previous tests that don't set #![compiler_builtins]
51-
rm -f $rlib_paths
51+
rm -f "${rlib_paths[@]}"
5252

5353
cargo build --target "$target"
5454
cargo build --target "$target" --release
@@ -84,7 +84,7 @@ if [[ "$TOOLCHAIN" == *i686-pc-windows-gnu ]]; then
8484
fi
8585

8686
# Look out for duplicated symbols when we include the compiler-rt (C) implementation
87-
for rlib in $rlib_paths; do
87+
for rlib in "${rlib_paths[@]}"; do
8888
set +x
8989
echo "================================================================"
9090
echo "checking $rlib for duplicate symbols"
@@ -108,7 +108,7 @@ for rlib in $rlib_paths; do
108108
fi
109109
done
110110

111-
rm -f $rlib_paths
111+
rm -f "${rlib_paths[@]}"
112112

113113
build_intrinsics() {
114114
cargo build --target "$target" -v --example intrinsics "$@"
@@ -128,7 +128,7 @@ CARGO_PROFILE_RELEASE_LTO=true \
128128
cargo build --target "$target" --example intrinsics --release
129129

130130
# Ensure no references to any symbols from core
131-
for rlib in $(echo $rlib_paths); do
131+
for rlib in "${rlib_paths[@]}"; do
132132
set +x
133133
echo "================================================================"
134134
echo "checking $rlib for references to core"

0 commit comments

Comments
 (0)