realm / realm-swift

Realm is a mobile database: a replacement for Core Data & SQLite
https://realm.io
Apache License 2.0
16.34k stars 2.15k forks source link

Carthage build fails: Bitcode not enabled #5839

Closed marbetschar closed 6 years ago

marbetschar commented 6 years ago

Seeing the following error after running: $ carthage update --platform iOS --configuration Debug

 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch arm64 -dynamiclib -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.4.sdk -L/Users/username/Library/Caches/org.carthage.CarthageKit/DerivedData/9.4_9F1027a/realm-cocoa/v3.7.4/Build/Intermediates.noindex/ArchiveIntermediates/Realm/BuildProductsPath/Debug-iphoneos -Lcore -F/Users/username/Library/Caches/org.carthage.CarthageKit/DerivedData/9.4_9F1027a/realm-cocoa/v3.7.4/Build/Intermediates.noindex/ArchiveIntermediates/Realm/BuildProductsPath/Debug-iphoneos -filelist /Users/username/Library/Caches/org.carthage.CarthageKit/DerivedData/9.4_9F1027a/realm-cocoa/v3.7.4/Build/Intermediates.noindex/ArchiveIntermediates/Realm/IntermediateBuildFilesPath/Realm.build/Debug-iphoneos/Realm.build/Objects-normal/arm64/Realm.LinkFileList -install_name @rpath/Realm.framework/Realm -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -miphoneos-version-min=8.0 -dead_strip -Xlinker -object_path_lto -Xlinker /Users/username/Library/Caches/org.carthage.CarthageKit/DerivedData/9.4_9F1027a/realm-cocoa/v3.7.4/Build/Intermediates.noindex/ArchiveIntermediates/Realm/IntermediateBuildFilesPath/Realm.build/Debug-iphoneos/Realm.build/Objects-normal/arm64/Realm_lto.o -Xlinker -export_dynamic -Xlinker -no_deduplicate -fembed-bitcode -Xlinker -bitcode_verify -Xlinker -bitcode_hide_symbols -Xlinker -bitcode_symbol_map -Xlinker /Users/username/Library/Caches/org.carthage.CarthageKit/DerivedData/9.4_9F1027a/realm-cocoa/v3.7.4/Build/Intermediates.noindex/ArchiveIntermediates/Realm/BuildProductsPath/Debug-iphoneos -stdlib=libc++ -fapplication-extension -fobjc-arc -fobjc-link-runtime -lrealm-ios-dbg -lz -compatibility_version 1 -current_version 1 -Xlinker -dependency_info -Xlinker /Users/username/Library/Caches/org.carthage.CarthageKit/DerivedData/9.4_9F1027a/realm-cocoa/v3.7.4/Build/Intermediates.noindex/ArchiveIntermediates/Realm/IntermediateBuildFilesPath/Realm.build/Debug-iphoneos/Realm.build/Objects-normal/arm64/Realm_dependency_info.dat -o /Users/username/Library/Caches/org.carthage.CarthageKit/DerivedData/9.4_9F1027a/realm-cocoa/v3.7.4/Build/Intermediates.noindex/ArchiveIntermediates/Realm/IntermediateBuildFilesPath/Realm.build/Debug-iphoneos/Realm.build/Objects-normal/arm64/Realm
ld: bitcode bundle could not be generated because 'core/librealm-ios-dbg.a(bptree.o)' was built without full bitcode. All object files and libraries for bitcode must be generated from Xcode Archive or Install build for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

** ARCHIVE FAILED **
marbetschar commented 6 years ago

FWIW: Carthage seems to try to build the framework manually since the Swift version does not match as reported in https://github.com/realm/realm-cocoa/issues/5838 - this in turn seems to fail because a library does not contain bitcode.

tgoyne commented 6 years ago

The debug builds of the core library do not include bitcode because the bitcode is gigantic and dramatically increases the size of the download, and as you should never be shipping the debug version to the app store it is not used by anything. The simplest way to deal with this is to just ask for a release build of Realm.

marbetschar commented 6 years ago

thanks for the hint @tgoyne - started working now!