Skip to content

Drop Swift 5.10 and stop using deprecated PackagePlugin.Path#882

Merged
simonjbeaumont merged 8 commits into
apple:mainfrom
simonjbeaumont:sb/drop-5.10-stop-using-path
Mar 23, 2026
Merged

Drop Swift 5.10 and stop using deprecated PackagePlugin.Path#882
simonjbeaumont merged 8 commits into
apple:mainfrom
simonjbeaumont:sb/drop-5.10-stop-using-path

Conversation

@simonjbeaumont
Copy link
Copy Markdown
Collaborator

@simonjbeaumont simonjbeaumont commented Mar 20, 2026

Motivation

In #878 we split the manifest for this project so we could have the 6.1+ manifest declare a dependency on swift-openapi-runtime without default traits to support projects that want to avoid linking the full Foundation transitive dependency.

The consequence of this is that the newer manifest lifted the swift-tools-version. There was an attempt to mitigate that by marking the Swift language version as v5 to decouple it from moving to 6. However, what this meant was we started getting warnings in the plugin code because plugin targets cannot have swiftSettings applied to them so they started complaining about the use of the deprecated PackagePlugin.Path APIs.

We previously could not move to URL, as requested by the deprecation warning, because we were still supporting Swift 5.10. But 5.10 dropped out of our support window 6 months ago. We haven't been CI'ing it, but we never lifted the tools version in the package manifest.

We can do that now, and then move to using URL in the plugin code, which should get rid of the warnings.

Modifications

Bump the minimum version of Swift to 6.0. However, we still retain a split manifest because traits are only supported in 6.1+.

Then move to using URL instead of PackagePlugin.Path APIs.

Result

Plugin should stop generating warnings for adopters on 6.1+.

Test Plan

Integration tests still pass. Built locally and no longer see the warnings.

Related

Expect this to fix #881

@simonjbeaumont simonjbeaumont changed the title Sb/drop 5.10 stop using path Drop Swift 5.10 and stop using deprecated PackagePlugin.Path Mar 20, 2026
@simonjbeaumont simonjbeaumont added the 🔨 semver/patch No public API change. label Mar 20, 2026
@simonjbeaumont simonjbeaumont marked this pull request as ready for review March 21, 2026 21:11
@simonjbeaumont simonjbeaumont enabled auto-merge (squash) March 21, 2026 21:11
Comment thread Sources/swift-openapi-generator/GenerateOptions.swift Outdated
@simonjbeaumont simonjbeaumont merged commit 73997cc into apple:main Mar 23, 2026
49 of 50 checks passed
@vdkdamian
Copy link
Copy Markdown

Seems like this created an issue for me where the openapi-generator-config.yaml file can't be found anymore due to my folder containing a space. It tries to find the path but I see it's percent-encoded.

Error: Configuration file not found at path: 
/Volumes/Developer/developer/Documents/Projects/Company/Company%20Project/company-project/Sources/Project/openapi-generator-config.yaml. 
Please ensure the file exists and the path is correct.

I'll rename the folder structure for now. This seems to solve it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🔨 semver/patch No public API change.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Getting several plugin warnings with the new version (1.11.0).

3 participants