Compile error with Xcode9.0 beta5 #156

Closed
opened 2025-12-29 15:25:51 +01:00 by adam · 12 comments
Owner

Originally created by @laeroah on GitHub (Aug 9, 2017).

Tried to compile CoreStore using xcode9.0 beta5 and got a compile error in file DataStack+Migration.swift: private func computeMigrationFromStorage<T: LocalStorage>(_ storage: T, metadata: [String: Any]) -> [(sourceModel: NSManagedObjectModel, destinationModel: NSManagedObjectModel, mappingModel: NSMappingModel, migrationType: MigrationType)]?

screen shot 2017-08-09 at 12 17 54 pm

A PR created: https://github.com/JohnEstropia/CoreStore/pull/185

Originally created by @laeroah on GitHub (Aug 9, 2017). Tried to compile CoreStore using xcode9.0 beta5 and got a compile error in file `DataStack+Migration.swift`: `private func computeMigrationFromStorage<T: LocalStorage>(_ storage: T, metadata: [String: Any]) -> [(sourceModel: NSManagedObjectModel, destinationModel: NSManagedObjectModel, mappingModel: NSMappingModel, migrationType: MigrationType)]?` ![screen shot 2017-08-09 at 12 17 54 pm](https://user-images.githubusercontent.com/1928509/29132209-7eced7f4-7cfd-11e7-8cb8-68786f4f9cc9.png) A PR created: https://github.com/JohnEstropia/CoreStore/pull/185
adam added the irreproducibleinvestigating labels 2025-12-29 15:25:51 +01:00
adam closed this issue 2025-12-29 15:25:51 +01:00
Author
Owner

@sidmani commented on GitHub (Aug 9, 2017):

I'm using the swift-4 branch and I don't get any compile errors on Xcode 9 beta 5. Which branch are you on?

@sidmani commented on GitHub (Aug 9, 2017): I'm using the swift-4 branch and I don't get any compile errors on Xcode 9 beta 5. Which branch are you on?
Author
Owner

@laeroah commented on GitHub (Aug 9, 2017):

hey @sidmani
I'm using prototype/Swift_4_0 branch. Which branch are you on?

@laeroah commented on GitHub (Aug 9, 2017): hey @sidmani I'm using `prototype/Swift_4_0` branch. Which branch are you on?
Author
Owner

@sidmani commented on GitHub (Aug 9, 2017):

@laeroah prototype/Swift_4_0 as well. I'm installing via cocoapods like so:
pod 'CoreStore', :git => 'https://github.com/JohnEstropia/CoreStore.git', :branch => 'prototype/Swift_4_0'

@sidmani commented on GitHub (Aug 9, 2017): @laeroah `prototype/Swift_4_0` as well. I'm installing via cocoapods like so: `pod 'CoreStore', :git => 'https://github.com/JohnEstropia/CoreStore.git', :branch => 'prototype/Swift_4_0'`
Author
Owner

@laeroah commented on GitHub (Aug 9, 2017):

yeah, that's exactly how I installed too. I just downloaded the CoreStore source code and it seems to be compiling fine. I guess the problem might be on my side. May I see your podfile please?

@laeroah commented on GitHub (Aug 9, 2017): yeah, that's exactly how I installed too. I just downloaded the CoreStore source code and it seems to be compiling fine. I guess the problem might be on my side. May I see your podfile please?
Author
Owner

@sidmani commented on GitHub (Aug 9, 2017):

That's the only relevant part- the rest is just other pods for my project. It doesn't have any other configuration (except use_frameworks!)

@sidmani commented on GitHub (Aug 9, 2017): That's the only relevant part- the rest is just other pods for my project. It doesn't have any other configuration (except `use_frameworks!`)
Author
Owner

@laeroah commented on GitHub (Aug 9, 2017):

so strange... I will spend some more time looking into this.
If i use 3_2 branch, there's no issue compiling.

@laeroah commented on GitHub (Aug 9, 2017): so strange... I will spend some more time looking into this. If i use 3_2 branch, there's no issue compiling.
Author
Owner

@JohnEstropia commented on GitHub (Aug 10, 2017):

@laeroah
That is weird. Looking at the PR, there must be something else going on as either code should work on both Swift 3.2 and 4.0.

Some hunches:

  • Do you have multiple Swift toolchains installed?
  • Do you have multiple Xcode versions open at the same time?
  • Do you reopen your project when git-switching between the 3.2 and 4.0 branches?
@JohnEstropia commented on GitHub (Aug 10, 2017): @laeroah That is weird. Looking at the PR, there must be something else going on as either code should work on both Swift 3.2 and 4.0. Some hunches: - Do you have multiple Swift toolchains installed? - Do you have multiple Xcode versions open at the same time? - Do you reopen your project when git-switching between the 3.2 and 4.0 branches?
Author
Owner

@JohnEstropia commented on GitHub (Aug 17, 2017):

@laeroah I think I found the cause for this error. Are you using the CoreStore Swift 4 branch and building it into your project as a Swift 3.2?
I reproduced this problem when I used the Swift 4 branch but my podfile includes:

post_install do |installer|
    installer.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
            config.build_settings['ENABLE_BITCODE'] = 'NO'
            config.build_settings['SWIFT_VERSION'] = '3.2'
        end
    end
end

which builds it as Swift 3.2.

@JohnEstropia commented on GitHub (Aug 17, 2017): @laeroah I think I found the cause for this error. Are you using the CoreStore Swift 4 branch and building it into your project as a Swift 3.2? I reproduced this problem when I used the Swift 4 branch but my podfile includes: ``` post_install do |installer| installer.pods_project.targets.each do |target| target.build_configurations.each do |config| config.build_settings['ENABLE_BITCODE'] = 'NO' config.build_settings['SWIFT_VERSION'] = '3.2' end end end ``` which builds it as Swift 3.2.
Author
Owner

@laeroah commented on GitHub (Aug 17, 2017):

hey, I didn't add config.build_settings['SWIFT_VERSION'] = '3.2' in my Podfile, but it is very possible that this is the cause. There's no issue if I start a new project and import CoreStore, so the problem must be on my side. I'm going to make sure Xcode is using swift4 instead of 3.2 and try it again.
Thank you for looking into it! much appreciated!

@laeroah commented on GitHub (Aug 17, 2017): hey, I didn't add config.build_settings['SWIFT_VERSION'] = '3.2' in my Podfile, but it is very possible that this is the cause. There's no issue if I start a new project and import CoreStore, so the problem must be on my side. I'm going to make sure Xcode is using swift4 instead of 3.2 and try it again. Thank you for looking into it! much appreciated!
Author
Owner

@JohnEstropia commented on GitHub (Aug 23, 2017):

@laeroah Have you confirmed the cause on your side? I have already resolved this on my side by adding a conditional check (something like if target == CoreStore, swift_version = 4), but I want to make sure first if this is the same cause as yours.

@JohnEstropia commented on GitHub (Aug 23, 2017): @laeroah Have you confirmed the cause on your side? I have already resolved this on my side by adding a conditional check (something like `if target == CoreStore, swift_version = 4`), but I want to make sure first if this is the same cause as yours.
Author
Owner

@laeroah commented on GitHub (Aug 23, 2017):

sry for delay. Yeah, I can confirm the issue is on my side. Thanks!

@laeroah commented on GitHub (Aug 23, 2017): sry for delay. Yeah, I can confirm the issue is on my side. Thanks!
Author
Owner

@ruslanskorb commented on GitHub (Aug 24, 2017):

@laeroah Please open Pods project in Xcode, select CoreStore target and check Swift Language Version. Which value is selected?

@ruslanskorb commented on GitHub (Aug 24, 2017): @laeroah Please open **Pods** project in Xcode, select **CoreStore** target and check **Swift Language Version**. Which value is selected?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/CoreStore#156