-
Notifications
You must be signed in to change notification settings - Fork 29
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
Generated code does not compile with Xcode 14/Swift 5.7 #153
Comments
Hmm interesting. Please can you share some information about your build environment.. Are you using Xcode or
This is actually part of the Get library so it might be that we need to open an issue over there depending on what the problem is. |
I am using swift build and latest stable which is 14.0 |
Thanks, I just tried and I can replicate the same issue but this is related to Get and not CreateAPI itself. It looks like some things might have changed in the latest beta of Xcode. Note that CreateAPI doesn't support Get 2.0 yet so a version of Get 1.0 would also need to be released with a patch for this issue. |
Actually, it looks like Get 2.x fixes the issue. But I wonder if we can get an updated version of Get 1.x that patches this issue too? This is the required diff: diff --git a/Sources/Get/DataLoader.swift b/Sources/Get/DataLoader.swift
index 9bfcc45..e4dca52 100644
--- a/Sources/Get/DataLoader.swift
+++ b/Sources/Get/DataLoader.swift
@@ -150,7 +150,7 @@ final class DataLoader: NSObject, URLSessionDataDelegate, URLSessionDownloadDele
userTaskDelegate?.urlSession?(session, taskIsWaitingForConnectivity: task)
}
-#if swift(>=5.7)
+#if !os(macOS) && !targetEnvironment(macCatalyst) && swift(>=5.7)
func urlSession(_ session: URLSession, didCreateTask task: URLSessionTask) {
if #available(iOS 16.0, macOS 13.0, tvOS 16.0, watchOS 9.0, *) {
handlers[task]?.delegate?.urlSession?(session, didCreateTask: task) cc @kean I opened a separate ticket about moving CreateAPI to Get 2.0, but fixing this in a patch release of Get would help people who already use CreateAPI to use Xcode 14. |
Should I wait for a resolution before trying again? Thanks for your assistance @liamnichols |
Yes, I can release a patch for Get 1.0 as well. I'll do it later today. |
Thanks @kean! @haydgately: Yep, once a patch for Get has been released, you should just be able to clear package caches and it'll pull in the newer version of Get to solve your issue. |
Amazing thanks so much! I will try when it has been released :D @kean @liamnichols |
Should be fixed in Get 1.0.3. |
I tried to reinstall CreateAPI but it is still the same version: Warning: create-api 0.1.0 is already installed and up-to-date. Is there a fix expected here for this to work? |
No need to update CreateAPI, you just need to run If that doesn't work, try deleting the |
Hmm, maybe try deleting Package.resolved? It might have 1.0.2 cached in there. |
Well at least we're making progress 🙂 The errors look very odd to me, I'm not entirely sure what is going on here. Is the project private ? Are you able to share the generated output so I can try running it locally to reproduce the issue? In the meantime, I'm just adding Xcode 14 support to our CI checks to check if any errors show up - #156 |
I just saw your other ticket.. Will close this one and move the conversation over to #155 👍 |
pension_plan_kit/.build/checkouts/Get/Sources/Get/DataLoader.swift:156:50: error: incorrect argument label in call (have ':didCreateTask:', expected ':taskIsWaitingForConnectivity:')
handlers[task]?.delegate?.urlSession?(session, didCreateTask: task)
The text was updated successfully, but these errors were encountered: