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

SwiftLint 0.52.3/4: The package product ... requires minimum platform version 13.0 for the iOS platform, but this target supports 11.0 #5208

Closed
2 tasks done
drekka opened this issue Sep 7, 2023 · 17 comments
Labels
integration Issues related to integration of SwiftLint into toolchains.

Comments

@drekka
Copy link

drekka commented Sep 7, 2023

New Issue Checklist

Describe the bug

So we added the SwiftLint plugin to the app project and also the SPM modules Package.swift file. We then checked the project target version was iOS16.1 and specified that in the platforms section of the Package.swift file.

This all works well within Xcode.

However when we started building our CI scripts and running xcodebuild the compilation fails with a stream of messages about the minimum OS target version being 11. For example:

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')
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')

And of course a whole bunch of compilation failures due to various APIs such as async/await not being available in iOS11.

I've tried running xcodebuild from the command line like this:

xcodebuild -workspace Rhythm.xcworkspace -scheme Application -configuration Debug -sdk iphonesimulator16.4 -destination 'platform=iOS Simulator,name=iPhone 14,OS=16.4'  -skipPackagePluginValidation clean build

But no luck and no change.

I dumped out the SPM dependencies which look like this:

.
├── vexil<https://github.com/unsignedapps/Vexil@2.2.1>
├── factory<https://github.com/hmlongco/Factory@2.1.5>
├── swift-markdown-ui<https://github.com/gonzalezreal/swift-markdown-ui@2.1.0>
├── swiftlint<https://github.com/realm/SwiftLint@0.52.3>
│   ├── swift-argument-parser<https://github.com/apple/swift-argument-parser.git@1.2.2>
│   ├── swift-syntax<https://github.com/apple/swift-syntax.git@509.0.0-swift-DEVELOPMENT-SNAPSHOT-2023-06-17-a>
│   ├── sourcekitten<https://github.com/jpsim/SourceKitten.git@0.34.1>
│   │   ├── swift-argument-parser<https://github.com/apple/swift-argument-parser.git@1.2.2>
│   │   ├── swxmlhash<https://github.com/drmohundro/SWXMLHash.git@7.0.2>
│   │   └── yams<https://github.com/jpsim/Yams.git@5.0.6>
│   ├── yams<https://github.com/jpsim/Yams.git@5.0.6>
│   ├── swiftytexttable<https://github.com/scottrhoyt/SwiftyTextTable.git@0.9.0>
│   ├── collectionconcurrencykit<https://github.com/JohnSundell/CollectionConcurrencyKit.git@0.2.0>
│   └── cryptoswift<https://github.com/krzyzanowskim/CryptoSwift.git@1.7.2>
├── rive-ios<https://github.com/rive-app/rive-ios@4.0.3>
|...

Suspecting from the errors that the root problem was something SwiftLint depended on. I then removed SwiftLint and the command line builds started working.

Environment

  • SwiftLint version: 0.52.3 & 0.52.4
  • Installation method: SPM
  • Are you using [nested configurations]: No
  • Which Xcode version are you using: 14.3.1
@SimplyDanny SimplyDanny added the integration Issues related to integration of SwiftLint into toolchains. label Sep 7, 2023
@curia-damiano
Copy link

+1

@drekka drekka changed the title Use of plugin in Swift Package Manager Package.swift file fails xcodebuild SwiftLint 0.52.3/4: The package product ... requires minimum platform version 13.0 for the iOS platform, but this target supports 11.0 Sep 20, 2023
@dvanluijpen
Copy link

Confirmed on our Azure DevOps CI/CD as well

@curia-damiano
Copy link

FYI my issue #5228 has been solved with the release of 0.53.0.

I close my own issue.........

@vadimbelyaev
Copy link

Still reproducible for me with SwiftLint 0.53.0 and Xcode 15.0 when trying to execute test for a package with xcodebuild:

xcodebuild test -scheme MyPackageScheme -sdk iphonesimulator17.0 -destination "OS=17.0,name=iPhone 15 Pro"

I get almost the same output:

error: The package product 'SwiftIDEUtils' requires minimum platform version 13.0 for the iOS platform, but this target supports 12.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 12.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 12.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 12.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 12.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 12.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 12.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 12.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 12.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 12.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 12.0 (in target 'SwiftLintCore' from project 'SwiftLint')
error: The package product 'SwiftIDEUtils' requires minimum platform version 13.0 for the iOS platform, but this target supports 12.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 12.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 12.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 12.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 12.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 12.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 12.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 12.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 12.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 12.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 12.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 12.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 12.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 12.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 12.0 (in target 'SwiftLintExtraRules' from project 'SwiftLint')

