From d560d7e3e2d22702a059be56b207089f0236abf4 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Mon, 9 Jan 2023 11:25:09 -0500 Subject: [PATCH] Fix syntax of test in chip_xcode_build_connector.sh. (#24313) There was a stray ']' that was being treated as part of the string, so we never set target_arch or target_cpu. Fixing that ended up with us setting target_arch/cpu to arm64 if it came before x84_64 in ARCHS, which breaks CI. So make sure we use the host arch as the target_arch if it's in ARCHS at all. --- src/darwin/Framework/chip_xcode_build_connector.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/darwin/Framework/chip_xcode_build_connector.sh b/src/darwin/Framework/chip_xcode_build_connector.sh index ab94517c93f2f8..5d8459b835681b 100755 --- a/src/darwin/Framework/chip_xcode_build_connector.sh +++ b/src/darwin/Framework/chip_xcode_build_connector.sh @@ -63,10 +63,11 @@ target_defines=[${target_defines:1}] declare target_arch= declare target_cpu= declare target_cflags= +declare current_arch="$(uname -m)" read -r -a archs <<<"$ARCHS" for arch in "${archs[@]}"; do - if [ -z "$target_arch"] ]; then + if [ -z "$target_arch" ] || [ "$arch" = "$current_arch" ]; then target_arch="$arch" case "$arch" in x86_64) target_cpu="x64" ;;