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

Can't run tests on my app because of dependency versions inconsistency in the SwiftLint package #5063

Closed
2 tasks done
PatoSalazarC opened this issue Jun 14, 2023 · 11 comments
Closed
2 tasks done
Labels
integration Issues related to integration of SwiftLint into toolchains.

Comments

@PatoSalazarC
Copy link

PatoSalazarC commented Jun 14, 2023

New Issue Checklist

Describe the bug

A clear and concise description of what the bug is.

I had a bunch of tests that I was running on my app with the following command

xcodebuild \
  -project someApp/someApp.xcodeproj \
  -scheme someApp \
  -sdk iphonesimulator \
  -destination 'platform=iOS Simulator,name=iPhone 14,OS=16.4' \
test

but after installing swiftlint as a swift package to my app, now I am getting this error when I try to build and run the test.

note: Building targets in dependency order
error: The package product 'CollectionConcurrencyKit' requires minimum platform version 13.0 for the iOS platform, but this target supports 11.0 (in target 'SwiftLintPlugin' from project 'SwiftLint')
error: The package product 'SwiftIDEUtils' requires minimum platform version 13.0 for the iOS platform, but this target supports 11.0 (in target 'SwiftLintPlugin' from project 'SwiftLint')
error: The package product 'SwiftOperators' requires minimum platform version 13.0 for the iOS platform, but this target supports 11.0 (in target 'SwiftLintPlugin' from project 'SwiftLint')
error: The package product 'SwiftParser' requires minimum platform version 13.0 for the iOS platform, but this target supports 11.0 (in target 'SwiftLintPlugin' from project 'SwiftLint')
error: The package product 'SwiftSyntax' requires minimum platform version 13.0 for the iOS platform, but this target supports 11.0 (in target 'SwiftLintPlugin' from project 'SwiftLint')
error: The package product 'SwiftSyntaxBuilder' requires minimum platform version 13.0 for the iOS platform, but this target supports 11.0 (in target 'SwiftLintPlugin' from project 'SwiftLint')
error: The package product 'SwiftIDEUtils' requires minimum platform version 13.0 for the iOS platform, but this target supports 11.0 (in target 'SwiftLintBuiltInRules' from project 'SwiftLint')
error: The package product 'SwiftOperators' requires minimum platform version 13.0 for the iOS platform, but this target supports 11.0 (in target 'SwiftLintBuiltInRules' from project 'SwiftLint')
error: The package product 'SwiftParser' requires minimum platform version 13.0 for the iOS platform, but this target supports 11.0 (in target 'SwiftLintBuiltInRules' from project 'SwiftLint')
error: The package product 'SwiftSyntax' requires minimum platform version 13.0 for the iOS platform, but this target supports 11.0 (in target 'SwiftLintBuiltInRules' from project 'SwiftLint')
error: The package product 'SwiftSyntaxBuilder' requires minimum platform version 13.0 for the iOS platform, but this target supports 11.0 (in target 'SwiftLintBuiltInRules' from project 'SwiftLint')
error: The package product 'SwiftIDEUtils' requires minimum platform version 13.0 for the iOS platform, but this target supports 11.0 (in target 'SwiftLintFramework' from project 'SwiftLint')
error: The package product 'SwiftOperators' requires minimum platform version 13.0 for the iOS platform, but this target supports 11.0 (in target 'SwiftLintFramework' from project 'SwiftLint')
error: The package product 'SwiftParser' requires minimum platform version 13.0 for the iOS platform, but this target supports 11.0 (in target 'SwiftLintFramework' from project 'SwiftLint')
error: The package product 'SwiftSyntax' requires minimum platform version 13.0 for the iOS platform, but this target supports 11.0 (in target 'SwiftLintFramework' from project 'SwiftLint')
error: The package product 'SwiftSyntaxBuilder' requires minimum platform version 13.0 for the iOS platform, but this target supports 11.0 (in target 'SwiftLintFramework' from project 'SwiftLint')
error: The package product 'SwiftIDEUtils' requires minimum platform version 13.0 for the iOS platform, but this target supports 11.0 (in target 'SwiftLintExtraRules' from project 'SwiftLint')
error: The package product 'SwiftOperators' requires minimum platform version 13.0 for the iOS platform, but this target supports 11.0 (in target 'SwiftLintExtraRules' from project 'SwiftLint')
error: The package product 'SwiftParser' requires minimum platform version 13.0 for the iOS platform, but this target supports 11.0 (in target 'SwiftLintExtraRules' from project 'SwiftLint')
error: The package product 'SwiftSyntax' requires minimum platform version 13.0 for the iOS platform, but this target supports 11.0 (in target 'SwiftLintExtraRules' from project 'SwiftLint')
error: The package product 'SwiftSyntaxBuilder' requires minimum platform version 13.0 for the iOS platform, but this target supports 11.0 (in target 'SwiftLintExtraRules' from project 'SwiftLint')
error: The package product 'SwiftIDEUtils' requires minimum platform version 13.0 for the iOS platform, but this target supports 11.0 (in target 'SwiftLintCore' from project 'SwiftLint')
error: The package product 'SwiftOperators' requires minimum platform version 13.0 for the iOS platform, but this target supports 11.0 (in target 'SwiftLintCore' from project 'SwiftLint')
error: The package product 'SwiftParser' requires minimum platform version 13.0 for the iOS platform, but this target supports 11.0 (in target 'SwiftLintCore' from project 'SwiftLint')
error: The package product 'SwiftSyntax' requires minimum platform version 13.0 for the iOS platform, but this target supports 11.0 (in target 'SwiftLintCore' from project 'SwiftLint')
error: The package product 'SwiftSyntaxBuilder' requires minimum platform version 13.0 for the iOS platform, but this target supports 11.0 (in target 'SwiftLintCore' from project 'SwiftLint')

