From 7d700b3de5960d2b3f16310f93a77eecb2f25e4b Mon Sep 17 00:00:00 2001 From: Kyle Neideck Date: Thu, 7 Mar 2024 08:28:30 +1100 Subject: [PATCH] build_and_install.sh: Work around build failures caused by an Xcode bug. Fixes #712. --- build_and_install.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/build_and_install.sh b/build_and_install.sh index d8023a6..163f8fe 100755 --- a/build_and_install.sh +++ b/build_and_install.sh @@ -19,7 +19,7 @@ # # build_and_install.sh # -# Copyright © 2016-2022 Kyle Neideck +# Copyright © 2016-2022, 2024 Kyle Neideck # Copyright © 2016 Nick Jacques # # Builds and installs BGMApp, BGMDriver and BGMXPCHelper. Requires xcodebuild and Xcode. @@ -641,6 +641,16 @@ if [[ "${XCODEBUILD_ACTION}" == "install" ]]; then SUDO="sudo" ACTIONING="Installing" DSTROOT_ARG="DSTROOT=/" + # Work around an Xcode (15.2) bug where xcodebuild incorrectly detects a dependency cycle if + # DSTROOT is set to /. + for v in /Volumes/*; do + if [[ "$(realpath "$v")" == "/" ]]; then + DSTROOT_ARG="DSTROOT=$v" + echo "Set DSTROOT_ARG to ${DSTROOT_ARG} to work around an Xcode bug." >> ${LOG_FILE} + break + fi + done + echo "DSTROOT_ARG: ${DSTROOT_ARG}." >> ${LOG_FILE} elif [[ "${XCODEBUILD_ACTION}" == "archive" ]]; then SUDO="" ACTIONING="Building and archiving"