Cache mixes up different Swift versions
fredpi opened this issue · 2 comments
When caching frameworks, Accio differentiates between different Swift versions, so that a user having set Xcode 10.2.1
as their command line tools won't get cached frameworks originating from a user that has Xcode 11
set as their command line tools. That's needed, as otherwise, Xcode would complain that the frameworks have been built with Swift 5.1, while the user is still running Xcode 10.2.1 with Swift 5.0.1.
So, it's perfectly valid to separate by Swift version. However, the implementation doesn't work properly, as the Swift version is retrieved on compile time of Accio:
static var swiftVersion: String {
#if swift(>=6.0)
return "Swift-6.0"
#elseif swift(>=5.2)
return "Swift-5.2"
#elseif swift(>=5.1)
return "Swift-5.1"
#elseif swift(>=5.0)
return "Swift-5.0"
#else
return "Swift-4.2"
#endif
}
This works quite often, as the Accio-compile-time Swift version is likely to match the current Swift version, but in transition periods (like now, switching from Swift 5.0
to Swift 5.1
), this is a real issue: The folder that should store Swift 5.0
builds may now also include Swift 5.1
builds and the other way round.
To get things to work, the swift version should instead be retrieved via the swift --version
command during runtime.
Absolutely correct. Would you mind fixing it? :)
Will fix it with pleasure ;)