The package is added in my target as a plugin in the Run build tool Plug In section.

Environment

  • SwiftLint version (run swiftlint version to be sure)?
    0.52.2

  • Installation method used (Homebrew, CocoaPods, building from source, etc)?
    Installed as a Swift Package

  • Paste your configuration file:

# By default, SwiftLint uses a set of sensible default rules you can adjust:
disabled_rules: # rule identifiers turned on by default to exclude from running
  - colon
  - comma
  - control_statement
  -
opt_in_rules: # some rules are turned off by default, so you need to opt-in
  - empty_count # Find all the available rules by running: `swiftlint rules`

included: # paths to include during linting
    - lifeAppiOS
    - Design
    - DesignSystemTests

# Alternatively, specify all rules explicitly by uncommenting this option:
# only_rules: # delete `disabled_rules` & `opt_in_rules` if using this
#   - empty_parameters
#   - vertical_whitespace

analyzer_rules: # Rules run by `swiftlint analyze`
  - explicit_self

included: # paths to include during linting. `--path` is ignored if present.
  - Source
excluded: # paths to ignore during linting. Takes precedence over `included`.
  - Carthage
  - Pods
  - Source/ExcludedFolder
  - Source/ExcludedFile.swift
  - Source/*/ExcludedFile.swift # Exclude files with a wildcard

# If true, SwiftLint will not fail if no lintable files are found.
allow_zero_lintable_files: false

# configurable rules can be customized from this configuration file
# binary rules can set their severity level
force_cast: warning # implicitly
force_try:
  severity: warning # explicitly
# rules that have both warning and error levels, can set just the warning level
# implicitly
line_length: 120
# they can set both implicitly with an array
type_body_length:
  - 300 # warning
  - 400 # error
# or they can set both explicitly
file_length:
  warning: 500
  error: 1200
# naming rules can set warnings/errors for min_length and max_length
# additionally they can set excluded names
type_name:
  min_length: 4 # only warning
  max_length: # warning and error
    warning: 40
    error: 50
  excluded: iPhone # excluded via string
  allowed_symbols: ["_"] # these are allowed in type names
identifier_name:
  min_length: # only min_length
    error: 3 # only error
  excluded: # excluded via string array
    - id
    - URL
    - GlobalAPIKey
reporter: "xcode" # reporter type (xcode, json, csv, checkstyle, codeclimate, junit, html, emoji, sonarqube, markdown, github-actions-logging, summary)
  • Which Xcode version are you using (check xcodebuild -version)?

Xcode 14.3.1

@SimplyDanny SimplyDanny added the integration Issues related to integration of SwiftLint into toolchains. label Jun 24, 2023
@travisbrigman
Copy link

Same Problem, with a similar setup

  • SwiftLint 0.52.4
  • Installed as a Swift Package
  • Being used as Build Tool Plugin
  • Github Actions
  • Xcode 14.2.0 (14C18)
brew install xcbeautify
          xcodebuild \
            -scmProvider system \
            -skipPackagePluginValidation \
            -disableAutomaticPackageResolution \
            -project VisionControl.xcodeproj \
            -scheme VisionControl-QA \
            -sdk iphonesimulator \
            -destination 'platform=iOS Simulator,name=iPhone 14,OS=16.2' \
            test \
            | xcbeautify

Config File

disabled_rules: # rule identifiers to exclude from running
    - file_length
    - function_body_length
    - line_length
    - missing_docs
    - private_outlet
    - cyclomatic_complexity
    - trailing_whitespace
    - identifier_name
    - function_parameter_count

opt_in_rules: # some rules are only opt-in
# Find all the available rules by running: swiftlint rules
    - force_unwrapping
    - empty_count
    - trailing_semicolon
    - closure_parameter_position
    - closure_spacing
    - explicit_init
    - function_body_length
    - implicit_return
    - implicitly_unwrapped_optional
    - let_var_whitespace
    - line_length
    - literal_expression_end_indentation
    - operator_usage_whitespace
    - overridden_super_call
    - private_action
    - private_outlet
    - quick_discouraged_call
    - quick_discouraged_focused_test
    - quick_discouraged_pending_test
    - redundant_nil_coalescing
    - required_enum_case
    - single_test_class
    - sorted_first_last
    - statement_position
    - switch_case_on_newline
    - unneeded_parentheses_in_closure_argument
    - vertical_parameter_alignment_on_call
    - yoda_condition
included: # paths to include during linting. `--path` is ignored if present.
    - VisionControl
    - VisionControl-QATests
    - VisionControl-UITests

excluded: # paths to ignore during linting. Takes precedence over `included`.
    - Carthage
    - Pods

# Customize behaviour of the existing rules
large_tuple: 5

nesting:
    type_level: 2
    statement_level: 5

type_body_length:
    - 450 # warning
    - 500 # error

Error Output

❌ error: The package product 'SwiftIDEUtils' requires minimum platform version 13.0 for the iOS platform, but this target supports 11.0 (in target 'SwiftLintPlugin' from project 'SwiftLint')
❌ error: The package product 'SwiftOperators' requires minimum platform version 13.0 for the iOS platform, but this target supports 11.0 (in target 'SwiftLintPlugin' from project 'SwiftLint')
❌ error: The package product 'SwiftParser' requires minimum platform version 13.0 for the iOS platform, but this target supports 11.0 (in target 'SwiftLintPlugin' from project 'SwiftLint')
❌ error: The package product 'SwiftSyntax' requires minimum platform version 13.0 for the iOS platform, but this target supports 11.0 (in target 'SwiftLintPlugin' from project 'SwiftLint')
❌ error: The package product 'SwiftSyntaxBuilder' requires minimum platform version 13.0 for the iOS platform, but this target supports 11.0 (in target 'SwiftLintPlugin' from project 'SwiftLint')
❌ error: The package product 'CollectionConcurrencyKit' requires minimum platform version 13.0 for the iOS platform, but this target supports 11.0 (in target 'SwiftLintPlugin' from project 'SwiftLint')
❌ error: The package product 'SwiftIDEUtils' requires minimum platform version 13.0 for the iOS platform, but this target supports 11.0 (in target 'SwiftLintFramework' from project 'SwiftLint')
❌ error: The package product 'SwiftOperators' requires minimum platform version 13.0 for the iOS platform, but this target supports 11.0 (in target 'SwiftLintFramework' from project 'SwiftLint')
❌ error: The package product 'SwiftParser' requires minimum platform version 13.0 for the iOS platform, but this target supports 11.0 (in target 'SwiftLintFramework' from project 'SwiftLint')
❌ error: The package product 'SwiftSyntax' requires minimum platform version 13.0 for the iOS platform, but this target supports 11.0 (in target 'SwiftLintFramework' from project 'SwiftLint')
❌ error: The package product 'SwiftSyntaxBuilder' requires minimum platform version 13.0 for the iOS platform, but this target supports 11.0 (in target 'SwiftLintFramework' from project 'SwiftLint')
❌ error: The package product 'SwiftIDEUtils' requires minimum platform version 13.0 for the iOS platform, but this target supports 11.0 (in target 'SwiftLintExtraRules' from project 'SwiftLint')
❌ error: The package product 'SwiftOperators' requires minimum platform version 13.0 for the iOS platform, but this target supports 11.0 (in target 'SwiftLintExtraRules' from project 'SwiftLint')
❌ error: The package product 'SwiftParser' requires minimum platform version 13.0 for the iOS platform, but this target supports 11.0 (in target 'SwiftLintExtraRules' from project 'SwiftLint')
❌ error: The package product 'SwiftSyntax' requires minimum platform version 13.0 for the iOS platform, but this target supports 11.0 (in target 'SwiftLintExtraRules' from project 'SwiftLint')
❌ error: The package product 'SwiftSyntaxBuilder' requires minimum platform version 13.0 for the iOS platform, but this target supports 11.0 (in target 'SwiftLintExtraRules' from project 'SwiftLint')
❌ error: The package product 'SwiftIDEUtils' requires minimum platform version 13.0 for the iOS platform, but this target supports 11.0 (in target 'SwiftLintBuiltInRules' from project 'SwiftLint')
❌ error: The package product 'SwiftOperators' requires minimum platform version 13.0 for the iOS platform, but this target supports 11.0 (in target 'SwiftLintBuiltInRules' from project 'SwiftLint')
❌ error: The package product 'SwiftParser' requires minimum platform version 13.0 for the iOS platform, but this target supports 11.0 (in target 'SwiftLintBuiltInRules' from project 'SwiftLint')
❌ error: The package product 'SwiftSyntax' requires minimum platform version 13.0 for the iOS platform, but this target supports 11.0 (in target 'SwiftLintBuiltInRules' from project 'SwiftLint')
❌ error: The package product 'SwiftSyntaxBuilder' requires minimum platform version 13.0 for the iOS platform, but this target supports 11.0 (in target 'SwiftLintBuiltInRules' from project 'SwiftLint')
❌ error: The package product 'SwiftIDEUtils' requires minimum platform version 13.0 for the iOS platform, but this target supports 11.0 (in target 'SwiftLintCore' from project 'SwiftLint')
❌ error: The package product 'SwiftOperators' requires minimum platform version 13.0 for the iOS platform, but this target supports 11.0 (in target 'SwiftLintCore' from project 'SwiftLint')
❌ error: The package product 'SwiftParser' requires minimum platform version 13.0 for the iOS platform, but this target supports 11.0 (in target 'SwiftLintCore' from project 'SwiftLint')
❌ error: The package product 'SwiftSyntax' requires minimum platform version 13.0 for the iOS platform, but this target supports 11.0 (in target 'SwiftLintCore' from project 'SwiftLint')
❌ error: The package product 'SwiftSyntaxBuilder' requires minimum platform version 13.0 for the iOS platform, but this target supports 11.0 (in target 'SwiftLintCore' from project 'SwiftLint')

@Devenias
Copy link

I have the same problem after updating the Plugin from version 0.50.3 to 0.52.4.
I can't even build locally anymore after updating the homebrew swiftlint package to 0.52.4

@konrad1977
Copy link
Contributor

I also got the same error when building using xcodebuild but not from Xcode. -skipPackagePluginValidation doesn't make any different either.

@furkanvatandas
Copy link

Same problem in 0.52.4

@KaitoMuraoka
Copy link
Contributor

This area seems suspicious.

SwiftLint/Package.swift

Lines 51 to 55 in edb16bd

.product(name: "SwiftIDEUtils", package: "swift-syntax"),
.product(name: "SwiftOperators", package: "swift-syntax"),
.product(name: "SwiftParser", package: "swift-syntax"),
.product(name: "SwiftSyntax", package: "swift-syntax"),
.product(name: "SwiftSyntaxBuilder", package: "swift-syntax"),

Is it a bad dependency, or is it something wrong with swift-syntax...?

@curia-damiano
Copy link

+1

@ilonashub
Copy link

same issue here... anyone found a workaround?

@Samback
Copy link

Samback commented Oct 11, 2023

+1

@SimplyDanny
Copy link
Collaborator

Does #3073 (comment) help?

@Samback
Copy link

Samback commented Oct 11, 2023

@SimplyDanny No. If I did as it was written there, swiftlint simply didn't start, and didn't show any errors

@SimplyDanny
Copy link
Collaborator

SimplyDanny commented Oct 16, 2023

Closing as duplicate of #5208.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integration Issues related to integration of SwiftLint into toolchains.
Projects
None yet
Development

No branches or pull requests

10 participants