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

Support Swift 6/Xcode 16 #828

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

SimplyDanny
Copy link
Contributor

@SimplyDanny SimplyDanny commented Nov 30, 2024

14.x versions are no longer available on macOS 14 images as can be seen in a recent PR build.

Building successfully with Xcode 16 requires to update a few test dependencies. It especially seems to have issues parsing files with unknown dependencies now.

@SimplyDanny SimplyDanny changed the title Update Xcode versions to tests Update Xcode versions to test Nov 30, 2024
@SimplyDanny SimplyDanny force-pushed the update-xcode branch 3 times, most recently from 8d16e9a to d3fa1ed Compare December 1, 2024 00:35
@SimplyDanny SimplyDanny changed the title Update Xcode versions to test Support Swift 6/Xcode 16 Dec 1, 2024
@SimplyDanny
Copy link
Contributor Author

Hey @johnfairh! I'd appreciate your feedback on this PR and the other PRs building on top of it. 🙏

@johnfairh
Copy link
Collaborator

All the attribute / version / fixtures stuff looks good - the way I handled the WinSDK issue before is to shim them enough to make macOS SourceKit happy with the types. In hindsight I ought to have added a comment to the failing test as well...

I think this a bit more future-proof than rummaging through the json & keeping track of which / how many errors we expect - if the windows people do get interested in sourcekitten again then maybe they can centralise the shims or figure out a better approach. This at the top of WindowsError.swift means the testLibraryWrappersAreUpToDate() test runs unchanged:

#if !os(Windows)
// Shims for !windows SourceKit - see LibraryWrapperGeneratorTests.testLibraryWrappersAreUpToDate
private typealias WORD = UInt
private typealias DWORD = WORD
private typealias WCHAR = WORD
private let FORMAT_MESSAGE_ALLOCATE_BUFFER = 0
private let FORMAT_MESSAGE_FROM_SYSTEM = 0
private let FORMAT_MESSAGE_IGNORE_INSERTS = 0
private func FormatMessageW(_ a: DWORD, _ b: Int?, _ c: DWORD, _ d: DWORD, _ e: Any?, _ f: Int, _ g: Int?) -> DWORD { 0 }
#endif

@SimplyDanny
Copy link
Contributor Author

All the attribute / version / fixtures stuff looks good - the way I handled the WinSDK issue before is to shim them enough to make macOS SourceKit happy with the types. In hindsight I ought to have added a comment to the failing test as well...

I think this a bit more future-proof than rummaging through the json & keeping track of which / how many errors we expect - if the windows people do get interested in sourcekitten again then maybe they can centralise the shims or figure out a better approach. This at the top of WindowsError.swift means the testLibraryWrappersAreUpToDate() test runs unchanged:

#if !os(Windows)
// Shims for !windows SourceKit - see LibraryWrapperGeneratorTests.testLibraryWrappersAreUpToDate
private typealias WORD = UInt
private typealias DWORD = WORD
private typealias WCHAR = WORD
private let FORMAT_MESSAGE_ALLOCATE_BUFFER = 0
private let FORMAT_MESSAGE_FROM_SYSTEM = 0
private let FORMAT_MESSAGE_IGNORE_INSERTS = 0
private func FormatMessageW(_ a: DWORD, _ b: Int?, _ c: DWORD, _ d: DWORD, _ e: Any?, _ f: Int, _ g: Int?) -> DWORD { 0 }
#endif

Thank you for the tip. That works without changes in the test.

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.

2 participants