-
-
Notifications
You must be signed in to change notification settings - Fork 6k
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
Fix Swift Package Manager compile issue #4017
Fix Swift Package Manager compile issue #4017
Conversation
@liuxuan30 Could you help to review this? |
Hmm this seems caused by Xcode 11 beta? @rynecheow any documentation or reason, about this behavior, that it's expected for Xcode 11, or new Swift version? Because given the history dealing with swift or xcode upgrade, I have seen the similar changes about this import back and forth. At first adding the import, than delete it, and add it back again. What I'm concerning is this might be a bug for Xcode 11 beta, not us. Any idea @jjatie ? I could also prefer holding this PR until Xcode 11 GM is released. But, for anyone testing Xcode 11 or iOS13, we could create a branch for it, and you can commit your PR to this branch. Is this ok for you? |
Hey @liuxuan30 I just ran a deeper test using current stable tools (Swift 5.0 toolchain and Xcode 10.2.1) and build has failed as well. Updated the issue to reflect more accurate problem. Basically |
@rynecheow it's strange, our CI and my Xcode 10.2.1 works just well. |
@liuxuan30 Currently CI is not building the SPM package according build script / build log I believe. |
This shouldn't be worked on until later this summer. We are only on beta 1 and things are subject to change (especially where all the SPM stuff was developed in private). I noticed the toolchain wasn't bumped in this PR |
@rynecheow I kind of understand what you mean now. if this is about fixing 'Swift Package Manager' compiling - which is rarely used by me or other people so far (you are the first one reporting this), I would like to know or maybe send a bug to APPL first to figure out why only this It's kind of inconsistent, as SPM fails to find the framework while xcodebuild can handle it? |
@rynecheow The current toolchain doesn't support iOS. I'm not sure how we could fix it without migrating to the new toolchain. |
Why was Package.swift not updated to the 5.0 toolchain? |
Fix Swift Package Manager compile issue ChartsOrg#4017
Chiming in here - I think that we should commit this. Reason being, things are being used when they're not explicitly imported. I haven't looked into why this works when compiling using the Xcode project, but just take a look at this:
How can we be extending |
Just want to note that Xcode 11 GM is out and Swift PM still fails to compile the project without these imports. I don't know if this PR is the "right" fix, but it does make it usable via SwiftPM. |
@liuxuan30 Also confirming this issue still occurs in SwiftPM on the Gold Master of Xcode11. |
Also, the Package.swift specifies:
While the docs specify it is best to leave it nil and let SwiftPM decide. Is there any reason to force .dynamic? Dynamic libraries impact app boot times on iOS. |
@jjoelson can you check what @RamblinWreck77 said? I'm open to merge this, if the final compiler takes it this way. |
#4118 |
Signed-off-by: Ryne Cheow <rynecheow@gmail.com>
@liuxuan30 The SwiftPM docs do say to leave
But then there's also an example that has separate products for static and dynamic, so it's a bit confusing:
|
there is no reason to only use dynamic, but by default, this "library" is built as framework, so I guess that's why it's dynamic. I think we should be fine with nil type, as long as SPM has no bugs handling it. @rynecheow can you also check what #4118 did for
I'm not sure the impact about this, as I'm not following SPM trend now. Besides, I will be grateful if you could modify the type to nil as discussed above, so I don't have to pull your branch. Thanks. |
.gitignore
Outdated
@@ -72,3 +72,4 @@ fastlane/test_output | |||
Carthage | |||
Charts.framework.zip | |||
ChartsRealm.framework.zip | |||
.swiftpm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.swiftpm
or .swiftpm/
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rightfully .swiftpm/
- let me change that. Did .swiftpm
cause it does the trick.
Signed-off-by: Ryne Cheow <rynecheow@gmail.com>
Signed-off-by: Ryne Cheow <rynecheow@gmail.com>
|
Seems green light now. BTW, do you think we need to add script code for travis to build via SPM? Just to build it to make sure it builds fine, No UT is needed. Or will it be fine with the config file, as long as Xcode build, it won't fail for SPM? Because currently it looks the opposite way. Ideally we could have a separate SPM item for travis, let's say Otherwise I will merge next Monday. |
A second thought we should just go ahead, if you think travis ci is needed, let's add later. Not surehowpopular spm can be |
Signed-off-by: Ryne Cheow rynecheow@gmail.com
Issue Link π
#4016
Goals β½
swift build
Implementation Details π§
Resolve dependencies for correct platform
Testing Details π
Compile for all platforms using Swift 5.0 toolchain