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

Prevent build errors for GoogleSignInSwift when using SPM #157

Merged
merged 2 commits into from
May 27, 2022
Merged

Conversation

petea
Copy link
Contributor

@petea petea commented May 26, 2022

Because SPM does not support target-specific platform min versions, our GoogleSignInSwift target is built for both arm64 and armv7. The armv7 stage of the build fails with missing SwiftUI symbol errors. The armv7 slice is unnecessary as this target can only be used on iOS 13+. This change works around the problem by preventing the armv7 build stage from doing any work.

@petea petea marked this pull request as ready for review May 26, 2022 16:59
@petea petea linked an issue May 26, 2022 that may be closed by this pull request
@petea petea requested a review from paulb777 May 26, 2022 17:01
Copy link
Member

@paulb777 paulb777 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kind of ugly, but I suppose it works.

We avoided the arm7/SPM issue in Firebase by requiring iOS 11 for SPM since SPM users don't have the legacy requirements of CocoaPods and haven't seen any complaints. https://github.com/firebase/firebase-ios-sdk/blob/master/Package.swift#L26

@petea
Copy link
Contributor Author

petea commented May 26, 2022

Kind of ugly, but I suppose it works.

Unfortunately #if canImport(SwiftUI) succeeds in the armv7 scenario here, so that wasn't an option. I'd much prefer a SPM solution but I'm not seeing one short of moving the target into a separate repo and package.

@petea petea added this to the 6.2.2 milestone May 26, 2022
@gmogames
Copy link

@petea do you think this will get merged and the 6.2.2 released today? This is breaking our ci pipelines for some of our environments and would be very good to have it merged before the holiday next week. Thank you!

@petea
Copy link
Contributor Author

petea commented May 27, 2022

@gmogames we're aiming to release 6.2.2 in the next few hours.

@gmogames
Copy link

Thank you!

@petea
Copy link
Contributor Author

petea commented May 27, 2022

@gmogames note that, as long as you're not using the new SwiftUI button, you can also remove the GoogleSignInSwift library from your project as SPM may have added it automatically.

@petea petea merged commit 47b7163 into main May 27, 2022
@gentges
Copy link

gentges commented May 31, 2022

Unfortunately I have to report that everything works fine for me as long as the build configuration is set to "Debug". As soon as I switch to "Release" I get the same errors again. Is there something I'm overlooking on my side? Or can you recreate this behaviour?

@petea
Copy link
Contributor Author

petea commented May 31, 2022

@macintosh-HD I'm not able to recreate this, having looked briefly. Building with a release configuration using Archive or otherwise is working as expected for me. Can you provide detailed repro steps and tell me more about what you're building? Also, can you verify that you're using the latest 6.2.2 release?

@gentges
Copy link

gentges commented Jun 1, 2022

Hey @petea!
I did some more testing but the problem remains.
I am using the sign-in button on a SwiftUI view in a project with a minimum deployment target of iOS 14.
19 issues appear from the GoogleSignInSwift module during compilation with a Release build configuration. All of them are missing SwiftUI symbol errors in the GoogleSignInButton.swift file.
I upgraded the package dependencies, removed the derived data folder and cleared the build folder. The package version is definitely 6.2.2.
What is interesting about this problem is that it only appears when I try to build&run on the simulator (iPhone 13 Pro iOS 15.5 - Release configuration). When I switch to build&run on my physical device instead or use a debug build configuration the errors disappear.
For your information I'm running the simulator on an Intel based MacBook (x86_64) if that is relevant.

MacOS 12.4, Xcode 13.4

@petea
Copy link
Contributor Author

petea commented Jun 1, 2022

@macintosh-HD thanks for bringing this to my attention. I've now been able to repo and a fix is on the way.

@petea petea deleted the petea-arm branch August 30, 2022 23:28
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.

GoogleSignInSwift build errors for Archive and SwiftUI Preview
5 participants