Skip to content

Fix build failures for Swift 5#874

Merged
natecook1000 merged 4 commits intoapple:mainfrom
kphrx:patch-1
Mar 18, 2026
Merged

Fix build failures for Swift 5#874
natecook1000 merged 4 commits intoapple:mainfrom
kphrx:patch-1

Conversation

@kphrx
Copy link
Contributor

@kphrx kphrx commented Mar 11, 2026

fix #870

This fixes build failures caused by:

Checklist

  • I've added at least one test that validates that my change is working, if appropriate
  • I've followed the code style of the rest of the project
  • I've read the Contribution Guidelines
  • I've updated the documentation if necessary

@kphrx kphrx changed the title Fix unknown target type on swift 5.8 Fix unknown target type in Swift 5.8 Mar 11, 2026
refs apple#803

`swift package resolve` in Swift 5.8.x:

```
Computing version for https://github.com/apple/swift-argument-parser.git
error: Invalid manifest (compiled with: ["/usr/bin/swiftc", "-vfsoverlay", "/tmp/TemporaryDirectory.HCuAi3/vfs.yaml", "-L", "/usr/lib/swift/pm/ManifestAPI", "-lPackageDescription", "-Xlinker", "-rpath", "-Xlinker", "/usr/lib/swift/pm/ManifestAPI", "-swift-version", "5", "-I", "/usr/lib/swift/pm/ManifestAPI", "-package-description-version", "5.8.0", "/Package@swift-5.8.swift", "-Xfrontend", "-disable-implicit-concurrency-module-import", "-Xfrontend", "-disable-implicit-string-processing-module-import", "-o", "/tmp/TemporaryDirectory.RLkqp3/swift-argument-parser-manifest"])
/Package@swift-5.8.swift:149:9: error: type 'Target.TargetType' has no member 'macro'
  case .macro, .plugin, .system, .binary:
       ~^~~~~ in https://github.com/apple/swift-argument-parser.git
```
@kphrx kphrx marked this pull request as draft March 12, 2026 09:06
kphrx added 2 commits March 12, 2026 18:08
fix apple#870

refs apple#804

If you want without compiler conditional import, enable `InternalImportsByDefault` upcoming feature and remove `internal` from imports.
@kphrx kphrx changed the title Fix unknown target type in Swift 5.8 Fix for Swift 5 Mar 12, 2026
@kphrx kphrx marked this pull request as ready for review March 12, 2026 09:23
@kphrx kphrx changed the title Fix for Swift 5 Fix build failures for Swift 5 Mar 12, 2026
@rgoldberg
Copy link
Contributor

rgoldberg commented Mar 12, 2026

My PR #855 removes the usage of Dispatch.DispatchSemaphore, so many of the changes in this PR would be unnecessary if my PR is merged.

Given that my PR improves functionality & that many changes in this PR conflict with my PR, I think it makes sense to try to merge mine first, then rebase this PR so it fixes only the remaining Swift 5 build issues.

@natecook1000
Copy link
Member

@rgoldberg I'm planning to land this PR first, so that we can have one more patch release with the current supported list of Swift versions. In the next minor release I'd like to raise the minimum to Swift 6 to cut down on the level of testing/support.

@rgoldberg
Copy link
Contributor

@natecook1000 Would't bumping the minimum Swift version require a new major version for semantic versioning? Does SAP not use semantic versioning?

@natecook1000
Copy link
Member

Swift Package Manager resolves packages with an understanding of which Swift versions are supported, so for Swift versions prior to 6.0, they'll just see 1.7.1 as the last available version.

@natecook1000 natecook1000 merged commit d18164c into apple:main Mar 18, 2026
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Version 1.7.0 fails to build on Swift 5.9

3 participants