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 readlink -f flag to CocoaPods script to workaround Xcode 14.3 issue #124062

Merged
merged 3 commits into from Apr 3, 2023

Conversation

jmagman
Copy link
Member

@jmagman jmagman commented Apr 3, 2023

Xcode 14.3 (released March 30, 2023) changed the readlink symlink behavior to be relative from the script working directory, instead of the relative path of the symlink. A CocoaPods script generated as source="$(readlink "${source}")" but with the new behavior should be source="$(readlink -f "${source}")". CocoaPods updated their script at CocoaPods/CocoaPods#11828, but hasn't yet released it.

This caused a failure when archiving/flutter build ipaing iOS or macOS Flutter apps (build seems to succeed):

    Symlinked...
    rsync --delete -av --filter P .*.?????? --links --filter "- CVS/" --filter
    "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter
    "- PrivateHeaders" --filter "- Modules"
    "../../../IntermediateBuildFilesPath/UninstalledProducts/iphoneos/url_launch
    er_ios.framework"
    "/Users/m/Library/Developer/Xcode/DerivedData/Runner-gnengnkipgqsumexkv
    wkdczgvrst/Build/Intermediates.noindex/ArchiveIntermediates/Runner/Installat
    ionBuildProductsLocation/Applications/Runner.app/Frameworks"
    building file list ... rsync: link_stat

Add a migrator to copy the CocoaPods workaround and update the generated CocoaPods script so that users don't need to update CocoaPods when they update to Xcode 14.3. Only run the migrator when Xcode >=14.3.

Confirmed on this PR:

  • iOS apps can be archived successfully on Xcode 14.3
  • macOS apps can be archived successfully on Xcode 14.3
  • the migrator doesn't run on 14.2
  • the migration only runs once on 14.3
  • after run once, subsequent runs do not kick off a new pod install
  • manually running pod install again after the migration does restore the old behavior, but running flutter build/run again will re-run the migrator.

Fixes #123890

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I signed the CLA.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@jmagman jmagman added platform-ios iOS applications specifically tool Affects the "flutter" command-line tool. See also t: labels. platform-mac Building on or for macOS specifically t: xcode "xcodebuild" on iOS and general Xcode project management labels Apr 3, 2023
@jmagman jmagman self-assigned this Apr 3, 2023
Copy link
Contributor

@vashworth vashworth left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@christopherfujino christopherfujino left a comment

Choose a reason for hiding this comment

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

LGTM

@jmagman jmagman added the autosubmit Merge PR when tree becomes green via auto submit App label Apr 3, 2023
@jmagman jmagman merged commit d4934fb into flutter:master Apr 3, 2023
122 of 123 checks passed
@jmagman jmagman deleted the cocoapods-readlink branch April 3, 2023 23:55
itsjustkevin pushed a commit that referenced this pull request Apr 4, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 4, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 4, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 4, 2023
@JanobRais JanobRais mentioned this pull request Apr 14, 2023
8 tasks
exaby73 pushed a commit to NevercodeHQ/flutter that referenced this pull request Apr 17, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 10, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosubmit Merge PR when tree becomes green via auto submit App platform-ios iOS applications specifically platform-mac Building on or for macOS specifically t: xcode "xcodebuild" on iOS and general Xcode project management tool Affects the "flutter" command-line tool. See also t: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upgrading to Xcode 14.3 breaks iOS app publishing: link_stat failed: No such file or directory
3 participants