Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swift 4.0.3 compilation errors #18

Closed
alexandru-crossover opened this issue Jan 23, 2018 · 10 comments
Closed

Swift 4.0.3 compilation errors #18

alexandru-crossover opened this issue Jan 23, 2018 · 10 comments

Comments

@alexandru-crossover
Copy link

Hi,

The latest version, 3.0.4, does not compile when using Swift 4.0.3. I see that the compilation errors have already been fixed here, but they have not been released yet. Are there any plans for a 3.0.5 version that will include those fixes?

@jjatie
Copy link
Collaborator

jjatie commented Jan 23, 2018

@liuxuan30 I know you're busy, but would you have time to make sure it runs fine to release with Charts 3.1? If not, I will take care of it immediately after we release Charts 3.1 (first week of February)

@liuxuan30
Copy link
Collaborator

liuxuan30 commented Jan 24, 2018

It does compile with swift 4.0.3, if you build yourself, or from carthage, but it does not work with pod.
Be sure to include more information like which way you use.

The sole problem is that, Realm 3.1.0 saying its prebuilt framework supports 4.0.3, while it's not. So you have to use source code to build:

*** Downloading realm-cocoa.framework binary at "v3.1.0"
*** Skipped installing realm-cocoa.framework binary due to the error:
	"Incompatible Swift version - framework was built with 4.0.2 (swiftlang-900.0.69.2 clang-900.0.38) and the local version is 4.0.3 (swiftlang-900.0.74.1 clang-900.0.39.2)."
*** Checking out realm-cocoa at "v3.1.0"

@liuxuan30
Copy link
Collaborator

liuxuan30 commented Jan 24, 2018

Current carthage file use master branch to build from scratch, which takes a long time. So it's up to you.

You can learn when prebuilt 4.0.3 framework came out here: realm/realm-swift#5538

BTW, @alexandru-crossover are you using Realm or RealmSwift? I don't think RealmSwift works fine with ChartRealm, from my PR: #17

@alexandru-crossover
Copy link
Author

@liuxuan30 We are using CocoaPods and RealmSwift. We did not encounter any issues related to RealmSwift so far.

I'm not sure how RealmSwift is involved here. That compiles successfully right now. Are you saying that we first need a new version of RealmSwift and only then we'll have a new version of ChartsRealm?

@liuxuan30
Copy link
Collaborator

liuxuan30 commented Jan 25, 2018

OK so two things:

  1. How do you query your data and pass it to ChartRealm, in RealmSwift or Realm? I don't think current implementation supports RealmSwift. I'm interested how you uses ChartsRealm in your app.
  2. "That compiles successfully right now" can you explain?

@alexandru-crossover
Copy link
Author

@liuxuan30

  1. I'll get back to you on this. I need to check the code deeper.
  2. I mean that xcodebuild throws the following errors for ChartsRealm:
[16:49:25][Step 2/3] [08:49:25]: ▸ Compiling RealmBarDataSet.swift
[16:49:25][Step 2/3] [08:49:25]: ▸ ❌  /Volumes/ExtraDisk/TeamCity/buildAgent/work/ec8b670df1327810/Pods/ChartsRealm/ChartsRealm/Classes/Data/RealmBarDataSet.swift:204:29: cannot use mutating member on immutable value: 'iterator' is a 'let' constant
[16:49:25][Step 2/3] [08:49:25]: ▸ while let val = iterator.next()
[16:49:25][Step 2/3] [08:49:25]: ▸                             ^~~~~~~~
[16:49:25][Step 2/3] [08:49:25]: ▸ Compiling RealmBarLineScatterCandleBubbleDataSet.swift
[16:49:25][Step 2/3] [08:49:25]: ▸ Compiling RealmBaseDataSet.swift
[16:49:25][Step 2/3] [08:49:25]: ▸ ❌  /Volumes/ExtraDisk/TeamCity/buildAgent/work/ec8b670df1327810/Pods/ChartsRealm/ChartsRealm/Classes/Data/RealmBaseDataSet.swift:242:23: cannot use mutating member on immutable value: 'iterator' is a 'let' constant
[16:49:25][Step 2/3] [08:49:25]: ▸ while let e = iterator.next()

There are no such errors for RealmSwift.

@liuxuan30
Copy link
Collaborator

liuxuan30 commented Jan 26, 2018

ok, thanks.
for .1, please just let me know how you fetch the data, and pass them to ChartsRealm. I need code level details, but you can hide your information.
for .2, let e = iterator.next() works fine on my side, with master branch and realm-cocoa master branch, on Swift 4.0.3

@alexandru-crossover
Copy link
Author

alexandru-crossover commented Jan 26, 2018

@liuxuan30 Yes, that works on the master branch, which was fixed here, but not with the latest CocoaPods version, 3.0.4, which does not contain that fix.

For now, as a workaround, we reverted to 3.0.3, which compiles successfully on Swift 4.0.3

@liuxuan30
Copy link
Collaborator

liuxuan30 commented Jan 29, 2018

I see so you use pod here. I tried to push to pod, however always compile issues, while carthage works fine.

I'm no pod expert, you can try make a PR to fix it and I could merge. Or wait Realm release a prebuilt framework for 4.0.3, and I can try with pod again.

@liuxuan30
Copy link
Collaborator

pod has been bumped to 3.0.5 with latest Xcode fashion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants