-
-
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
Building via Carthage with BUILD_LIBRARY_FOR_DISTRIBUTION = YES fails #4938
Comments
See my PR: #4912 |
@matopeto This PR does not fix the issue. After testing this out myself, I've determined that the problem originates from Algorithms and its lack of ABI stability. I've opened up a discussion on this in the Swift forums: https://forums.swift.org/t/should-algorithms-public-structs-be-frozen/60668 |
@djs-code the PR fix the issue, but you have to build the package with plain carthage without injecting BUILD_LIBRARY_FOR_DISTRIBUTION to the carthage (because it inject also for algorithm) but plain carthage for this PR is ok, result will be stable |
As far as I can tell, the two potentials paths forward are:
|
@matopeto Charts is not the only dependency we're pulling in, and as far as I can tell, Carthage doesn't support the granularity to choose where to enable and disable the flag. |
In my PR i turn the BUILD_LIBRARY_FOR_DISTRIBUTION for the charts and used @_implementationOnly for import Algorithms then I build the package with xcode 13 with plain carthage I am using this stable library in xcode 13 and 14 now without recompiling without problems |
@matopeto What about when the Cartfile also includes SnapKit, MarkdownKit, and/or SwiftOTP? We pull in these libraries via Carthage as well, and we need |
Yes this may be a problem. I have more dependencies too. I compile other dependencies with the script and this one without. Works for me. But I am caching resulting xcframeworks and recompile only when i need to update some dependency and I do not update very often, so this is not a problem for me. The script is workaround for dependencies without |
@matopeto That workflow is not going to be practical for most folks, and I would generally regard it as bad developer experience. Unforunately, I'm sad to say that #4912 is not a hollistic fix for this problem. As stated above, the root of the problem here is in the interplay with Algorithms. We can either update Algorithms directly, or remove it from Charts altogether. After perusing the Charts codebase a bit, the latter might be the more practical option, since Algorithms is only used in a small handful of spots. |
@pmairoldi Based on the PR history, it looks like you've been the most active maintainer here in recent times. Do you have any thoughts on this? |
Off the top of my head no. Do you absolutely need this setting? Does it work with it off? |
@pmairoldi We distribute a pre-built binary framework that depends on Charts (among other libraries), which we ask our users to pull in via Cocoapods or Carthage. Unfortunately, while our clients can choose between either package manager for Charts and the other dependencies, the build process for our framework is staunchly reliant on Carthage. The only other alternative here is for us to disable |
we are also using Charts in a Swift framework via Cocoapods. we have to turn on BUILD_LIBRARY_FOR_DISTRIBUTION. Chart is blocking us to use v4.* because of the SwiftAlgorithms dependency. without v4.1.0, we can't use Charts in Xcode 14. Please provide a solution. |
Closed by #4912 |
@pmairoldi #4912 Does not fix this issue, for the reasons described earlier in this thread. |
I haven't done any actual swift development in the last couple years. Just mostly doing maintenance here. @djs-code Do you have solution or update you could provide us? |
@djs-code the 5.0.0 branch DGCharts.framework now builds with BUILD_LIBRARY_FOR_DISTRIBUTION = YES, this can be close now? and both Demos works now. Could you check? We are trying to address left issues in milestone 5.0 |
#4951 |
Closed by #5069 |
What did you do?
Attempted to build Charts 4.1.0 via Carthage with
BUILD_LIBRARY_FOR_DISTRIBUTION
set toYES
. The following script was used:This script was invoked via:
./carthage.sh bootstrap --platform iOS --use-xcframeworks
What did you expect to happen?
Charts to build.
What happened instead?
The build failed, with errors stemming from the Swift Algorithms package.
Charts Environment
Charts version/Branch/Commit Number: 4.1.0
Xcode version: 14.0
Swift version: 5.7
Platform(s) running Charts: iOS 13 and above
macOS version running Xcode: macOS 12.5 and above
Demo Project
N/A (carthage.sh script above)
The text was updated successfully, but these errors were encountered: