skiptools / skip

Skip transpiler for creating SwiftUI apps for iOS and Android
https://skip.tools
GNU Lesser General Public License v3.0
1.12k stars 30 forks source link

Xcode Internal inconsistency error when running Skip plugin #69

Open marcprux opened 6 months ago

marcprux commented 6 months ago

When building a project with the Skip plugin, the following Xcode errors can occur and halt the build:

Internal inconsistency error: received multiple target ended messages for target ID '6' or received target ended message but did not receive corresponding target started message, while retrieving parent activity in taskStarted message.
Internal inconsistency error: received multiple task ended messages for task ID '8' or received task ended message but did not receive corresponding task started message.

Performing a clean re-build is the only way to work around this. Sometimes this needs to be done multiple times.

There is no obvious trigger for this error – it occurs at random when building a project. I suspect it has to do with Xcode running multiple simultaneous plugins invocations (for all the dependent Skip modules), and having their communication pipelines mixed up somehow. However, since Xcode 15 removed the ability to disable the "Parallelize Build" setting for the scheme, it is not possible to test this hypothesis directly.

This issue is reported by other SPM plugins when run from within Xcode (e.g., https://github.com/SwiftGen/SwiftGenPlugin/issues/15), and has been a bug since Xcode 14.3, and persists through 15.1. See https://github.com/apple/swift-package-manager/issues/6705.

marcprux commented 6 months ago
Screenshot 2023-12-23 at 10 58 46