about summary refs log tree commit diff
path: root/src/ci/scripts
diff options
context:
space:
mode:
authorMatt Cooper <mattc@xbox.com>2020-03-20 14:53:00 -0400
committerMatt Cooper <mattc@xbox.com>2020-03-20 14:53:00 -0400
commit6db4bb68d18fa371fd2eac1e97f2e2413315ef5d (patch)
tree7812db9135fb7223b9e81290afa17e0f87f6e176 /src/ci/scripts
parent330233470e74f76731cc6f702302e9978d363285 (diff)
downloadrust-6db4bb68d18fa371fd2eac1e97f2e2413315ef5d.tar.gz
rust-6db4bb68d18fa371fd2eac1e97f2e2413315ef5d.zip
compat with macOS's ancient Bash
Diffstat (limited to 'src/ci/scripts')
-rwxr-xr-xsrc/ci/scripts/setup-environment.sh10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/ci/scripts/setup-environment.sh b/src/ci/scripts/setup-environment.sh
index 4f7641d50fa..d134fcd47ba 100755
--- a/src/ci/scripts/setup-environment.sh
+++ b/src/ci/scripts/setup-environment.sh
@@ -11,8 +11,14 @@ source "$(cd "$(dirname "$0")" && pwd)/../shared.sh"
 # Since matrix variables are readonly in Azure Pipelines, we take
 # INITIAL_RUST_CONFIGURE_ARGS and establish RUST_CONFIGURE_ARGS
 # which downstream steps can alter
-if [[ -v INITIAL_RUST_CONFIGURE_ARGS ]]; then
-    ciCommandSetEnv RUST_CONFIGURE_ARGS "${INITIAL_RUST_CONFIGURE_ARGS}"
+# macOS ships with Bash 3.16, so we cannot use [[ -v FOO ]],
+# which was introduced in Bash 4.2
+if [[ -z "${INITIAL_RUST_CONFIGURE_ARGS+x}" ]]; then
+    INITIAL_RUST_CONFIG=""
+    echo "No initial Rust configure args set"
+else
+    INITIAL_RUST_CONFIG="${INITIAL_RUST_CONFIGURE_ARGS}"
+    ciCommandSetEnv RUST_CONFIGURE_ARGS "${INITIAL_RUST_CONFIG}"
 fi
 
 # Builders starting with `dist-` are dist builders, but if they also end with