realm / SwiftLint

A tool to enforce Swift style and conventions.
https://realm.github.io/SwiftLint
MIT License
18.45k stars 2.2k forks source link

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

Open mattcorey opened 3 weeks ago

mattcorey commented 3 weeks ago

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

disabled_rules:
 - inclusive_language
 - line_length
 - identifier_name

opt_in_rules:
 - first_where

analyzer_rules:
 - unused_declaration
 - unused_import

force_try:
  excluded:
   - ".*Tests\\.swift"

It happens on every other Xcode build

DD-P commented 2 weeks ago

According to the Xcode 16 beta release notes.

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