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

Internal inconsistency error (didStartTask) #6705

Closed
BarredEwe opened this issue Jul 13, 2023 · 17 comments
Closed

Internal inconsistency error (didStartTask) #6705

BarredEwe opened this issue Jul 13, 2023 · 17 comments
Labels

Comments

@BarredEwe
Copy link

BarredEwe commented Jul 13, 2023

Description

When Package.swift contains a plugin that generates code using `.prebuildCommand'. this leads to a build error:

Internal inconsistency error (didStartTask): targetID (174) not found in _activeTargets.
Internal inconsistency error (didEndTask): '12' missing from _activeTasks.

For example SwiftGenPlugin has this issue SwiftGen/SwiftGenPlugin#15
Or others plugin like Sourcery.

To get rid of this error, you need to call the build cleanup and rebuild the project.

There are also other discussions of a similar problem:

Expected behavior

Expected Behavior:
The build process should complete successfully without any internal inconsistency errors.

Actual behavior

Actual Behavior:
Xcode displays the internal inconsistency error message and subsequent builds fail to produce the expected result, launching stale products instead.

Steps to reproduce

  1. Install and configure SwiftGenPlugin in Xcode.
  2. Make changes to the build plan, such as adding a file, or start a build during Xcode's indexing stage.
  3. Observe the build error message:
Internal inconsistency error (didStartTask): targetID (174) not found in _activeTargets.
Internal inconsistency error (didEndTask): '12' missing from _activeTasks.

Swift Package Manager version/commit hash

5.7-5.9(latest)

Swift & OS version (output of swift --version ; uname -a)

Xcode version: 14.3.1
swift-driver version: 1.75.2 Apple Swift version 5.8.1 (swiftlang-5.8.0.124.5 clang-1403.0.22.11.100)
Target: arm64-apple-macosx13.0
Darwin barredewe 22.5.0 Darwin Kernel Version 22.5.0: Thu Jun 8 22:22:20 PDT 2023; root:xnu-8796.121.3~7/RELEASE_ARM64_T6000 arm64

@BarredEwe BarredEwe added the bug label Jul 13, 2023
@neonichu
Copy link
Contributor

This looks like output from XCBuild, so this should be Xcode-specific. cc @abertelrud

@pyrtsa
Copy link

pyrtsa commented Sep 15, 2023

This definitely looks like a bug around XCBuild, and it's still an issue in Xcode 15.0 RC. The build error strings originate from Xcode.app/Contents/PlugIns/XCBuildSupportCore.ideplugin/Contents/MacOS/XCBuildSupportCore, but it's near-impossible for us to debug it further, because XCBuildSupportCore is closed source.

We're hit by this issue almost daily. Having to first realise that you'd been debugging an old build all along because the build silently failed, and then clean all and rebuild… Can't say it's a great developer experience.

@neonichu
Copy link
Contributor

Thanks for your report, but please file it through http://feedbackassistant.apple.com/ since the SwiftPM project doesn't track issues in Xcode and/or Xcode Cloud.

@setoelkahfi
Copy link

We encountered this today using GitHub runner macos-13-xl Xcode 15. Strangely our workflow was marked as successful.

@rpassis
Copy link

rpassis commented Oct 9, 2023

Xcode 15.1 beta reports the inconsistency as an error now which is a step in the right direction 👍

@marcprux
Copy link

marcprux commented Dec 23, 2023

Still a bug in Xcode 15.1. This is a crippling problem for anyone using SPM plugins from Xcode.

Cleaning the build folder often works around this. Less drastically, simply clearing the error (Product/Clear All Issues) and building again sometimes resolves the problem temporarily.

@joshuawright11
Copy link

I've also found that closing and re-opening Xcode is the quickest way (faster than clean, slower than clear all issues) to (usually) resolve this issue.

@jsimonlane
Copy link

Seconding this, this dramatically slows down dev time

@PeterSenyszyn
Copy link

PeterSenyszyn commented Mar 13, 2024

Coming in here to add another +1, extremely annoying and crippling to dev time. Only way around it for me is to do a clean / full rebuild. Happens almost every single time I make a code change.

@marcprux
Copy link

marcprux commented Mar 13, 2024

Coming in here to add another +1, extremely annoying and crippling to dev time. Only way around it for me is to do a clean / full rebuild.

It has also gotten much much worse with Xcode 15.3. The only "improvement" is that the message now appends: "Build again to continue". Thanks, I will. 🙄

Screenshot 2024-03-13 at 17 27 13

Can someone from Apple (e.g., @abertelrud or @neonichu) please escalate this internally? Feedback reports are just ignored.

@PeterSenyszyn
Copy link

Coming in here to add another +1, extremely annoying and crippling to dev time. Only way around it for me is to do a clean / full rebuild.

It has also gotten much much worse with Xcode 15.3. The only "improvement" is that the message now appends: "Build again to continue". Thanks, I will. 🙄

Screenshot 2024-03-13 at 17 27 13 Can someone from Apple please escalate this internally? Feedback reports are just ignored.

It got worse for me as well in 15.3. Before it would happen every other recompile, but now it happens every time for me.

@sebj
Copy link

sebj commented Mar 21, 2024

Has anyone filed feedback with an ID to mention/dupe?

@jaredsinclair
Copy link

@sebj Yes here: FB13368618

@marcprux
Copy link

FTR, still a major problem in Xcode 15.4 released yesterday.

@jaminguy-jh
Copy link

Yes, I've encountered it several times this AM on Xcode 15.4.

@bilousoleksandr
Copy link

bilousoleksandr commented Jun 6, 2024

Have the similar issue with Xcode 15.4.0, we use both swiftGen and sourcery plugin for code generationg in Xcode.

@BarredEwe
Copy link
Author

In Xcode 16 Beta it seems to have been fixed:

Fixed an issue where projects using SwiftPM build tool plugins would sometimes report internal inconsistency errors when building. (121851192) (FB13565986)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests