From b1488222bfecdde930f0aa16ac229a97e08804e8 Mon Sep 17 00:00:00 2001 From: Nikita Shulga Date: Mon, 23 Jan 2023 16:55:40 -0800 Subject: [PATCH] Fix unbound variable error (#1276) Regression introduced (and ignored) by https://github.com/pytorch/builder/pull/1262 Test plan: ``` % bash -c 'set -u; if [[ -z "${FOO}" ]]; then echo "bar"; fi' bash: FOO: unbound variable (base) nshulga@nshulga-mbp builder % bash -c 'set -u; if [[ -z "${FOO+x}" ]]; then echo "bar"; fi' bar (base) nshulga@nshulga-mbp builder % FOO=1 bash -c 'set -u; if [[ -z "${FOO+x}" ]]; then echo "bar"; fi' ``` --- common/install_cpython.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/install_cpython.sh b/common/install_cpython.sh index 8ba9f7bac..6c75dea97 100755 --- a/common/install_cpython.sh +++ b/common/install_cpython.sh @@ -40,7 +40,7 @@ function do_cpython_build { mkdir -p ${prefix}/lib # -Wformat added for https://bugs.python.org/issue17547 on Python 2.6 - if [[ -z ${WITH_OPENSSL} ]]; then + if [[ -z "${WITH_OPENSSL+x}" ]]; then CFLAGS="-Wformat" ./configure --prefix=${prefix} --disable-shared $unicode_flags > /dev/null else CFLAGS="-Wformat" ./configure --prefix=${prefix} --with-openssl=${WITH_OPENSSL} --with-openssl-rpath=auto --disable-shared $unicode_flags > /dev/null