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

[Feature request] Release 3.6.1 version supporting Swift 5.7 (Xcode 14) #5001

Closed
1 task done
corteggo opened this issue Jan 11, 2023 · 8 comments
Closed
1 task done
Assignees

Comments

@corteggo
Copy link

corteggo commented Jan 11, 2023

Feature request with code provided below

What did you do?

I need to update a project to build with Xcode 14, so I tried Charts 3.6.0 and Charts 4.1.0 (the latest available versions when creating this issue) with Xcode 14.1 and Xcode 14.2.

This project is an SDK distributed to third parties so it has BUILD_LIBRARY_FOR_DISTRIBUTION = YES (which infers it for dependencies like Charts).

What did you expect to happen?

Either Charts 3.6.0 or Charts 4.1.0 would work with Xcode 14.1 or 14.2 having BUILD_LIBRARY_FOR_DISTRIBUTION set to YES.

What happened instead?

Charts 3.6.0 failed with build errors due to ChartDataSet not conforming to RangeReplaceableDataSet.
Charts 4.1.0 failed with build errors due to transitive dependency SwiftAlgorithms not building with BUILD_LIBRARY_FOR_DISTRIBUTION set to YES (missing some @frozen attributes).

Charts Environment

Charts version/Branch/Commit Number:
Charts 3.6.0
Charts 4.1.0

Xcode version:
Xcode 14.1
Xcode 14.2

Swift version:
Swift 5.7

Platform(s) running Charts:
iOS

macOS version running Xcode:
macOS 12

Demo Project

Unnecessary. The Charts repo itself can be used as a demo project.

Related Issues

Related Pull Requests

Solution

Currently, there's no possible way to use Charts with Xcode 14 with BUILD_LIBRARY_FOR_DISTRIBUTION set to YES. This is a blocking issue for those creating libraries. Setting BUILD_LIBRARY_FOR_DISTRIBUTION to NO is not an option.

To fix the build issue with Charts 4.1.0 having BUILD_LIBRARY_FOR_DISTRIBUTION set to YES, SwiftAlgorithms requires some changes to add @frozen to all its struct definitions. However, according to swiftlang/swift#62507, the build errors seem to be intentional so I don't think a pull request would be merged in there and it could take some time. Also, after merging, it would require SwiftAlgorithms custom podspec (https://github.com/jshier/swift-pods/blob/main/SwiftAlgorithms.podspec) to be versioned and a new Charts version to be released.

Fixing the build issue with Charts 3.6.0 is easier. Conforming ChartDataSet to RangeReplaceableCollection is as easy as adding one method (as was already done in this repo for Charts 4.x).

I forked this repository and released version 3.6.1 working fine with Xcode 14.1 and 14.2. Please find it here: https://github.com/corteggo/Charts/releases/tag/v3.6.1. However, I can't open a pull request to any of the existing branches in this repo because master already contains 4.x.x and there're no 3.x.x release branches.

I'd kindly ask maintainers to move the 3.6.1 tag from my fork to this repo, release 3.6.1 officially and push the updated Charts.podspec file to the public podspec repo.

With this proposed solution, users can still use 3.6.x with the latest Xcode available if they're building a library. Users building regular applications can use 4.x.

@corteggo
Copy link
Author

corteggo commented Jan 23, 2023

@danielgindi @liuxuan30 @pmairoldi is there anything else I can do to help in order to have https://github.com/corteggo/Charts/releases/tag/v3.6.1 moved into this repo? If so, please let me know and I'll do it

This is the required change: corteggo@ed5f554

Thanks for all your effort and your great contribution to the iOS community by building Charts

@liuxuan30
Copy link
Member

liuxuan30 commented Mar 2, 2023

@corteggo sorry I cannot look at every issue every day.
Regarding your issue, we are renaming this framework following #5009, once it's get merged, you should have a build that work on Xcode 14.

however,

Charts 3.6.0 failed with build errors due to ChartDataSet not conforming to RangeReplaceableDataSet.
Charts 4.1.0 failed with build errors due to transitive dependency SwiftAlgorithms not building with BUILD_LIBRARY_FOR_DISTRIBUTION set to YES (missing some @Frozen attributes).

this seems something we cannot help because the legacy is not maintained any more. We quite lack of people to maintain different releases.

Since the are multiple PRs, I would prefer fix them all in one PR. Could you pull these together once we merge #5009 and make a new PR, then we can move forward? The target is make new 4.x release work on Xcode 14, and perhaps solve your problem, but for 3.x releases, IMO you can keep it in your own repo.

@liuxuan30 liuxuan30 self-assigned this Mar 2, 2023
@corteggo
Copy link
Author

corteggo commented Mar 2, 2023