Once I remove SwiftLint from package dependencies, everything starts working, but I really want to run SwiftLint on CI for PR builds.

@ilonashub
Copy link

same for me, SwiftLint 0.53.0 and Xcode 14.3

@curia-damiano
Copy link

So I am lucky. But I use Xcode 15.0.

@vadim-belyaev-appex
Copy link

@curia-damiano, just out of curiosity: did you have these errors while building an app or a standalone Swift package?

@curia-damiano
Copy link

curia-damiano commented Oct 5, 2023

Yes, identical error messages, in fact I've opened issue #5228.

As said, even my issue was not closed (I have closed it myself), but I've seen and tested release 0.53.0, and under Xcode 15.0, it works fine to me.

@curia-damiano
Copy link

FYI I reopen my issue because on a different project I get exactly the same error, even with 0.53.0

@drekka
Copy link
Author

drekka commented Oct 16, 2023

v0.53.0 hasn't fixed it over here. Only updated the error to say it requires support for iOS 12 instead of 11. So improved I guess, but definitely NOT fixed.

@jpsim
Copy link
Collaborator

jpsim commented Oct 16, 2023

Please read the error messages that Xcode is providing carefully. Your projects are configured in such a way that Xcode is attempting to build SwiftLint for iOS, which will not compile. SwiftLint supports building and running on macOS and Linux only.

This appears to be a common mistake. Please try this suggestion to see if it helps: #3073 (comment)

@marchinram
Copy link

You probably only want to add the plugin to run swiftlint during builds for your app target but added the Swiftlint frameworks to your app target by mistake. Make sure to remove them from Framework and Libraries.

Screenshot 2023-11-03 at 5 32 27 PM

@theoks
Copy link

theoks commented Nov 29, 2023

I have the exact same issue with Azure, and I haven't added any SwiftLint products in the target. It's only added as a plugin during build phase, but still, I get the same error.

@Jaron-Lowe
Copy link

Seeing the same issue using Github Actions. We're not using the plugin with an app project and Swiftlint has not been added to the app target. We're only using the SPM plugin with some local packages. Tried with 0.54.0 and 0.53.0 on swift 5.9, iOS 15.

error: The package product 'SwiftIDEUtils' requires minimum platform version 13.0 for the iOS platform, but this target supports 12.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 12.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 12.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 12.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 12.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 12.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 12.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 12.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 12.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 12.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 12.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 12.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 12.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 12.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 12.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 12.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 12.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 12.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 12.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 12.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 12.0 (in target 'SwiftLintCore' from project 'SwiftLint')
error: The package product 'SwiftIDEUtils' requires minimum platform version 13.0 for the iOS platform, but this target supports 12.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 12.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 12.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 12.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 12.0 (in target 'SwiftLintExtraRules' from project 'SwiftLint')
Testing failed:

The package product 'SwiftIDEUtils' requires minimum platform version 13.0 for the iOS platform, but this target supports 12.0
The package product 'SwiftOperators' requires minimum platform version 13.0 for the iOS platform, but this target supports 12.0
The package product 'SwiftParser' requires minimum platform version 13.0 for the iOS platform, but this target supports 12.0
The package product 'SwiftSyntax' requires minimum platform version 13.0 for the iOS platform, but this target supports 12.0
The package product 'SwiftSyntaxBuilder' requires minimum platform version 13.0 for the iOS platform, but this target supports 12.0
The package product 'CollectionConcurrencyKit' requires minimum platform version 13.0 for the iOS platform, but this target supports 12.0
Testing cancelled because the build failed.

@Jaron-Lowe
Copy link

Jaron-Lowe commented Feb 12, 2024

@jpsim It's looking like this issue is completely resolved for me on main. Do we know if there is any plan to cut another release for SPM so we can get the fix?

@EKukarskiy
Copy link

EKukarskiy commented Mar 13, 2024

@FilipeNMarques
Copy link

You probably only want to add the plugin to run swiftlint during builds for your app target but added the Swiftlint frameworks to your app target by mistake. Make sure to remove them from Framework and Libraries.

Screenshot 2023-11-03 at 5 32 27 PM

That's it, thank you!

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