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

Bump to Xcode 14.3 and swift 5.8 #198

Merged
merged 42 commits into from
Sep 18, 2023
Merged

Bump to Xcode 14.3 and swift 5.8 #198

merged 42 commits into from
Sep 18, 2023

Conversation

KunJeongPark
Copy link
Collaborator

Summary of changes

  • Bump to Xcode 14.3 and Swift 5.8 for our GA release

Checklist

  • Added a changelog entry

Authors

@KunJeongPark KunJeongPark requested a review from a team as a code owner September 12, 2023 15:18
README.md Outdated
@@ -11,7 +11,7 @@ As the SDK is moved to general availability, we will be adding a contribution gu

## Support

The PayPal iOS SDK supports a minimum deployment target of iOS 14+ and requires Xcode 14.0+ and macOS Monterey 12. See our [Client Deprecation policy](https://developer.paypal.com/braintree/docs/guides/client-sdk/deprecation-policy/ios/v5) to plan for updates.
The PayPal iOS SDK supports a minimum deployment target of iOS 14+ and requires Xcode 14.3+ and macOS Monterey 13. See our [Client Deprecation policy](https://developer.paypal.com/braintree/docs/guides/client-sdk/deprecation-policy/ios/v5) to plan for updates.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
The PayPal iOS SDK supports a minimum deployment target of iOS 14+ and requires Xcode 14.3+ and macOS Monterey 13. See our [Client Deprecation policy](https://developer.paypal.com/braintree/docs/guides/client-sdk/deprecation-policy/ios/v5) to plan for updates.
The PayPal iOS SDK supports a minimum deployment target of iOS 14+ and requires Xcode 14.3+ and macOS Ventura 13. See our [Client Deprecation policy](https://developer.paypal.com/braintree/docs/guides/client-sdk/deprecation-policy/ios/v5) to plan for updates.

@KunJeongPark
Copy link
Collaborator Author

KunJeongPark commented Sep 12, 2023

Can't figure out why Build/Swift Package Manager is failing. This is the step where the SPMTest Xcode project
tries to get PayPal package with native checkout dependency.

This is the error I see:

 xcodebuild: error: Could not resolve package dependencies:
  product 'PayPalCheckout' required by package 'paypal-ios' target 'PayPalNativePayments' not found.

=> So far, I've found correcting capitalization in build.yml file and using macOS-13 instead of macOS-latest with Swift version 5.7 passed the pipeline. I don't know why bumping the version to 5.8 causes error, same one above.

If I specify Swift 5.8
I get the output below before the error:
Run xcodebuild -project 'SampleApps/SPMTest/SPMTest.xcodeproj' -scheme 'SPMTest' clean build archive CODE_SIGNING_ALLOWED=NO
2023-09-15 16:09:50.319 xcodebuild[2050:10546] DVTCoreDeviceEnabledState: DVTCoreDeviceEnabledState_Disabled set via user default (DVTEnableCoreDevice=disabled)
Command line invocation:
/Applications/Xcode_14.3.1.app/Contents/Developer/usr/bin/xcodebuild -project SampleApps/SPMTest/SPMTest.xcodeproj -scheme SPMTest clean build archive CODE_SIGNING_ALLOWED=NO

Will try 14.3.1 with 5.8
If this fails, it might be that the new Swift 5.8 expects latest parameters for .package(url:..)
I've tried the name in the dependency for PayPalCheckout as defined in Package.swift for native checkout and also its
name in the url "paypalcheckout-ios" and they both fail.

This also caused an error
and
14.3 with 5.8 with new arguments also caused an error.

Output:
Run xcodebuild -project 'SampleApps/SPMTest/SPMTest.xcodeproj' -scheme 'SPMTest' clean build archive CODE_SIGNING_ALLOWED=NO
2023-09-15 17:42:08.399 xcodebuild[3166:16506] DVTCoreDeviceEnabledState: DVTCoreDeviceEnabledState_Disabled set via user default (DVTEnableCoreDevice=disabled)
Command line invocation:
/Applications/Xcode_14.3.1.app/Contents/Developer/usr/bin/xcodebuild -project SampleApps/SPMTest/SPMTest.xcodeproj -scheme SPMTest clean build archive CODE_SIGNING_ALLOWED=NO

User defaults from command line:
IDEPackageSupportUseBuiltinSCM = YES

Build settings from command line:
CODE_SIGNING_ALLOWED = NO

Resolve Package Graph

Fetching from https://github.com/paypal/paypal-ios

Fetching from https://github.com/paypal/paypalcheckout-ios (cached)

Creating working copy of package ‘paypal-ios’

Checking out bumpXcode14_3 of package ‘paypal-ios’

Creating working copy of package ‘paypalcheckout-ios’

Checking out 1.1.0 of package ‘paypalcheckout-ios’

product 'paypalcheckout-ios' required by package 'paypal-ios' target 'PayPalNativePayments' not found.
2023-09-15 17:43:58.421 xcodebuild[3166:16506] Writing error result bundle to /var/folders/k1/d12mwq8j1qs35vb23_t_y72h0000gn/T/ResultBundle_2023-15-09_17-43-0058.xcresult
Resolved source packages:
PayPal: https://github.com/paypal/paypal-ios @ bumpXcode14_3
PayPalCheckout: https://github.com/paypal/paypalcheckout-ios @ 1.1.0

xcodebuild: error: Could not resolve package dependencies:
product 'paypalcheckout-ios' required by package 'paypal-ios' target 'PayPalNativePayments' not found.

Error: Process completed with exit code 74.

@scannillo
Copy link
Collaborator

This SDK supports Swift 5.7+. This SDK is written in Swift.

This line in the README needs to be updated, and this PR also needs a CHANGELOG entry

Copy link
Collaborator

@jaxdesmarais jaxdesmarais left a comment

Choose a reason for hiding this comment

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

👏 nice work troubleshooting the build failures!

@KunJeongPark KunJeongPark merged commit 58c6c71 into main Sep 18, 2023
4 checks passed
@KunJeongPark KunJeongPark deleted the bumpXcode14_3 branch September 18, 2023 15:50
@KunJeongPark
Copy link
Collaborator Author

KunJeongPark commented Sep 18, 2023

Note for future reference.

The issue was when we bumped the Swift version to 5.8, the deprecated function parameters for fetching paypalcheckout-ios didn't work properly. ( .package(name: "PayPalCheckout", url: "https://github.com/paypal/paypalcheckout-ios", .exact("1.1.0"))) When we used the new parameters (.package(url: "https://github.com/paypal/paypalcheckout-ios", from: "1.1.0")), there was no association between the package fetched and the package name declared in the Package.swift of native checkout package. So solution was explicit association of the product and package names in the dependency list for the PayPalNativePayments target.

References:
https://github.com/apple/swift-package-manager/blob/main/CHANGELOG.md#swift-58
https://developer.apple.com/documentation/packagedescription/package/dependency/package(url:branch:)
https://forums.swift.org/t/why-does-swiftpm-use-github-repo-name-and-not-package-swift-name/55085/7

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.

4 participants