diff --git a/ci/dash/setup-sdk.sh b/ci/dash/setup-sdk.sh index ce3f41b32e4fd6..5a653fb983940a 100755 --- a/ci/dash/setup-sdk.sh +++ b/ci/dash/setup-sdk.sh @@ -17,12 +17,15 @@ XCODE_RELEASE="${XCODE_RELEASE:-15A240d}" XCODE_ARCHIVE="Xcode-${XCODE_VERSION}-${XCODE_RELEASE}-extracted-SDK-with-libcxx-headers" XCODE_AR_PATH="${SDK_SRCS}/${XCODE_ARCHIVE}.tar.gz" -mkdir -p "${SDK_PATH}" "${SDK_SRCS}" -if [ ! -f "${XCODE_AR_PATH}" ]; then - echo "Downloading macOS SDK..." - curl --location --fail "${SDK_URL}/${XCODE_ARCHIVE}.tar.gz" -o "${XCODE_AR_PATH}" -fi -if [ -f "${XCODE_AR_PATH}" ] && [ ! -d "${SDK_PATH}/${XCODE_ARCHIVE}" ]; then - echo "Extracting macOS SDK..." - tar -C "${SDK_PATH}" -xf "${XCODE_AR_PATH}" +if [ ! -d "${SDK_PATH}/${XCODE_ARCHIVE}" ]; then + if [ ! -f "${XCODE_AR_PATH}" ]; then + echo "Downloading macOS SDK..." + mkdir -p "${SDK_SRCS}" + curl --location --fail "${SDK_URL}/${XCODE_ARCHIVE}.tar.gz" -o "${XCODE_AR_PATH}" + fi + if [ -f "${XCODE_AR_PATH}" ]; then + echo "Extracting macOS SDK..." + mkdir -p "${SDK_PATH}" + tar -C "${SDK_PATH}" -xf "${XCODE_AR_PATH}" + fi fi diff --git a/contrib/containers/guix/scripts/guix-start b/contrib/containers/guix/scripts/guix-start index 4b00b602070085..a145ee29764d51 100755 --- a/contrib/containers/guix/scripts/guix-start +++ b/contrib/containers/guix/scripts/guix-start @@ -12,7 +12,7 @@ fi export SDK_PATH="${SDK_PATH:-${WORKSPACE_PATH}/depends/SDKs}" export SDK_SRCS="${SDK_PATH:-${WORKSPACE_PATH}/depends/sdk-sources}" -setup-sdk +./ci/dash/setup-sdk.sh # Add safe.directory option only when WORKSPACE_PATH was specified via cmd-line arguments (happens in CI) if [[ -n "${1}" ]]; then