Skip to content

Commit 335d91d

Browse files
committed
Add a workaround for a Carthage build issue in Xcode 12.0
1 parent 39d72c1 commit 335d91d

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

Consumption-Tests/Shared/carthage-checkout.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,9 @@ echo "git \"file://$REPO_ROOT_ABS_DIR_PATH\" \"$TEMP_TAG_NAME\"" > "$WORKING_DIR
128128
set +e
129129

130130
# Perform the `carthage update` (using the Cartfile we just created/updated)
131-
carthage update
131+
# (`./carthage.sh update` instead of `carthage update` as a workaround for Carthage Xcode 12 issue: https://github.com/Carthage/Carthage/issues/3019#issuecomment-665136323)
132+
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
133+
source ${DIR}/carthage.sh update
132134
CARTHAGE_UPDATE_STATUS_CODE=$?
133135
echo "CARTHAGE_UPDATE_STATUS_CODE=$CARTHAGE_UPDATE_STATUS_CODE"
134136

Consumption-Tests/Shared/carthage.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/env bash
2+
3+
# carthage.sh
4+
# Usage example: ./carthage.sh build --platform iOS
5+
6+
set -euo pipefail
7+
8+
xcconfig=$(mktemp /tmp/static.xcconfig.XXXXXX)
9+
trap 'rm -f "$xcconfig"' INT TERM HUP EXIT
10+
11+
# For Xcode 12 make sure EXCLUDED_ARCHS is set to arm architectures otherwise
12+
# the build will fail on lipo due to duplicate architectures.
13+
echo 'EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64__XCODE_1200 = arm64 arm64e armv7 armv7s armv6 armv8' >> $xcconfig
14+
echo 'EXCLUDED_ARCHS = $(inherited) $(EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_$(EFFECTIVE_PLATFORM_SUFFIX)__NATIVE_ARCH_64_BIT_$(NATIVE_ARCH_64_BIT)__XCODE_$(XCODE_VERSION_MAJOR))' >> $xcconfig
15+
16+
export XCODE_XCCONFIG_FILE="$xcconfig"
17+
carthage "$@"

0 commit comments

Comments
 (0)