profile
viewpoint

Ask questionslipo failing during build process Xcode 12 for Mac M1

I'm building on a Mac M1 BigSur 11.1, Xcode 12.4, Carthage 0.36.1


paul@Pauls-Mac-mini nannup % xcodebuild -version
Xcode 12.4
Build version 12D4e
paul@Pauls-Mac-mini nannup % cat carthage.sh 
#!/usr/bin/env bash

# carthage.sh
# Usage example: ./carthage.sh build --platform iOS

set -euov pipefail

xcconfig=$(mktemp /tmp/static.xcconfig.XXXXXX)
trap 'rm -f "$xcconfig"' INT TERM HUP EXIT

# For Xcode 12 make sure EXCLUDED_ARCHS is set to arm architectures otherwise
# the build will fail on lipo due to duplicate architectures.
echo 'EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64__XCODE_1200 = arm64 arm64e armv7 armv7s armv6 armv8' >> $xcconfig
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

export XCODE_XCCONFIG_FILE="$xcconfig"
carthage "$@"


[carthage-xcodebuild.RiyKvN.log](https://github.com/CocoaLumberjack/CocoaLumberjack/files/5903186/carthage-xcodebuild.RiyKvN.log)
paul@Pauls-Mac-mini nannup % ./carthage.sh update SVGKit --platform iOS

xcconfig=$(mktemp /tmp/static.xcconfig.XXXXXX)
mktemp /tmp/static.xcconfig.XXXXXX
trap 'rm -f "$xcconfig"' INT TERM HUP EXIT

# For Xcode 12 make sure EXCLUDED_ARCHS is set to arm architectures otherwise
# the build will fail on lipo due to duplicate architectures.
echo 'EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64__XCODE_1200 = arm64 arm64e armv7 armv7s armv6 armv8' >> $xcconfig
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

export XCODE_XCCONFIG_FILE="$xcconfig"
carthage "$@"
*** Fetching SVGKit
*** Fetching Toaster
*** Fetching CocoaLumberjack
*** Checking out SVGKit at "2.1.0"
*** Checking out CocoaLumberjack at "3.7.0"
*** xcodebuild output can be found in /var/folders/gw/93qnhkwj56j8fhhxptfkg_3w0000gn/T/carthage-xcodebuild.RiyKvN.log
*** Building scheme "CocoaLumberjack" in Demos.xcworkspace
Build Failed
	Task failed with exit code 1:
	/usr/bin/xcrun lipo -create /Users/paul/Library/Caches/org.carthage.CarthageKit/DerivedData/12.4_12D4e/CocoaLumberjack/3.7.0/Build/Intermediates.noindex/ArchiveIntermediates/CocoaLumberjack/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/CocoaLumberjack.framework/CocoaLumberjack /Users/paul/Library/Caches/org.carthage.CarthageKit/DerivedData/12.4_12D4e/CocoaLumberjack/3.7.0/Build/Products/Release-iphonesimulator/CocoaLumberjack.framework/CocoaLumberjack -output /Users/paul/projects/nannup/Carthage/Build/iOS/CocoaLumberjack.framework/CocoaLumberjack

This usually indicates that project itself failed to compile. Please check the xcodebuild log for more details: /var/folders/gw/93qnhkwj56j8fhhxptfkg_3w0000gn/T/carthage-xcodebuild.RiyKvN.log
rm -f "$xcconfig"
paul@Pauls-Mac-mini nannup % 

The build xcodebuild log shows no errors. In fact at the bottom it says "** BUILD SUCCEEDED **".

The xcodebuild log does not show the lipo command that failed - that is, the lipo command printed on the console. I did run the command on the terminal - the output is below. Please see the error in the terminal capture below. I understand that this may be a nonsense error because the environment variable are not set when running lipo like this. But it is interesting.


paul@Pauls-Mac-mini nannup % /usr/bin/xcrun lipo -create /Users/paul/Library/Caches/org.carthage.CarthageKit/DerivedData/12.4_12D4e/CocoaLumberjack/3.7.0/Build/Intermediates.noindex/ArchiveIntermediates/CocoaLumberjack/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/CocoaLumberjack.framework/CocoaLumberjack /Users/paul/Library/Caches/org.carthage.CarthageKit/DerivedData/12.4_12D4e/CocoaLumberjack/3.7.0/Build/Products/Release-iphonesimulator/CocoaLumberjack.framework/CocoaLumberjack -output /Users/paul/projects/nannup/Carthage/Build/iOS/CocoaLumberjack.framework/CocoaLumberjack
fatal error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: /Users/paul/Library/Caches/org.carthage.CarthageKit/DerivedData/12.4_12D4e/CocoaLumberjack/3.7.0/Build/Intermediates.noindex/ArchiveIntermediates/CocoaLumberjack/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/CocoaLumberjack.framework/CocoaLumberjack and /Users/paul/Library/Caches/org.carthage.CarthageKit/DerivedData/12.4_12D4e/CocoaLumberjack/3.7.0/Build/Products/Release-iphonesimulator/CocoaLumberjack.framework/CocoaLumberjack have the same architectures (arm64) and can't be in the same fat output file

Anyway, my question: Can you see any reason why this lipo step may have failed, and what to do about it?

CocoaLumberjack/CocoaLumberjack

Answer questions stale[bot]

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this is still an issue, please make sure it is up to date and if so, add a comment that this is still an issue to keep it open. Thank you for your contributions.

useful!

Related questions

No questions were found.
source:https://uonfu.com/
Github User Rank List