Fix CocoaPods crash with nonexistent files #41848
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary:
Xcode Projects can contain files that don't exist until build time. If one of these happens to end with
Info.plist
(as is this case with our project), CocoaPods will crash, sinceutils.rb
tries to patch all of these with ATS stuff. In the case where these files don't exist on disk, this CocoaPods post-install job should simply ignore those file references.Changelog:
[IOS] [FIXED] - Fixed CocoaPods crashing when Xcode project contains non-existent -Info.plist file
Test Plan:
I've refactored the
apply_ats_config
method to also accept afile_manager
param so that the file manager can be mocked in the unit tests. I have confirmed that the unit tests continue to pass, and also when I have applied the changes toutils.rb
in react native in our main project'snode_modules
, apod install
now no longer crashes.