realm / realm/SwiftLint

Xcode 15 'Internal inconsistency error' when using as a Build Tool Plug-In

Open
#5,619 1 comment 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

integration
Dominant language
Swift
Stars
19.7k
Forks
2.3k
Avg merge
1d 1h
Merged PRs (30d)
11

Description

New Issue Checklist
Describe the bug

When SwiftLint is configured to run as a Build Tool Plug-In, Xcode often throws an 'Internal inconsistency error' when building. At its worst, this error appears with every other build.

This has been discussed for some time on the Apple Developer Forums: https://forums.developer.apple.com/forums/thread/748062. The last two commenters (mine is the last one) indicate that this only started happening after adding SwiftLint as a Build Tool Plug-In.

To be clear, I have no idea if this is a SwiftLint bug or an Xcode bug, but I wanted to ensure that the SwiftLint team was aware of the issue.

Complete output when running SwiftLint, including the stack trace and command used

Xcode 15 error:

Internal inconsistency error: never received target ended message for target ID '19' (in target 'Bills To Budget' from project 'Bills To Budget'). Build again to continue.

Portion of the build output, exported from Xcode:

" /Users/mattcorey/Library/Developer/Xcode/DerivedData/Bills_To_Budget-cbwnqsglxcgitybqmwnmfikqrwvd/SourcePackages/artifacts/swiftlint/SwiftLintBinary/SwiftLintBinary.artifactbundle/swiftlint-0.55.1-macos/bin/swiftlint lint --quiet --force-exclude --cache-path /Users/mattcorey/Library/Developer/Xcode/DerivedData/Bills_To_Budget-cbwnqsglxcgitybqmwnmfikqrwvd/SourcePackages/plugins/Bills_To_Budget.output/UIComponents/SwiftLintBuildToolPlugin/Cache /Users/mattcorey/Developer/MoneyMaster/UIComponents/Budgets/BudgetSummaryBackground.swift /Users/mattcorey/Developer/MoneyMaster/UIComponents/Expenses/ExpenseViewModel.swift /Users/mattcorey/Developer/MoneyMaster/UIComponents/Expenses/PaymentLineView.swift /Users/mattcorey/Developer/MoneyMaster/UIComponents/Expenses/ExpenseLineItemView.swift /Users/mattcorey/Developer/MoneyMaster/UIComponents/Calendar/CalendarVisualizationModel.swift /Users/mattcorey/Developer/MoneyMaster/UIComponents/Budgets/BudgetProgressChart.swift /Users/mattcorey/Developer/MoneyMaster/UIComponents/Accounts/AccountTagView.swift /Users/mattcorey/Developer/MoneyMaster/UIComponents/Budgets/BudgetSummaryView.swift /Users/mattcorey/Developer/MoneyMaster/UIComponents/Extensions/Money+Transferable.swift /Users/mattcorey/Developer/MoneyMaster/UIComponents/Extensions/View+ContrastingText.swift /Users/mattcorey/Developer/MoneyMaster/UIComponents/DeploymentEnvironmentSupport.swift /Users/mattcorey/Developer/MoneyMaster/UIComponents/Accounts/AccountIconImage.swift /Users/mattcorey/Developer/MoneyMaster/UIComponents/Calendar/CalendarEvent.swift /Users/mattcorey/Developer/MoneyMaster/UIComponents/Expenses/ExpenseLine.swift /Users/mattcorey/Developer/MoneyMaster/UIComponents/Extensions/View+SizePreferences.swift /Users/mattcorey/Developer/MoneyMaster/BillsToBudget/SwiftUI/Extensions/Date+Common.swift /Users/mattcorey/Developer/MoneyMaster/UIComponents/Extensions/View+If.swift /Users/mattcorey/Developer/MoneyMaster/UIComponents/Extensions/Locale+SFSymbols.swift /Users/mattcorey/Developer/MoneyMaster/UIComponents/Accounts/AccountGradient.swift

warning: Invalid configuration for 'force_try' rule. Falling back to default.
/Users/mattcorey/Developer/MoneyMaster/UIComponents/Calendar/CalendarVisualizationModel.swift:424:1: warning: File Length Violation: File should contain 400 lines or less: currently contains 424 (file_length)

Invalid configuration for 'force_try' rule. Falling back to default.

/Users/mattcorey/Developer/MoneyMaster/UIComponents/Calendar/CalendarVisualizationModel.swift:424:1: File Length Violation: File should contain 400 lines or less: currently contains 424 (file_length)

Process build tool plug-in results

Prepare build
error: Internal inconsistency error: never received target ended message for target ID '19' (in target 'Bills To Budget' from project 'Bills To Budget'). Build again to continue.


Internal inconsistency error: never received target ended message for target ID '19' (in target 'Bills To Budget' from project 'Bills To Budget'). Build again to continue.
Environment
  • SwiftLint version (run swiftlint version to be sure)? 0.55.1 - this differs from the version installed on my machine, but I assume this is not relevant?
  • Installation method used (Homebrew, CocoaPods, building from source, etc)? Swift Package Manager
  • Paste your configuration file:
disabled_rules:
 - inclusive_language
 - line_length
 - identifier_name

opt_in_rules:
 - first_where

analyzer_rules:
 - unused_declaration
 - unused_import

force_try:
  excluded:
   - ".*Tests\\.swift"
  • Are you using nested configurations? No
    If so, paste their relative paths and respective contents.
  • Which Xcode version are you using (check xcodebuild -version)? 15.4
  • Do you have a sample that shows the issue? Run echo "[string here]" | swiftlint lint --no-cache --use-stdin --enable-all-rules
    to quickly test if your example is really demonstrating the issue. If your example is more
    complex, you can use swiftlint lint --path [file here] --no-cache --enable-all-rules.

It happens on every other Xcode build

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the SwiftLint Build Tool Plug-In invocation and the Xcode 15.4 build output provided in this issue. Reproduce the intermittent failure using SwiftLint 0.55.1 and the listed configuration, then determine whether the fault is in SwiftLint or Xcode; done means a confirmed cause, reproducible evidence, and a fix or documented limitation.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
build-system, devtools
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.