@liuxuan30 thank you for your answer. We'll keep 3.6.1 in our own repo then.

To make 4.x compatible with Xcode 14 when BUILD_LIBRARY_FOR_DISTRIBUTION is set to YES the easiest way would be to remove the SwiftAlgorithms dependency, so basically to revert #4497. I don't think adding @frozen to the structs that are missing them would be accepted on the swift-algorithms repository based on a similar issue on swiftlang/swift#62507. Also Charts is using a third-party podspec for that repository so... I don't think it's a good idea to keep it as a dependency.

I'll work on it if it's fine with you and will get back to you here once I have a pull request ready for it. Thank you for your input.

@corteggo corteggo closed this as completed Mar 2, 2023
@liuxuan30
Copy link
Member

removing swift-algorithms sounds unrealistic since it's making coder cleaner. It's sad to see the swift is still having compatibility ackward regarding BUILD_LIBRARY_FOR_DISTRIBUTION.

@corteggo
Copy link
Author

corteggo commented Mar 3, 2023

removing swift-algorithms sounds unrealistic since it's making coder cleaner. It's sad to see the swift is still having compatibility ackward regarding BUILD_LIBRARY_FOR_DISTRIBUTION.

What would you do to address this issue then? Any other idea or suggestion that could work?

Because having swift-algorithms is causing DGCharts not to offer ABI stability right now. I'm unsure if it's worth it to make the code cleaner. Sticking with a forked 3.x version might work for now but cannot be a long-term plan

I can help to work on this and contribute to the repo but if 3.x is not maintained anymore and swift-algorithms removal might not be accepted I don't see what else I could do to have this fixed 😢

@liuxuan30
Copy link
Member

liuxuan30 commented Apr 23, 2023

removing swift-algorithms sounds unrealistic since it's making coder cleaner. It's sad to see the swift is still having compatibility ackward regarding BUILD_LIBRARY_FOR_DISTRIBUTION.

What would you do to address this issue then? Any other idea or suggestion that could work?

Because having swift-algorithms is causing DGCharts not to offer ABI stability right now. I'm unsure if it's worth it to make the code cleaner. Sticking with a forked 3.x version might work for now but cannot be a long-term plan

I can help to work on this and contribute to the repo but if 3.x is not maintained anymore and swift-algorithms removal might not be accepted I don't see what else I could do to have this fixed 😢

the problem is not 100% on us.. We tried our best to make it compatible and follow the trend of swift. When we adopted swift-algorithms for good, we think it's the future, however, we cannot forcase that today we see issues caused by it. We try to solve this, but Apple is not replying at all.

Currently, the problem is not swift-algorithms itself, it's the swift 5.7 that fail to build for our Objective-C demo.

If everyone is totally ok with removing Objective-C demo support, we are ok too. However, we still treat Objc as a must-support. So we stuck on making the demo work.

