Support OS versions below iOS 13, macOS 10.15 etc. #39
Replies: 12 comments 1 reply
-
This is unfortunately due to how Swift Collections is distributed 😕. Its Package.swift file is locked to In the meantime, because you're maintaining RAS-TCA, and the dependency is at the level of TCA and not another downstream dependency, I think you could continue to ship the old |
Beta Was this translation helpful? Give feedback.
-
That's actually not the problem, as I'm using package tools 5.2, and the error I get is:
It's that and The |
Beta Was this translation helpful? Give feedback.
-
@mluisbrown Is it possible to define our own |
Beta Was this translation helpful? Give feedback.
-
@stephencelis it is possible to define our own You can be using Swift 5.3 and still want to have a minimum deployment target of iOS 12, but you won't get
I'm going with this workaround for now, and so far it seems to be ok. |
Beta Was this translation helpful? Give feedback.
-
@mluisbrown Can you try using this branch? https://github.com/pointfreeco/swift-identified-collections/compare/relax-platform-requirements Locally things seem to pass for me when targeting iOS 11. |
Beta Was this translation helpful? Give feedback.
-
@stephencelis I get the same errors as before with the conformances for I am using Xcode 12.5.1 for which AFAIK This change would probably work for using an older version of Xcode that only used Swift 5.2 but that wouldn't be all that useful. |
Beta Was this translation helpful? Give feedback.
-
Strangely enough it works on the Xcode 13 beta on an iOS 11 sim, which should definitely pass that compiler directive...I'll have to try 12 soon. |
Beta Was this translation helpful? Give feedback.
-
Wow 😮 I guess it's possible that Swift 5.5 fixed the issue that checks the minimum OS availability for a protocol like |
Beta Was this translation helpful? Give feedback.
-
Swift Collections only builds with a recent compiler toolchain, and we expect to keep bumping the required compiler/SwiftPM version (i.e., However, Swift Collections does not specify a minimum deployment target -- it runs on every OS release that can run Swift. I think this package should do the same! The compiler version check in the screenshot above seems wrong -- support for availability for protocol conformances did not land until after 5.3 was released, and I think it only matured enough to compile this code in Swift 5.5. |
Beta Was this translation helpful? Give feedback.
-
@mluisbrown With a compiler check of Swift 5.5 does everything work for you? If so, we'd be happy to take a PR to address this! We realize it's not a fix that can be used in production quite yet, but when Xcode 13 is released you should be able to fully switch off the old, vendored version :) |
Beta Was this translation helpful? Give feedback.
-
Hi @stephencelis, it's strange. With Xcode beta 5 both the compiler check for Swift 5.3 and Swift 5.5 allow the code to build for an iOS 11 sim. However, when I run tests on an this sim (iPhone X, iOS 11.4) they crash: The crash in Interestingly in Xcode 12.5.1, if I set the compile check to 5.5 (instead of 5.3 which I tried above without success), the library code compiles OK, but the test code does not: That makes sense, since Xcode 12.5.1 is Swift 5.4, so the protocol conformance to With Xcode 13 beta 5 if I change the first test to not use an array literal then this test passes: func testIds() {
let array: IdentifiedArray<Int, Int> = .init(uniqueElements: [1, 2, 3], id: \.id)
XCTAssertEqual(array.ids, [1, 2, 3])
} So in summary: with Xcode 13 and a Swift 5.5 compiler check, the library compiles and can be used in with iOS 11 (and presumably the respective versions of the other OSes), but you it seems like a Swift and/or Xcode bug that it allows code that depends on the Swift 5.5 only protocol conformances compile without error and cause a runtime crash instead. |
Beta Was this translation helpful? Give feedback.
-
Going to move this to a discussion. We'd gladly take a PR for this but we've tried to move our repos to using issues exclusively for bug tracking, and this is more of a feature request. |
Beta Was this translation helpful? Give feedback.
-
Since this repo is now a dependency of TCA, and I have been updating RAS-TCA to match, it forces me to remove support for older Apple OSs for RAS-TCA as well 😢
I tried various different approaches to try and make
IdentifiedCollections
support the older OSes without success.If you have any ideas on how that might work I'd be interested 😄
In the meantime, I might have to keep the "old"
IdentifiedArray
in RAS-TCA until a better solution can be found.Beta Was this translation helpful? Give feedback.
All reactions