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

Add -packageAuthorizationProvider flag for xcodebuild #22227

Merged
merged 6 commits into from
Sep 26, 2024

Conversation

yarneo
Copy link
Contributor

@yarneo yarneo commented Sep 17, 2024

Checklist

  • I've run bundle exec rspec from the root directory to see all new and existing tests pass
  • I've followed the fastlane code style and run bundle exec rubocop -a to ensure the code style is valid
  • I see several green ci/circleci builds in the "All checks have passed" section of my PR (connect CircleCI to GitHub if not)
  • I've read the Contribution Guidelines
  • I've updated the documentation if necessary.
  • I've added or updated relevant unit tests.

Motivation and Context

With the new Xcode 16 RC, we have seen hangs in our project when resolving dependencies due to a new flag to xcodebuild that chooses the correct packageAuthorizationProvider when checking out packages.

Quoting from Apple's Xcode 16 RC release notes:
"Fixed: The new xcodebuild flag of -packageAuthorizationProvider keychain|netrc can now be used to force usage of keychain or netrc as the authorizaion provider. This improves Xcode’s package registry support. (118898849)"
Xcode 16 RC Release Notes

This adds an option for users to choose what authorization provider (i.e. netrc / keychain). This resolves all our hang issues and has been tested locally in our product.

Description

This PR adds a packageAuthorizationProvider option for xcodebuild to set a string with the correct authorization provider. This can be used like so:

run_tests(
        project: "Example.xcodeproj",
       ...
        package_authorization_provider: "netrc"   
    )

Testing Steps

Please run an example app and use package_authorization_provider: "netrc" as an option, and make sure that when resolving dependencies, there is the -packageAuthorizationProvider netrc as part of the xcodebuild:
xcodebuild -resolvePackageDependencies -scheme Foo -project Example.xcodeproj -packageAuthorizationProvider netrc

@yarneo
Copy link
Contributor Author

yarneo commented Sep 17, 2024

@joshdholtz @rogerluan would love your review and a potential patch release when you have the time; without this fix, it is currently hanging our CI, and i'm sure others will be coming out the woodwork soon when they move to Xcode 16 if they have private frameworks being fetched with SPM that need authorization.

Copy link
Collaborator

@revolter revolter left a comment

Choose a reason for hiding this comment

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

Thank you for fixing this issue 🙏🏻

Due to time constraints, I didn't actually download Xcode 16 and test this, but having a test and just by looking at the changes, I'm pretty confident that there should be no breaking changes, as it only adds a new and optional option (😅) to gym, scan, and snapshot.

Only left one small note for an inconsistent environment variable name, which I consider a blocker.

snapshot/lib/snapshot/options.rb Outdated Show resolved Hide resolved
Copy link
Contributor

@lucgrabowski lucgrabowski left a comment

Choose a reason for hiding this comment

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

Many thanks 🙏 for adding this fix 🚀 , I've added one comment. Could you please take a look at it :)?

Co-authored-by: iulianOnofrei (U-lee-aan) <5748627+revolter@users.noreply.github.com>
@yarneo
Copy link
Contributor Author

yarneo commented Sep 26, 2024

Appreciate the reviews 🙏

@lucgrabowski lucgrabowski merged commit b0f4b18 into fastlane:master Sep 26, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants