Closed Kaspik closed 4 years ago
Hi @Kaspik,
this is, sadly, a known issue right now that is a regression introduced with Swift 5.3. I've reported the issue as part of a beta feedback some time ago (FB8101511) (2020-07-22). Up until now there is no working fix for the issue. I will however keep working on the problem from my end (i.e. try restructuring or renaming code). If you have any insight into what could help here or what is the actual reason for the compiler crash your help would be much appreciated.
Other than that the official recommendation is to compile with a Swift version < 5.3 I'm afraid.
Just as an addition I attached my stack trace dump here: stack.dump.log
There are other projects facing similar issues it seems:
A related Swift compiler bug issue could be:
Just FYI - Version 12.1 didn't have this issue, so maybe let's dig into what has changed between 12.1 and 14?
Also seem like Eureka found a workaround for now - https://github.com/xmartlabs/Eureka/pull/2061
Files changed between 0.12.1 and 0.14.0 are comparable here: https://github.com/fireblade-engine/ecs/compare/0.12.1...0.14.0
The only type system heavy introductions where:
So I just verified the regression was introduced with 0.13.0, which 0.12.2 still working. So the failing code must be part of this diff https://github.com/fireblade-engine/ecs/compare/0.12.2...0.13.0
Yes, from the stack it's FamilyProtocols.swift:25:8
, - While type-checking protocol conformance to 'FamilyEncoding'
.
Do you have XCode 12 available to poke around?
So I tracked the issue down to the FamilyEncoding
implementation and conformance. I will have to take a closer look into this implementation. Using Xcode 12 beta 4. But I do not have time to work on that right now. Maybe you find something in particular. Will come back to you soon.
I have an idea:
public static func decode(componentsIn container: KeyedDecodingContainer<DynamicCodingKey>, using strategy: CodingStrategy) throws -> (A, B, C, D, E) {
let compA = try container.decode(A.self, forKey: strategy.codingKey(for: A.self))
let compB = try container.decode(B.self, forKey: strategy.codingKey(for: B.self))
let compC = try container.decode(C.self, forKey: strategy.codingKey(for: C.self))
let compD = try container.decode(D.self, forKey: strategy.codingKey(for: D.self))
let compE = try container.decode(E.self, forKey: strategy.codingKey(for: E.self))
return Components(compA, compB, compC, compD, compE)
}
uses A,B,C,D,E, but:
public static func encode(components: (A, B, C, D, E), into container: inout KeyedEncodingContainer<DynamicCodingKey>, using strategy: CodingStrategy) throws {
try container.encode(components.0, forKey: strategy.codingKey(for: A.self))
try container.encode(components.1, forKey: strategy.codingKey(for: B.self))
try container.encode(components.2, forKey: strategy.codingKey(for: C.self))
try container.encode(components.3, forKey: strategy.codingKey(for: D.self))
try container.encode(components.4, forKey: strategy.codingKey(for: E.self))
}
uses 1,2,3,4,5 even tho it has A,B,C,D,E params?
EDIT: Ohh nvm, I read it wrong ...
@Kaspik I found a fix - see https://github.com/fireblade-engine/ecs/pull/22 Will merge as soon as you confirm that it works on your end and provide a new path version 0.14.1
@ctreffs Still seeing the issue. It seems like Parent1 - Parent5 protocol methods are not updated?
Hi @Kaspik, make sure you clear your derived data folder and clean your project, re-open Xcode and try again. Just checked again: the current release (0.14.1) builds and tests without a problem using Xcode 12 beta 4.
Please verify again, and if the issue persists report your crash-log and Xcode version. Thank you.
Yeah sorry for that, issue on my end (none of the mentioned above). Thanks!
Hey!
When trying to compile the project with XCode 12 and Swift 5.3 with SPM integration, XCode can't compile the project because of Segmentation fault: