Fix native macOS build by excluding SwiftUI WebAuthenticationSession#61
Conversation
|
Hey, thanks for reporting this. Do you understand why this is the case? I'm trying to figure it out and I do not understand what exactly is going wrong here. |
|
I've done some research here, and the problem turns out to be non-trivial. But this does need to be available to macOS targets and this is (apparently) how it is done: #if canImport(_AuthenticationServices_SwiftUI)
import AuthenticationServices
import SwiftUI
import _AuthenticationServices_SwiftUI
// ...Something about how the AuthenticationServices framework is integrated with SwiftUI is weird and/or exposing a bug. |
|
also, what version of Xcode (swift toolchain) did you notice this problem with? |
I don't understand the compiler or build system enough to understand why.
Xcode Since I don't currently need macOS support I am happy to just use my fork's branch. Feel free to close out this PR if you think it is the wrong approach. This bug really broke my brain. I think it is the first time I had code that could compile with Xcode but not |
|
I pushed up what I think is a more robust workaround, but I'm 75% sure this should should just have been working as it was before. Something's up but my patience for figuring it out has expired... |
|
Thanks @mattmassicotte |
WebAuthenticationSession+Utility.swiftdoesn't compile when building fornative macOS, breaking
swift buildon a Mac and any SwiftPM consumerthat resolves OAuthenticator for the macOS host.
It builds no problem in Xcode but
swift buildfails.