fix: SPM manifest compilation on Swift 6.1#7800
Open
WhiteHyun wants to merge 1 commit intogetsentry:v8.xfrom
Open
fix: SPM manifest compilation on Swift 6.1#7800WhiteHyun wants to merge 1 commit intogetsentry:v8.xfrom
WhiteHyun wants to merge 1 commit intogetsentry:v8.xfrom
Conversation
|
This PR has been automatically closed. All non-maintainer contributions must reference an existing GitHub issue. Next steps:
Please review our contributing guidelines for more details. |
Contributor
Semver Impact of This PR🟢 Patch (bug fixes) 📋 Changelog PreviewThis is how your changes will appear in the changelog. Bug Fixes 🐛
🤖 This preview updates automatically when you update the PR. |
`String(cString:encoding:)` is a Foundation extension on `String`
and is not available in the SwiftPM manifest context, where only
`PackageDescription` is imported. On Swift 6.1 / Xcode 16+,
`swift package resolve` now fails with:
error: extra argument 'encoding' in call
Use the stdlib `String(cString:)` initializer, which already
decodes as UTF-8 and matches the original intent.
7f1a959 to
1f578da
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📜 Description
Remove the
encoding:argument fromString(cString:)inPackage@swift-6.1.swiftso the manifest compiles on Swift 6.1 / Xcode 16+.💡 Motivation and Context
String(cString:encoding:)is a Foundation extension onStringand is not available in the manifest context. On Swift 6.1 / Xcode 16+, manifest compilation fails with:This breaks
swift package resolvefor downstream projects consuming affected 8.x versions on Xcode 16+.The stdlib
String(cString:)already decodes the C string as UTF-8, so behavior is preserved.Fixes #7797
💚 How did you test it?
swift package dump-packagenow succeeds on Xcode 16 / Swift 6.1.No unit tests added — this is a manifest-only change, and the current
test/CI setup does not include a dedicated manifest-compilation check.
📝 Checklist
sendDefaultPIIis enabled.