I filed radar and asked help on swift foum(https://forums.swift.org/t/bug-report-unable-to-build-demo-project-if-imported-swift-framework-turned-on-build-library-for-distribution/63904/3), no update all.

If you could help solve this build issue, we are reaching a release date.

@corteggo
Copy link
Author

corteggo commented May 3, 2023

the problem is not 100% on us.. We tried our best to make it compatible and follow the trend of swift. When we adopted swift-algorithms for good, we think it's the future, however, we cannot forcase that today we see issues caused by it. We try to solve this, but Apple is not replying at all.

Currently, the problem is not swift-algorithms itself, it's the swift 5.7 that fail to build for our Objective-C demo.

If everyone is totally ok with removing Objective-C demo support, we are ok too. However, we still treat Objc as a must-support. So we stuck on making the demo work.

I filed radar and asked help on swift foum(https://forums.swift.org/t/bug-report-unable-to-build-demo-project-if-imported-swift-framework-turned-on-build-library-for-distribution/63904/3), no update all.

If you could help solve this build issue, we are reaching a release date.

@liuxuan30

Sorry, I can't help with the Obj-C issue. I saw your post in Swift forums but don't know how to help. From my point of view, it can be a known issue for the 5.0.0 release, at least to provide a fix for naming conflict with Swift Charts.

Going back to the original topic, I tried release/5.0.0 with BUILD_LIBRARY_FOR_DISTRIBUTION set to YES and I got the same errors though:

\e[31m❌  \e[0m/Users/corteggo/Projects/CONFIDENTIAL/Pods/SwiftAlgorithms/Sources/Algorithms/Chunked.swift:351:12: \e[31m'let' property 'baseRange' may not be initialized directly; use "self.init(...)" or "self = ..." instead\e[0m

      self.baseRange = _baseRange
\e[36m               ^\e[0m

\e[31m❌  \e[0m/Users/corteggo/Projects/CONFIDENTIAL/Pods/SwiftAlgorithms/Sources/Algorithms/Combinations.swift:50:10: \e[31m'let' property 'base' may not be initialized directly; use "self.init(...)" or "self = ..." instead\e[0m

    self.base = base
\e[36m                 ^\e[0m

\e[31m❌  \e[0m/Users/corteggo/Projects/CONFIDENTIAL/Pods/SwiftAlgorithms/Sources/Algorithms/Combinations.swift:52:10: \e[31m'let' property 'baseCount' may not be initialized directly; use "self.init(...)" or "self = ..." instead\e[0m

    self.baseCount = baseCount
\e[36m               ^\e[0m

\e[31m❌  \e[0m/Users/corteggo/Projects/CONFIDENTIAL/Pods/SwiftAlgorithms/Sources/Algorithms/Combinations.swift:54:10: \e[31m'let' property 'kRange' may not be initialized directly; use "self.init(...)" or "self = ..." instead\e[0m

    self.kRange = range.lowerBound < upperBound
\e[36m               ^\e[0m

\e[31m❌  \e[0m/Users/corteggo/Projects/CONFIDENTIAL/Pods/SwiftAlgorithms/Sources/Algorithms/Combinations.swift:108:12: \e[31m'let' property 'base' may not be initialized directly; use "self.init(...)" or "self = ..." instead\e[0m

      self.base = combinations.base
\e[36m               ^\e[0m

\e[31m❌  \e[0m/Users/corteggo/Projects/CONFIDENTIAL/Pods/SwiftAlgorithms/Sources/Algorithms/Compacted.swift:22:10: \e[31m'let' property 'base' may not be initialized directly; use "self.init(...)" or "self = ..." instead\e[0m

    self.base = base
\e[36m                 ^\e[0m

\e[31m❌  \e[0m/Users/corteggo/Projects/CONFIDENTIAL/Pods/SwiftAlgorithms/Sources/Algorithms/Compacted.swift:86:10: \e[31m'let' property 'base' may not be initialized directly; use "self.init(...)" or "self = ..." instead\e[0m

    self.base = base
\e[36m      ^\e[0m

\e[31m❌  \e[0m/Users/corteggo/Projects/CONFIDENTIAL/Pods/SwiftAlgorithms/Sources/Algorithms/Compacted.swift:97:12: \e[31m'let' property 'base' may not be initialized directly; use "self.init(...)" or "self = ..." instead\e[0m

      self.base = base
\e[36m      ^\e[0m

\e[31m❌  \e[0m/Users/corteggo/Projects/CONFIDENTIAL/Pods/SwiftAlgorithms/Sources/Algorithms/Cycle.swift:20:10: \e[31m'let' property 'base' may not be initialized directly; use "self.init(...)" or "self = ..." instead\e[0m

    self.base = base
\e[36m        ^\e[0m

\e[31m❌  \e[0m/Users/corteggo/Projects/CONFIDENTIAL/Pods/SwiftAlgorithms/Sources/Algorithms/Cycle.swift:35:12: \e[31m'let' property 'base' may not be initialized directly; use "self.init(...)" or "self = ..." instead\e[0m

      self.base = base
\e[36m               ^\e[0m

\e[31m❌  \e[0m/Users/corteggo/Projects/CONFIDENTIAL/Pods/SwiftAlgorithms/Sources/Algorithms/Cycle.swift:70:10: \e[31m'let' property 'product' may not be initialized directly; use "self.init(...)" or "self = ..." instead\e[0m

    self.product = Product2Sequence(0..<times, base)
\e[36m                 ^\e[0m

\e[31m❌  \e[0m/Users/corteggo/Projects/CONFIDENTIAL/Pods/SwiftAlgorithms/Sources/Algorithms/Cycle.swift:85:12: \e[31m'let' property 'productIndex' may not be initialized directly; use "self.init(...)" or "self = ..." instead\e[0m

      self.productIndex = productIndex
\e[36m               ^\e[0m

\e[31m❌  \e[0m/Users/corteggo/Projects/CONFIDENTIAL/Pods/SwiftAlgorithms/Sources/Algorithms/FlattenCollection.swift:26:10: \e[31m'let' property 'base' may not be initialized directly; use "self.init(...)" or "self = ..." instead\e[0m

    self.base = base
\e[36m                 ^\e[0m

\e[31m❌  \e[0m/Users/corteggo/Projects/CONFIDENTIAL/Pods/SwiftAlgorithms/Sources/Algorithms/FlattenCollection.swift:27:10: \e[31m'let' property 'indexOfFirstNonEmptyElement' may not be initialized directly; use "self.init(...)" or "self = ..." instead\e[0m

    self.indexOfFirstNonEmptyElement = base.endOfPrefix(while: { $0.isEmpty })
\e[36m               ^\e[0m

\e[31m❌  \e[0m/Users/corteggo/Projects/CONFIDENTIAL/Pods/SwiftAlgorithms/Sources/Algorithms/FlattenCollection.swift:42:12: \e[31m'let' property 'outer' may not be initialized directly; use "self.init(...)" or "self = ..." instead\e[0m

      self.outer = outer
\e[36m               ^\e[0m

\e[31m❌  \e[0m/Users/corteggo/Projects/CONFIDENTIAL/Pods/SwiftAlgorithms/Sources/Algorithms/FlattenCollection.swift:43:12: \e[31m'let' property 'inner' may not be initialized directly; use "self.init(...)" or "self = ..." instead\e[0m

      self.inner = inner
\e[36m                 ^\e[0m

\e[31m❌  \e[0m/Users/corteggo/Projects/CONFIDENTIAL/Pods/SwiftAlgorithms/Sources/Algorithms/Indexed.swift:21:10: \e[31m'let' property 'base' may not be initialized directly; use "self.init(...)" or "self = ..." instead\e[0m

    self.base = base
\e[36m                 ^\e[0m

\e[31m❌  \e[0m/Users/corteggo/Projects/CONFIDENTIAL/Pods/SwiftAlgorithms/Sources/Algorithms/Intersperse.swift:27:10: \e[31m'let' property 'base' may not be initialized directly; use "self.init(...)" or "self = ..." instead\e[0m

    self.base = base
\e[36m               ^\e[0m

\e[31m❌  \e[0m/Users/corteggo/Projects/CONFIDENTIAL/Pods/SwiftAlgorithms/Sources/Algorithms/Intersperse.swift:28:10: \e[31m'let' property 'separator' may not be initialized directly; use "self.init(...)" or "self = ..." instead\e[0m

    self.separator = separator
\e[36m               ^\e[0m

\e[31m❌  \e[0m/Users/corteggo/Projects/CONFIDENTIAL/Pods/SwiftAlgorithms/Sources/Algorithms/Intersperse.swift:54:12: \e[31m'let' property 'separator' may not be initialized directly; use "self.init(...)" or "self = ..." instead\e[0m

      self.separator = separator
\e[36m               ^\e[0m

\e[31m❌  \e[0m/Users/corteggo/Projects/CONFIDENTIAL/Pods/SwiftAlgorithms/Sources/Algorithms/Intersperse.swift:98:12: \e[31m'let' property 'representation' may not be initialized directly; use "self.init(...)" or "self = ..." instead\e[0m

      self.representation = representation
\e[36m                 ^\e[0m

\e[31m❌  \e[0m/Users/corteggo/Projects/CONFIDENTIAL/Pods/SwiftAlgorithms/Sources/Algorithms/Intersperse.swift:332:12: \e[31m'let' property 'transform' may not be initialized directly; use "self.init(...)" or "self = ..." instead\e[0m

      self.transform = transform
\e[36m                 ^\e[0m

\e[31m❌  \e[0m/Users/corteggo/Projects/CONFIDENTIAL/Pods/SwiftAlgorithms/Sources/Algorithms/Intersperse.swift:333:12: \e[31m'let' property 'separator' may not be initialized directly; use "self.init(...)" or "self = ..." instead\e[0m

      self.separator = separator
\e[36m                 ^\e[0m

\e[31m❌  \e[0m/Users/corteggo/Projects/CONFIDENTIAL/Pods/SwiftAlgorithms/Sources/Algorithms/Intersperse.swift:377:12: \e[31m'let' property 'representation' may not be initialized directly; use "self.init(...)" or "self = ..." instead\e[0m

      self.representation = representation
\e[36m                 ^\e[0m

\e[31m❌  \e[0m/Users/corteggo/Projects/CONFIDENTIAL/Pods/SwiftAlgorithms/Sources/Algorithms/Joined.swift:30:10: \e[31m'let' property 'inner' may not be initialized directly; use "self.init(...)" or "self = ..." instead\e[0m

    self.inner = base.lazy
\e[36m                 ^\e[0m

\e[31m❌  \e[0m/Users/corteggo/Projects/CONFIDENTIAL/Pods/SwiftAlgorithms/Sources/Algorithms/Joined.swift:84:10: \e[31m'let' property 'inner' may not be initialized directly; use "self.init(...)" or "self = ..." instead\e[0m

    self.inner = base.lazy
\e[36m               ^\e[0m

\e[31m❌  \e[0m/Users/corteggo/Projects/CONFIDENTIAL/Pods/SwiftAlgorithms/Sources/Algorithms/Joined.swift:134:10: \e[31m'let' property 'inner' may not be initialized directly; use "self.init(...)" or "self = ..." instead\e[0m

    self.inner = base.lazy
\e[36m               ^\e[0m

\e[31m❌  \e[0m/Users/corteggo/Projects/CONFIDENTIAL/Pods/SwiftAlgorithms/Sources/Algorithms/Joined.swift:148:12: \e[31m'let' property 'inner' may not be initialized directly; use "self.init(...)" or "self = ..." instead\e[0m

      self.inner = inner
\e[36m               ^\e[0m

\e[31m❌  \e[0m/Users/corteggo/Projects/CONFIDENTIAL/Pods/SwiftAlgorithms/Sources/Algorithms/Joined.swift:239:10: \e[31m'let' property 'inner' may not be initialized directly; use "self.init(...)" or "self = ..." instead\e[0m

    self.inner = base.lazy
\e[36m                 ^\e[0m

\e[31m❌  \e[0m/Users/corteggo/Projects/CONFIDENTIAL/Pods/SwiftAlgorithms/Sources/Algorithms/Joined.swift:254:12: \e[31m'let' property 'inner' may not be initialized directly; use "self.init(...)" or "self = ..." instead\e[0m

      self.inner = inner
\e[36m               ^\e[0m

\e[31m❌  \e[0m/Users/corteggo/Projects/CONFIDENTIAL/Pods/SwiftAlgorithms/Sources/Algorithms/Permutations.swift:123:10: \e[31m'let' property 'base' may not be initialized directly; use "self.init(...)" or "self = ..." instead\e[0m

    self.base = base
\e[36m                 ^\e[0m

\e[31m❌  \e[0m/Users/corteggo/Projects/CONFIDENTIAL/Pods/SwiftAlgorithms/Sources/Algorithms/Permutations.swift:125:10: \e[31m'let' property 'baseCount' may not be initialized directly; use "self.init(...)" or "self = ..." instead\e[0m

    self.baseCount = baseCount
\e[36m               ^\e[0m

\e[31m❌  \e[0m/Users/corteggo/Projects/CONFIDENTIAL/Pods/SwiftAlgorithms/Sources/Algorithms/Permutations.swift:127:10: \e[31m'let' property 'kRange' may not be initialized directly; use "self.init(...)" or "self = ..." instead\e[0m

    self.kRange = kRange?.relative(to: 0 ..< .max)
\e[36m               ^\e[0m

\e[31m❌  \e[0m/Users/corteggo/Projects/CONFIDENTIAL/Pods/SwiftAlgorithms/Sources/Algorithms/Permutations.swift:168:12: \e[31m'let' property 'base' may not be initialized directly; use "self.init(...)" or "self = ..." instead\e[0m

      self.base = permutations.base
\e[36m               ^\e[0m

\e[31m❌  \e[0m/Users/corteggo/Projects/CONFIDENTIAL/Pods/SwiftAlgorithms/Sources/Algorithms/Permutations.swift:169:12: \e[31m'let' property 'baseCount' may not be initialized directly; use "self.init(...)" or "self = ..." instead\e[0m

      self.baseCount = permutations.baseCount
\e[36m                 ^\e[0m

\e[31m❌  \e[0m/Users/corteggo/Projects/CONFIDENTIAL/Pods/SwiftAlgorithms/Sources/Algorithms/Permutations.swift:431:10: \e[31m'let' property 'base' may not be initialized directly; use "self.init(...)" or "self = ..." instead\e[0m

    self.base = elements
\e[36m                 ^\e[0m

\e[31m❌  \e[0m/Users/corteggo/Projects/CONFIDENTIAL/Pods/SwiftAlgorithms/Sources/Algorithms/Permutations.swift:432:10: \e[31m'let' property 'kRange' may not be initialized directly; use "self.init(...)" or "self = ..." instead\e[0m

    self.kRange = self.indexes.count ..< (self.indexes.count + 1)
\e[36m               ^\e[0m

\e[31m❌  \e[0m/Users/corteggo/Projects/CONFIDENTIAL/Pods/SwiftAlgorithms/Sources/Algorithms/Permutations.swift:440:10: \e[31m'let' property 'base' may not be initialized directly; use "self.init(...)" or "self = ..." instead\e[0m

    self.base = base
\e[36m               ^\e[0m

\e[31m❌  \e[0m/Users/corteggo/Projects/CONFIDENTIAL/Pods/SwiftAlgorithms/Sources/Algorithms/Permutations.swift:443:10: \e[31m'let' property 'kRange' may not be initialized directly; use "self.init(...)" or "self = ..." instead\e[0m

    self.kRange = range.relative(to: 0 ..< .max)
\e[36m               ^\e[0m

\e[31m❌  \e[0m/Users/corteggo/Projects/CONFIDENTIAL/Pods/SwiftAlgorithms/Sources/Algorithms/Permutations.swift:465:12: \e[31m'let' property 'base' may not be initialized directly; use "self.init(...)" or "self = ..." instead\e[0m

      self.base = elements
\e[36m               ^\e[0m

\e[31m❌  \e[0m/Users/corteggo/Projects/CONFIDENTIAL/Pods/SwiftAlgorithms/Sources/Algorithms/Product.swift:24:10: \e[31m'let' property 'base1' may not be initialized directly; use "self.init(...)" or "self = ..." instead\e[0m

    self.base1 = base1
\e[36m                 ^\e[0m

\e[31m❌  \e[0m/Users/corteggo/Projects/CONFIDENTIAL/Pods/SwiftAlgorithms/Sources/Algorithms/Product.swift:25:10: \e[31m'let' property 'base2' may not be initialized directly; use "self.init(...)" or "self = ..." instead\e[0m

    self.base2 = base2
\e[36m               ^\e[0m

\e[31m❌  \e[0m/Users/corteggo/Projects/CONFIDENTIAL/Pods/SwiftAlgorithms/Sources/Algorithms/Product.swift:45:12: \e[31m'let' property 'base2' may not be initialized directly; use "self.init(...)" or "self = ..." instead\e[0m

      self.base2 = c.base2
\e[36m               ^\e[0m

\e[31m❌  \e[0m/Users/corteggo/Projects/CONFIDENTIAL/Pods/SwiftAlgorithms/Sources/Algorithms/Reductions.swift:196:10: \e[31m'let' property 'base' may not be initialized directly; use "self.init(...)" or "self = ..." instead\e[0m

    self.base = base
\e[36m                 ^\e[0m

\e[31m❌  \e[0m/Users/corteggo/Projects/CONFIDENTIAL/Pods/SwiftAlgorithms/Sources/Algorithms/Reductions.swift:197:10: \e[31m'let' property 'initial' may not be initialized directly; use "self.init(...)" or "self = ..." instead\e[0m

    self.initial = initial
\e[36m               ^\e[0m

\e[31m❌  \e[0m/Users/corteggo/Projects/CONFIDENTIAL/Pods/SwiftAlgorithms/Sources/Algorithms/Reductions.swift:198:10: \e[31m'let' property 'transform' may not be initialized directly; use "self.init(...)" or "self = ..." instead\e[0m

    self.transform = transform
\e[36m               ^\e[0m

\e[31m❌  \e[0m/Users/corteggo/Projects/CONFIDENTIAL/Pods/SwiftAlgorithms/Sources/Algorithms/Reductions.swift:221:12: \e[31m'let' property 'transform' may not be initialized directly; use "self.init(...)" or "self = ..." instead\e[0m

      self.transform = transform
\e[36m               ^\e[0m

\e[31m❌  \e[0m/Users/corteggo/Projects/CONFIDENTIAL/Pods/SwiftAlgorithms/Sources/Algorithms/Reductions.swift:258:12: \e[31m'let' property 'representation' may not be initialized directly; use "self.init(...)" or "self = ..." instead\e[0m

      self.representation = representation
\e[36m                 ^\e[0m

\e[31m❌  \e[0m/Users/corteggo/Projects/CONFIDENTIAL/Pods/SwiftAlgorithms/Sources/Algorithms/Reductions.swift:439:10: \e[31m'let' property 'base' may not be initialized directly; use "self.init(...)" or "self = ..." instead\e[0m

    self.base = base
\e[36m                 ^\e[0m

\e[31m❌  \e[0m/Users/corteggo/Projects/CONFIDENTIAL/Pods/SwiftAlgorithms/Sources/Algorithms/Reductions.swift:440:10: \e[31m'let' property 'transform' may not be initialized directly; use "self.init(...)" or "self = ..." instead\e[0m

    self.transform = transform
\e[36m               ^\e[0m

\e[31m❌  \e[0m/Users/corteggo/Projects/CONFIDENTIAL/Pods/SwiftAlgorithms/Sources/Algorithms/Reductions.swift:461:12: \e[31m'let' property 'transform' may not be initialized directly; use "self.init(...)" or "self = ..." instead\e[0m

      self.transform = transform
\e[36m               ^\e[0m

\e[31m❌  \e[0m/Users/corteggo/Projects/CONFIDENTIAL/Pods/SwiftAlgorithms/Sources/Algorithms/Reductions.swift:492:12: \e[31m'let' property 'base' may not be initialized directly; use "self.init(...)" or "self = ..." instead\e[0m

      self.base = base
\e[36m                 ^\e[0m

\e[31m❌  \e[0m/Users/corteggo/Projects/CONFIDENTIAL/Pods/SwiftAlgorithms/Sources/Algorithms/Reductions.swift:493:12: \e[31m'let' property 'result' may not be initialized directly; use "self.init(...)" or "self = ..." instead\e[0m

      self.result = result
\e[36m                 ^\e[0m

\e[31m❌  \e[0m/Users/corteggo/Projects/CONFIDENTIAL/Pods/SwiftAlgorithms/Sources/Algorithms/Split.swift:45:10: \e[31m'let' property 'base' may not be initialized directly; use "self.init(...)" or "self = ..." instead\e[0m

    self.base = base
\e[36m                 ^\e[0m

\e[31m❌  \e[0m/Users/corteggo/Projects/CONFIDENTIAL/Pods/SwiftAlgorithms/Sources/Algorithms/Split.swift:46:10: \e[31m'let' property 'isSeparator' may not be initialized directly; use "self.init(...)" or "self = ..." instead\e[0m

    self.isSeparator = isSeparator
\e[36m               ^\e[0m

\e[31m❌  \e[0m/Users/corteggo/Projects/CONFIDENTIAL/Pods/SwiftAlgorithms/Sources/Algorithms/Split.swift:47:10: \e[31m'let' property 'maxSplits' may not be initialized directly; use "self.init(...)" or "self = ..." instead\e[0m

    self.maxSplits = maxSplits
\e[36m               ^\e[0m

\e[31m❌  \e[0m/Users/corteggo/Projects/CONFIDENTIAL/Pods/SwiftAlgorithms/Sources/Algorithms/Split.swift:48:10: \e[31m'let' property 'omittingEmptySubsequences' may not be initialized directly; use "self.init(...)" or "self = ..." instead\e[0m

    self.omittingEmptySubsequences = omittingEmptySubsequences
\e[36m               ^\e[0m

\e[31m❌  \e[0m/Users/corteggo/Projects/CONFIDENTIAL/Pods/SwiftAlgorithms/Sources/Algorithms/Split.swift:84:12: \e[31m'let' property 'isSeparator' may not be initialized directly; use "self.init(...)" or "self = ..." instead\e[0m

      self.isSeparator = whereSeparator
\e[36m               ^\e[0m

\e[31m❌  \e[0m/Users/corteggo/Projects/CONFIDENTIAL/Pods/SwiftAlgorithms/Sources/Algorithms/Split.swift:85:12: \e[31m'let' property 'maxSplits' may not be initialized directly; use "self.init(...)" or "self = ..." instead\e[0m

      self.maxSplits = maxSplits
\e[36m                 ^\e[0m

\e[31m❌  \e[0m/Users/corteggo/Projects/CONFIDENTIAL/Pods/SwiftAlgorithms/Sources/Algorithms/Split.swift:86:12: \e[31m'let' property 'omittingEmptySubsequences' may not be initialized directly; use "self.init(...)" or "self = ..." instead\e[0m

      self.omittingEmptySubsequences = omittingEmptySubsequences
\e[36m                 ^\e[0m

\e[31m❌  \e[0m/Users/corteggo/Projects/CONFIDENTIAL/Pods/SwiftAlgorithms/Sources/Algorithms/Split.swift:372:10: \e[31m'let' property 'base' may not be initialized directly; use "self.init(...)" or "self = ..." instead\e[0m

    self.base = base
\e[36m                 ^\e[0m

\e[31m❌  \e[0m/Users/corteggo/Projects/CONFIDENTIAL/Pods/SwiftAlgorithms/Sources/Algorithms/Split.swift:373:10: \e[31m'let' property 'isSeparator' may not be initialized directly; use "self.init(...)" or "self = ..." instead\e[0m

    self.isSeparator = isSeparator
\e[36m               ^\e[0m

\e[31m❌  \e[0m/Users/corteggo/Projects/CONFIDENTIAL/Pods/SwiftAlgorithms/Sources/Algorithms/Split.swift:374:10: \e[31m'let' property 'maxSplits' may not be initialized directly; use "self.init(...)" or "self = ..." instead\e[0m

    self.maxSplits = maxSplits
\e[36m               ^\e[0m

\e[31m❌  \e[0m/Users/corteggo/Projects/CONFIDENTIAL/Pods/SwiftAlgorithms/Sources/Algorithms/Split.swift:375:10: \e[31m'let' property 'omittingEmptySubsequences' may not be initialized directly; use "self.init(...)" or "self = ..." instead\e[0m

    self.omittingEmptySubsequences = omittingEmptySubsequences
\e[36m               ^\e[0m

\e[31m❌  \e[0m/Users/corteggo/Projects/CONFIDENTIAL/Pods/SwiftAlgorithms/Sources/Algorithms/Split.swift:426:12: \e[31m'let' property 'baseRange' may not be initialized directly; use "self.init(...)" or "self = ..." instead\e[0m

      self.baseRange = baseRange
\e[36m               ^\e[0m

\e[31m❌  \e[0m/Users/corteggo/Projects/CONFIDENTIAL/Pods/SwiftAlgorithms/Sources/Algorithms/Split.swift:427:12: \e[31m'let' property 'sequenceLength' may not be initialized directly; use "self.init(...)" or "self = ..." instead\e[0m

      self.sequenceLength = sequenceLength
\e[36m                 ^\e[0m

\e[31m❌  \e[0m/Users/corteggo/Projects/CONFIDENTIAL/Pods/SwiftAlgorithms/Sources/Algorithms/Split.swift:428:12: \e[31m'let' property 'splitCount' may not be initialized directly; use "self.init(...)" or "self = ..." instead\e[0m

      self.splitCount = splitCount
\e[36m                 ^\e[0m

\e[31m❌  \e[0m/Users/corteggo/Projects/CONFIDENTIAL/Pods/SwiftAlgorithms/Sources/Algorithms/Stride.swift:66:10: \e[31m'let' property 'base' may not be initialized directly; use "self.init(...)" or "self = ..." instead\e[0m

    self.base = base
\e[36m                 ^\e[0m

\e[31m❌  \e[0m/Users/corteggo/Projects/CONFIDENTIAL/Pods/SwiftAlgorithms/Sources/Algorithms/Stride.swift:67:10: \e[31m'let' property 'stride' may not be initialized directly; use "self.init(...)" or "self = ..." instead\e[0m

    self.stride = stride
\e[36m               ^\e[0m

\e[31m❌  \e[0m/Users/corteggo/Projects/CONFIDENTIAL/Pods/SwiftAlgorithms/Sources/Algorithms/Stride.swift:93:12: \e[31m'let' property 'stride' may not be initialized directly; use "self.init(...)" or "self = ..." instead\e[0m

      self.stride = stride
\e[36m               ^\e[0m

\e[31m❌  \e[0m/Users/corteggo/Projects/CONFIDENTIAL/Pods/SwiftAlgorithms/Sources/Algorithms/Stride.swift:129:10: \e[31m'let' property 'base' may not be initialized directly; use "self.init(...)" or "self = ..." instead\e[0m

    self.base = base
\e[36m                 ^\e[0m

\e[31m❌  \e[0m/Users/corteggo/Projects/CONFIDENTIAL/Pods/SwiftAlgorithms/Sources/Algorithms/Stride.swift:130:10: \e[31m'let' property 'stride' may not be initialized directly; use "self.init(...)" or "self = ..." instead\e[0m

    self.stride = stride
\e[36m               ^\e[0m

\e[31m❌  \e[0m/Users/corteggo/Projects/CONFIDENTIAL/Pods/SwiftAlgorithms/Sources/Algorithms/Windows.swift:62:10: \e[31m'let' property 'base' may not be initialized directly; use "self.init(...)" or "self = ..." instead\e[0m

    self.base = base
\e[36m               ^\e[0m

\e[31m❌  \e[0m/Users/corteggo/Projects/CONFIDENTIAL/Pods/SwiftAlgorithms/Sources/Algorithms/Windows.swift:63:10: \e[31m'let' property 'windowSize' may not be initialized directly; use "self.init(...)" or "self = ..." instead\e[0m

    self.windowSize = windowSize

Unless @frozen is added to the structs mentioned in build errors in SwiftAlgorithms code itself, it doesn't work. I tried checking out release/5.0.0 branch and the Charts.xcframework can be archived succesfully with BUILD_LIBRARY_FOR_DISTRIBUTION set to YES, but it doesn't work if you add DGCharts 5.0.0 as a dependency in another project and you set BUILD_LIBRARY_FOR_DISTRIBUTION there by adding it to xcodebuild command:

set -o pipefail && xcodebuild -workspace "CONFIDENTIAL.xcworkspace" -scheme "CONFIDENTIAL" -archivePath "build/frameworks/archives/0_CONFIDENTIAL.xcarchive" WIP=1 SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES OTHER_CFLAGS="-fembed-bitcode" BITCODE_GENERATION_MODE="bitcode" ENABLE_BITCODE=YES -destination "generic/platform=iOS" archive | tee '/Users/corteggo/Library/Logs/fastlane/xcbuild/2023-05-03/97714/xcodebuild.log' | xcpretty --color --simple

I'd still suggest removing SwiftAlgorithms dependency, because there're not so many changes involved in code and the podspec being used is not official. The last release in swift-algorithms repo is from Dec 2021.

@pmairoldi
Copy link
Collaborator

I’m not opposed to removing it but we would need to analyze how long it work take.

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