realm-swift: RealmSwift Does not build from source with Xcode 10.2 as Swift 3 support has been dropped.
Goals
Build RealmCocoa (Realm and RealmSwift) from source with Xcode 10.2 (no longer in beta as of 26th March 2019)
Expected Results
Expected Realm to build from source.
Actual Results
The build fails, because Swift 3 support has been dropped from the Swift compiler included with Xcode 10.2.
/usr/bin/xcrun xcodebuild -workspace /Users/james/dev/MyApp/Carthage/Checkouts/realm-cocoa/Carthage/Realm.xcworkspace -scheme RealmSwift -configuration Release -derivedDataPath /Users/james/Library/Caches/org.carthage.CarthageKit/DerivedData/10.2_10E125/realm-cocoa/v3.13.1 -sdk iphoneos ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES archive -archivePath /var/folders/89/zl8dhxjd64v9j1rrwhhpvbf80000gn/T/realm-cocoa SKIP_INSTALL=YES GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=NO CLANG_ENABLE_CODE_COVERAGE=NO STRIP_INSTALLED_PRODUCT=NO (launched in /Users/james/dev/MyApp/Carthage/Checkouts/realm-cocoa)User defaults from command line:
IDEArchivePathOverride = /var/folders/89/zl8dhxjd64v9j1rrwhhpvbf80000gn/T/realm-cocoa
IDEDerivedDataPathOverride = /Users/james/Library/Caches/org.carthage.CarthageKit/DerivedData/10.2_10E125/realm-cocoa/v3.13.1
Build settings from command line:
CARTHAGE = YES
CLANG_ENABLE_CODE_COVERAGE = NO
CODE_SIGN_IDENTITY =
CODE_SIGNING_REQUIRED = NO
GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = NO
ONLY_ACTIVE_ARCH = NO
SDKROOT = iphoneos12.2
SKIP_INSTALL = YES
STRIP_INSTALLED_PRODUCT = NO
note: Using new build system
note: Planning build
note: Constructing build description
Build system information
error: SWIFT_VERSION '3.0' is unsupported, supported versions are: 4.0, 4.2, 5.0. (in target 'RealmSwift')
Build system information
error: SWIFT_VERSION '3.0' is unsupported, supported versions are: 4.0, 4.2, 5.0. (in target 'RealmSwift')
Steps to Reproduce
Attempt to build Realm from source using the command line tools included with Xcode 10.2
Version of Realm and Tooling
Realm framework version: 3.13.1 Xcode version: 10.2 iOS/OSX version: macOS 10.14.3, iOS 12.2
Dependency manager + version: Carthage 0.32.0
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 38
- Comments: 20 (1 by maintainers)
Waiting eagerly for a stable release.
It builds for me (carthage from master) but when building the project i get an error for each class which inherits from Object.
So the exact error message is:
Does anybody else have this kind of problem?
Thank you for the suggestion, unfortunately the error still remains. I guess the difference is, that you are using Realm directly in your MainTarget where i use it in a framework.
Reminds me somehow of: https://github.com/realm/realm-cocoa/issues/3073
Update: So if i set “Install Objective-C Compability Header” to “No” in the Build Settings of my Framework-Target it builds.
But so far i can’t estimate the impacts of that setting. 😃
Update2:
Migration to Swift5 does not work for me. But Xcode 10.2 does at least.
😄
3.14 doesn’t build for me with the Swift 5 compiler. It segfaults trying to build
LinkingObjects.swift. (3.13 failed in the same way)Let me know if this isn’t the same issue, and I’ll open a new one.
Here’s the stack trace:
@samueleperricone No, it is not working as expected. It compiles but it is buggy, because of some missing internal linking . Also, Simulator code compile breaks as well. Xcode 10.2 uses Swift 5 compiler and even by using Swift 4.2, you still need to compile it with swift compiler 5 to be able to use the framework.
Realm on Xcode 10.2, (Swift 5 compiler) , even by Swift 4.2 currently impossible. Yes, I have it working on a real Device, but Some parts still fails.
The other issue is the Realm Static files which are also not aligned and optimized for Swift 5 compilation
Hey @tgoyne,
here is a quick example app.
Steps to reproduce:
carthage update --platform iosWhen you set “Install Objective-C Compability Header” to “No” (logic target) you are able to build the app, but migration to Swift 5 fails.
Thank you for your effort good Sir!
TestApp.zip