Skip to content

Commit

Permalink
chore: fix pod install on linux (#10452)
Browse files Browse the repository at this point in the history
Treats xcode as not installed if not available.
Fixes `yarn setup --build-ios` error on Linux.

This patch will not be needed from `react-native` 0.74 and later:
reactwg/react-native-releases#296

## **Description**

## **Related issues**

## **Manual testing steps**


## **Screenshots/Recordings**

### **Before**

### **After**

## **Pre-merge author checklist**

- [x] I’ve followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.

---------

Co-authored-by: user <user@example.com>
Co-authored-by: LeoTM <1881059+leotm@users.noreply.github.com>
  • Loading branch information
3 people authored Jul 31, 2024
1 parent 95fd5df commit 7e54c9c
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions patches/react-native+0.72.15.patch
Original file line number Diff line number Diff line change
Expand Up @@ -241,3 +241,44 @@ index 0000000..e69de29
diff --git a/node_modules/react-native/ReactCommon/react/renderer/components/rncore/States.h b/node_modules/react-native/ReactCommon/react/renderer/components/rncore/States.h
new file mode 100644
index 0000000..e69de29
diff --git a/node_modules/react-native/scripts/cocoapods/utils.rb b/node_modules/react-native/scripts/cocoapods/utils.rb
index 6507f8b..924edd3 100644
--- a/node_modules/react-native/scripts/cocoapods/utils.rb
+++ b/node_modules/react-native/scripts/cocoapods/utils.rb
@@ -354,20 +354,23 @@ class ReactNativePodsUtils
end

def self.is_using_xcode15_0(xcodebuild_manager: Xcodebuild)
- xcodebuild_version = xcodebuild_manager.version
-
- # The output of xcodebuild -version is something like
- # Xcode 15.0
- # or
- # Xcode 14.3.1
- # We want to capture the version digits
- regex = /(\d+)\.(\d+)(?:\.(\d+))?/
- if match_data = xcodebuild_version.match(regex)
- major = match_data[1].to_i
- minor = match_data[2].to_i
- return major == 15 && minor == 0
+ # Catch exception on Linux (fixed in RN 0.74+)
+ begin
+ xcodebuild_version = xcodebuild_manager.version
+
+ # The output of xcodebuild -version is something like
+ # Xcode 15.0
+ # or
+ # Xcode 14.3.1
+ # We want to capture the version digits
+ regex = /(\d+)\.(\d+)(?:\.(\d+))?/
+ if match_data = xcodebuild_version.match(regex)
+ major = match_data[1].to_i
+ minor = match_data[2].to_i
+ return major == 15 && minor == 0
+ end
+ rescue => e
end
-
return false
end

0 comments on commit 7e54c9c

Please sign in to comment.