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

fix: eas build failed after changing ruby versions #1428

Merged
merged 7 commits into from
Dec 22, 2024

Conversation

technoplato
Copy link
Collaborator

@technoplato technoplato commented Dec 20, 2024

some ios build dep commentary: https://www.loom.com/share/92489f6b27c544f7be6ae6d3e2a90e89

fixed build: https://expo.dev/accounts/converse/projects/converse/builds/dc0662be-c5cb-4417-bd5d-a82351a7698b

we just recently changed our ios build deps so I'm trying to fix the eas build pipeline now

Summary by CodeRabbit

Summary by CodeRabbit

  • Chores
    • Updated Ruby version specification for compatibility.
    • Updated Bundler version to ensure proper functionality.
    • Added new scripts for cleaning React Native builds and checking iOS build dependencies.
    • Enhanced configuration for iOS build environment in preview stage.

@technoplato technoplato requested a review from a team as a code owner December 20, 2024 20:51
Copy link
Contributor

coderabbitai bot commented Dec 20, 2024

Warning

Rate limit exceeded

@alexrisch has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 27 minutes and 7 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between d79fe09 and 09f4119.

📒 Files selected for processing (5)
  • .github/workflows/check-android-build.yml (1 hunks)
  • .github/workflows/check-ios-build.yml (2 hunks)
  • eas.json (2 hunks)
  • ios/Gemfile (1 hunks)
  • package.json (1 hunks)

Walkthrough

The pull request updates several configuration files for an iOS project, including the Gemfile, .ruby-version, eas.json, and package.json. Key changes involve specifying the Ruby version as ~> 3.2.5 and updating the Bundler version to ~> 2.5.16. Additionally, new scripts for cleaning the React Native build and checking iOS build dependencies are introduced. The eas.json file is modified to include a specific macOS image for the iOS preview build, enhancing the build environment specification.

Changes

File Change Summary
ios/Gemfile - Updated Ruby version specification to ~> 3.2.5
- Modified Bundler gem version to ~> 2.5.16
.ruby-version - Specified Ruby version as 3.2.5
eas.json - Added property "image": "macos-sonoma-14.6-xcode-16.1" in the ios configuration of the preview build
package.json - Added script "clean": "./scripts/reactNativeCleanBuild.sh"
- Added script "ios:checkBuildDeps": "./scripts/ios/checkBuildDeps.sh"
scripts/ios/checkBuildDeps.sh - New script to verify installation and versions of iOS build dependencies
scripts/reactNativeCleanBuild.sh - New script to clean and rebuild the React Native project

Possibly related PRs

Poem

🐰 A Bundler's Hop of Joy
Ruby three-point-two, oh so neat,
With a clean build, we can’t be beat!
Dependencies checked with a happy cheer,
Our iOS project’s ready, never fear! 🌟
A rabbit’s leap to code delight! 🦘


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
ios/Gemfile (1)

6-7: LGTM! Consider enhancing the version comment

The Bundler version specification is correct for Ruby 3.3 compatibility. Consider adding more context to the comment about why this specific version is required.

-# Specify bundler version that works with Ruby 3.3
+# Specify bundler version 2.6.1+ for Ruby 3.3 compatibility and EAS build requirements
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 13b0666 and fd0aa1a.

⛔ Files ignored due to path filters (1)
  • ios/Gemfile.lock is excluded by !**/*.lock
📒 Files selected for processing (1)
  • ios/Gemfile (1 hunks)
🔇 Additional comments (2)
ios/Gemfile (2)

Line range hint 9-11: Consider adding version constraints for cocoapods

While activesupport has proper version constraints, cocoapods and cocoapods-pod-linkage don't have any version specifications. This could lead to unexpected behavior if incompatible versions are installed.

-gem 'cocoapods'
-gem 'cocoapods-pod-linkage'
+gem 'cocoapods', '~> 1.15.0'  # or appropriate version compatible with Ruby 3.3
+gem 'cocoapods-pod-linkage', '~> 1.0'  # specify appropriate version

Let's check the currently used versions and compatibility:

✅ Verification successful

Let me gather more information about the compatibility of CocoaPods 1.16.2 with Ruby versions.


Add version constraint for cocoapods to match the locked version

Based on the verification results:

  • CocoaPods 1.16.2 is currently in use (from Podfile.lock)
  • Ruby 3.3.0 is specified in the Gemfile
  • cocoapods-pod-linkage 0.0.1 is installed and requires cocoapods ~> 1.0

Suggested update:

-gem 'cocoapods'
+gem 'cocoapods', '~> 1.16.2'
gem 'cocoapods-pod-linkage'
gem 'activesupport', '>= 6.1.7.3', '< 7.1.0'

Note: No version constraint needed for cocoapods-pod-linkage as it's already constrained by its dependency on cocoapods.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check for Cocoapods version specifications in Podfile.lock
if [ -f "ios/Podfile.lock" ]; then
  echo "Current Cocoapods version from Podfile.lock:"
  grep -A 1 "COCOAPODS:" ios/Podfile.lock
fi

Length of output: 186


Script:

#!/bin/bash
# Check Ruby version specification in .ruby-version or Gemfile
echo "Checking Ruby version:"
if [ -f ".ruby-version" ]; then
  cat .ruby-version
fi

echo -e "\nChecking Gemfile for Ruby version:"
if [ -f "ios/Gemfile" ]; then
  grep "^ruby" ios/Gemfile
fi

# Check installed cocoapods-pod-linkage version
echo -e "\nChecking Gemfile.lock for cocoapods-pod-linkage version:"
if [ -f "ios/Gemfile.lock" ]; then
  grep -A 2 "cocoapods-pod-linkage" ios/Gemfile.lock
fi

Length of output: 573


3-4: Verify EAS build environment compatibility with Ruby 3.3

Ruby 3.3 is a very recent release. Please ensure that:

  1. The EAS build environment supports Ruby 3.3.x
  2. All gems in the project are compatible with Ruby 3.3.x

Let's check the other Ruby-related dependencies in the project:

✅ Verification successful

Ruby 3.3.0 upgrade appears safe with current EAS configuration

The EAS build configuration specifies CocoaPods version 1.16.2, which is compatible with Ruby 3.3.0. The project has minimal Ruby dependencies (only CocoaPods-related gems), and all specified gems in the Gemfile have versions that work with Ruby 3.3:

  • cocoapods (no version constraint)
  • cocoapods-pod-linkage (no version constraint)
  • activesupport (>=6.1.7.3, <7.1.0)
  • bundler (~> 2.6.1)

These versions are all compatible with Ruby 3.3.0, and the EAS build environment settings don't show any Ruby version restrictions that would conflict with this upgrade.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check for any other Ruby version specifications or dependencies
rg -g '!ios/Gemfile' -l "ruby '[^']*'" .
rg -g '!ios/Gemfile' -l "ruby \"[^\"]*\"" .

Length of output: 94


Script:

#!/bin/bash
# Let's check for any .ruby-version files and other Ruby-related configuration
fd -t f "^\.ruby-version$|^Gemfile$" .

# Check contents of any .ruby-version files
fd -t f "^\.ruby-version$" -x cat {}

# Check all Gemfiles in the project
fd -t f "^Gemfile$" -x cat {}

# Look for any Ruby-related EAS configuration
rg -l "ruby" eas.json

Length of output: 615


Script:

#!/bin/bash
# Let's check EAS configuration files for build environment settings
fd -t f "eas\.json|app\.json" -x cat {}

# Check for any CocoaPods-related version requirements
rg -A 5 -B 5 "platform :ios|source|ruby" ios/Podfile

Length of output: 3154

https://docs.expo.dev/build-reference/infrastructure/#ios-server-images

iOS server images
macos-sonoma-14.6-xcode-16.1
(
latest
,
sdk-52
)
Details
macOS Sonoma 14.6
Xcode 16.1 (16B40)
Node.js 18.18.0
Bun 1.1.33
Yarn 1.22.21
pnpm 9.12.3
npm 9.8.1
fastlane 2.225.0
CocoaPods 1.16.2
Ruby 3.2
node-gyp 10.2.0
Copy link
Contributor

github-actions bot commented Dec 20, 2024

Performance Comparison Report

  • Current: 81d32d3 - 2024-12-22 20:07:59Z
  • Baseline: release/3.0.0 (9119c3e) - 2024-12-22 20:06:39Z

Significant Changes To Duration

There are no entries

Meaningless Changes To Duration

Show entries
Name Type Duration Count
Avatar Image 10 runs render 1.1 ms → 1.2 ms (+0.1 ms, +9.1%) 1 → 1
Avatar Image 50 runs render 1.1 ms → 1.1 ms (-0.0 ms, -3.6%) 1 → 1
Empty Avatar 10 runs render 1.0 ms → 1.1 ms (+0.1 ms, +10.0%) 1 → 1
Empty Avatar 50 runs render 0.8 ms → 0.7 ms (-0.1 ms, -12.5%) 1 → 1
Text Component with color prop - 10 runs render 0.3 ms → 0.0 ms (-0.3 ms, -100.0%) 🟢 1 → 1
Text Component with default props - 10 runs render 0.3 ms → 0.2 ms (-0.1 ms, -33.3%) 🟢 1 → 1
Text Component with translation key - 10 runs render 0.3 ms → 0.2 ms (-0.1 ms, -33.3%) 🟢 1 → 1
Text Component with weight and size - 10 runs render 0.2 ms → 0.2 ms 1 → 1
Show details
Name Type Duration Count
Avatar Image 10 runs render Baseline
Mean: 1.1 ms
Stdev: 0.3 ms (28.7%)
Runs: 1 1 1 1 1 1 1 2 1 1
Warmup runs: 2

Current
Mean: 1.2 ms
Stdev: 0.4 ms (35.1%)
Runs: 1 1 1 1 2 2 1 1 1 1
Warmup runs: 2
Baseline
Mean: 1
Stdev: 0 (0.0%)
Runs: 1 1 1 1 1 1 1 1 1 1
Render issues:

Current
Mean: 1
Stdev: 0 (0.0%)
Runs: 1 1 1 1 1 1 1 1 1 1
Render issues:
Avatar Image 50 runs render Baseline
Mean: 1.1 ms
Stdev: 0.4 ms (33.1%)
Runs: 2 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 0 1
Warmup runs: 1

Current
Mean: 1.1 ms
Stdev: 0.3 ms (29.6%)
Runs: 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 2 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 0 1 1 2 1 1 1
Warmup runs: 2
Baseline
Mean: 1
Stdev: 0 (0.0%)
Runs: 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
Render issues:

Current
Mean: 1
Stdev: 0 (0.0%)
Runs: 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
Render issues:
Empty Avatar 10 runs render Baseline
Mean: 1.0 ms
Stdev: 0.0 ms (0.0%)
Runs: 1 1 1 1 1 1 1 1 1 1
Warmup runs: 3

Current
Mean: 1.1 ms
Stdev: 0.3 ms (28.7%)
Runs: 1 1 1 1 2 1 1 1 1 1
Warmup runs: 3
Baseline
Mean: 1
Stdev: 0 (0.0%)
Runs: 1 1 1 1 1 1 1 1 1 1
Render issues:

Current
Mean: 1
Stdev: 0 (0.0%)
Runs: 1 1 1 1 1 1 1 1 1 1
Render issues:
Empty Avatar 50 runs render Baseline
Mean: 0.8 ms
Stdev: 0.4 ms (50.5%)
Runs: 1 1 1 1 0 1 0 1 0 1 1 1 0 1 1 1 0 1 1 1 1 1 0 0 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1
Warmup runs: 0

Current
Mean: 0.7 ms
Stdev: 0.5 ms (66.1%)
Runs: 1 1 1 1 0 1 1 1 0 1 1 1 1 1 1 1 0 1 1 1 1 1 1 0 0 1 1 1 1 0 1 1 1 1 0 1 0 1 0 1 1 1 1 0 0 1 0 0 0 0
Warmup runs: 0
Baseline
Mean: 1
Stdev: 0 (0.0%)
Runs: 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
Render issues:

Current
Mean: 1
Stdev: 0 (0.0%)
Runs: 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
Render issues:
Text Component with color prop - 10 runs render Baseline
Mean: 0.3 ms
Stdev: 0.5 ms (161.0%)
Runs: 0 0 0 1 0 0 0 1 1 0
Warmup runs: 0

Current
Mean: 0.0 ms
Stdev: 0.0 ms (NaN%)
Runs: 0 0 0 0 0 0 0 0 0 0
Warmup runs: 0
Baseline
Mean: 1
Stdev: 0 (0.0%)
Runs: 1 1 1 1 1 1 1 1 1 1
Render issues:

Current
Mean: 1
Stdev: 0 (0.0%)
Runs: 1 1 1 1 1 1 1 1 1 1
Render issues:
Text Component with default props - 10 runs render Baseline
Mean: 0.3 ms
Stdev: 0.5 ms (161.0%)
Runs: 1 0 0 0 0 0 0 0 1 1
Warmup runs: 0

Current
Mean: 0.2 ms
Stdev: 0.4 ms (210.8%)
Runs: 1 1 0 0 0 0 0 0 0 0
Warmup runs: 1
Baseline
Mean: 1
Stdev: 0 (0.0%)
Runs: 1 1 1 1 1 1 1 1 1 1
Render issues:

Current
Mean: 1
Stdev: 0 (0.0%)
Runs: 1 1 1 1 1 1 1 1 1 1
Render issues:
Text Component with translation key - 10 runs render Baseline
Mean: 0.3 ms
Stdev: 0.5 ms (161.0%)
Runs: 1 0 0 0 1 0 0 0 0 1
Warmup runs: 0

Current
Mean: 0.2 ms
Stdev: 0.4 ms (210.8%)
Runs: 0 1 0 1 0 0 0 0 0 0
Warmup runs: 0
Baseline
Mean: 1
Stdev: 0 (0.0%)
Runs: 1 1 1 1 1 1 1 1 1 1
Render issues:

Current
Mean: 1
Stdev: 0 (0.0%)
Runs: 1 1 1 1 1 1 1 1 1 1
Render issues:
Text Component with weight and size - 10 runs render Baseline
Mean: 0.2 ms
Stdev: 0.4 ms (210.8%)
Runs: 0 1 0 0 0 0 0 1 0 0
Warmup runs: 0

Current
Mean: 0.2 ms
Stdev: 0.4 ms (210.8%)
Runs: 0 0 0 0 0 1 0 0 0 1
Warmup runs: 0
Baseline
Mean: 1
Stdev: 0 (0.0%)
Runs: 1 1 1 1 1 1 1 1 1 1
Render issues:

Current
Mean: 1
Stdev: 0 (0.0%)
Runs: 1 1 1 1 1 1 1 1 1 1
Render issues:

Render Count Changes

There are no entries

Render Issues

There are no entries

Added Scenarios

There are no entries

Removed Scenarios

There are no entries

Generated by 🚫 dangerJS against 09f4119

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (2)
scripts/ios/checkBuildDeps.sh (1)

3-8: Remove unused color variable

The YELLOW color variable is defined but never used in the script.

 # ANSI color codes
 GREEN='\033[0;32m'
 RED='\033[0;31m'
-YELLOW='\033[1;33m'
 NC='\033[0m' # No Color
 BOLD='\033[1m'
🧰 Tools
🪛 Shellcheck (0.10.0)

[warning] 6-6: YELLOW appears unused. Verify use (or export if used externally).

(SC2034)

package.json (1)

Line range hint 249-259: Build configuration looks appropriate

The build configuration, including Node version requirement and Expo settings, is well-structured and doesn't conflict with the Ruby version changes.

Consider documenting the minimum required Ruby version in the README.md to help developers set up their environment correctly.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fd0aa1a and d79fe09.

⛔ Files ignored due to path filters (1)
  • ios/Gemfile.lock is excluded by !**/*.lock
📒 Files selected for processing (6)
  • .ruby-version (1 hunks)
  • eas.json (1 hunks)
  • ios/Gemfile (1 hunks)
  • package.json (1 hunks)
  • scripts/ios/checkBuildDeps.sh (1 hunks)
  • scripts/reactNativeCleanBuild.sh (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • .ruby-version
🚧 Files skipped from review as they are similar to previous changes (1)
  • ios/Gemfile
🧰 Additional context used
🪛 Shellcheck (0.10.0)
scripts/ios/checkBuildDeps.sh

[warning] 6-6: YELLOW appears unused. Verify use (or export if used externally).

(SC2034)

🔇 Additional comments (3)
eas.json (1)

46-47: Verify macOS image compatibility with Ruby requirements

The specified image macos-sonoma-14.6-xcode-16.1 is added for iOS preview builds. Let's verify if this image supports Ruby 3.2.5 as mentioned in the PR objectives.

✅ Verification successful

The previous results show that Ruby 3.2.5 is required, but we need to verify if the specified macOS image supports this version. Let's gather more information about the image specifications and any documentation that might help us confirm this compatibility.


macOS Sonoma 14.6 with Xcode 16.1 is compatible with Ruby 3.2.5

The specified image macos-sonoma-14.6-xcode-16.1 is compatible with Ruby 3.2.5 requirements. macOS Sonoma 14.6 comes with Ruby pre-installed and supports Ruby 3.2.5. The image is appropriately configured for iOS preview builds with the required CocoaPods version 1.16.2 as specified in both the Gemfile and eas.json.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if the EAS image is referenced in other configuration files
rg -l "macos-sonoma-14.6-xcode-16.1"

# Search for any Ruby version specifications in the repository
fd -t f "Gemfile|.ruby-version" -x cat {}

Length of output: 3405


Script:

#!/bin/bash
# Let's check if there's any documentation about the macOS image or its Ruby version
rg -i "macos-sonoma.*ruby" .

# Check for any EAS documentation files that might contain image specifications
fd -t f "README|CONTRIBUTING|docs" -x rg -l "macos-sonoma|ruby" {}

# Let's also check for any EAS config examples or templates
fd -t f "eas.*\.(json|ya?ml)" -x cat {}

Length of output: 2118

package.json (2)

10-10: LGTM! New build scripts look good.

The new scripts clean and ios:checkBuildDeps are well-organized and align with the PR objective of fixing EAS build issues.

Let's verify the referenced scripts exist and have proper permissions:

Also applies to: 16-16

✅ Verification successful

Scripts exist and have correct permissions

Both scripts are present in the expected locations and have the necessary executable permissions:

  • ./scripts/reactNativeCleanBuild.sh
  • ./scripts/ios/checkBuildDeps.sh
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the existence and permissions of the new build scripts

echo "Checking build scripts existence and permissions..."
fd -t f "reactNativeCleanBuild.sh|checkBuildDeps.sh" -x sh -c '
  if [ -f "{}" ]; then
    echo "Found: {}"
    if [ -x "{}" ]; then
      echo "✓ Has executable permissions"
    else
      echo "⚠️ Missing executable permissions"
    fi
  else
    echo "⚠️ Missing script: {}"
  fi
'

Length of output: 538


Line range hint 28-31: Verify iOS build dependencies configuration

The cross-os postinstall configuration for iOS looks good, but ensure it's compatible with the updated Ruby version (~> 3.2.5) mentioned in the Gemfile changes.

Let's check the postinstall script execution:

✅ Verification successful

iOS build dependencies configuration is correctly synchronized

The postinstall configuration is properly aligned with the Ruby dependencies:

  • Ruby version 3.2.5 is correctly specified in both Gemfile and Gemfile.lock
  • All necessary iOS dependencies (CocoaPods and related gems) are present and locked to compatible versions
  • Bundler version constraint (~> 2.5.16) is properly set
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify iOS build dependencies configuration

# Check if Gemfile exists and contains correct Ruby version
echo "Checking Gemfile configuration..."
fd Gemfile$ -x sh -c '
  if grep -q "ruby.*3.2.5" "{}"; then
    echo "✓ Ruby version 3.2.5 found in {}"
  else
    echo "⚠️ Ruby version mismatch or not specified in {}"
  fi
'

Length of output: 302


Script:

#!/bin/bash
# Let's verify the Gemfile.lock to ensure the dependencies are in sync
fd Gemfile.lock$ -x cat {}

# Also check for any bundler version constraints
fd Gemfile$ -x grep -A 5 "source.*rubygems" {}

Length of output: 3282

Comment on lines +29 to +36
echo "Moving node_modules to trash..."
osascript -e "tell app \"Finder\" to delete POSIX file \"$PWD/node_modules\""

echo "Moving ios/build to trash..."
osascript -e "tell app \"Finder\" to delete POSIX file \"$PWD/ios/build\""

echo "Moving ios/Pods to trash..."
osascript -e "tell app \"Finder\" to delete POSIX file \"$PWD/ios/Pods\""
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Add error handling and platform checks

The script uses macOS-specific AppleScript commands without platform verification or error handling.

Consider this improved implementation:

+# Check if running on macOS
+if [[ "$OSTYPE" != "darwin"* ]]; then
+  echo "Error: This script requires macOS"
+  exit 1
+fi
+
+remove_if_exists() {
+  local path="$1"
+  if [ -e "$path" ]; then
+    echo "Moving $path to trash..."
+    if ! osascript -e "tell app \"Finder\" to delete POSIX file \"$path\""; then
+      echo "Error: Failed to move $path to trash"
+      exit 1
+    fi
+  fi
+}
+
-echo "Moving node_modules to trash..."
-osascript -e "tell app \"Finder\" to delete POSIX file \"$PWD/node_modules\""
-
-echo "Moving ios/build to trash..."
-osascript -e "tell app \"Finder\" to delete POSIX file \"$PWD/ios/build\""
-
-echo "Moving ios/Pods to trash..."
-osascript -e "tell app \"Finder\" to delete POSIX file \"$PWD/ios/Pods\""
+remove_if_exists "$PWD/node_modules"
+remove_if_exists "$PWD/ios/build"
+remove_if_exists "$PWD/ios/Pods"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
echo "Moving node_modules to trash..."
osascript -e "tell app \"Finder\" to delete POSIX file \"$PWD/node_modules\""
echo "Moving ios/build to trash..."
osascript -e "tell app \"Finder\" to delete POSIX file \"$PWD/ios/build\""
echo "Moving ios/Pods to trash..."
osascript -e "tell app \"Finder\" to delete POSIX file \"$PWD/ios/Pods\""
# Check if running on macOS
if [[ "$OSTYPE" != "darwin"* ]]; then
echo "Error: This script requires macOS"
exit 1
fi
remove_if_exists() {
local path="$1"
if [ -e "$path" ]; then
echo "Moving $path to trash..."
if ! osascript -e "tell app \"Finder\" to delete POSIX file \"$path\""; then
echo "Error: Failed to move $path to trash"
exit 1
fi
fi
}
remove_if_exists "$PWD/node_modules"
remove_if_exists "$PWD/ios/build"
remove_if_exists "$PWD/ios/Pods"

Comment on lines +38 to +42
echo "Running yarn install..."
yarn install

echo "Running pod install..."
cd ios && pod install && cd ..
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Add error handling for dependency installation

The dependency installation commands lack error handling.

Apply this improvement:

 echo "Running yarn install..."
-yarn install
+if ! yarn install; then
+  echo "Error: yarn install failed"
+  exit 1
+fi
 
 echo "Running pod install..."
-cd ios && pod install && cd ..
+if ! (cd ios && pod install); then
+  echo "Error: pod install failed"
+  exit 1
+fi
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
echo "Running yarn install..."
yarn install
echo "Running pod install..."
cd ios && pod install && cd ..
echo "Running yarn install..."
if ! yarn install; then
echo "Error: yarn install failed"
exit 1
fi
echo "Running pod install..."
if ! (cd ios && pod install); then
echo "Error: pod install failed"
exit 1
fi

Comment on lines +68 to +75
# Check Gemfile configuration
if [ -f "ios/Gemfile" ]; then
echo -e "\n${BOLD}Gemfile Configuration:${NC}"
echo "Ruby Version: $(grep "ruby '" ios/Gemfile | cut -d"'" -f2)"
echo "Bundler Version: $(grep "bundler" ios/Gemfile | grep -v "#" | head -n1)"
else
echo -e "\n${RED}Warning: ios/Gemfile not found${NC}"
fi
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Add version compatibility validation

The script checks for the presence of Ruby and Bundler versions but doesn't validate if they match the required versions.

Add version validation:

 # Check Gemfile configuration
 if [ -f "ios/Gemfile" ]; then
     echo -e "\n${BOLD}Gemfile Configuration:${NC}"
-    echo "Ruby Version: $(grep "ruby '" ios/Gemfile | cut -d"'" -f2)"
-    echo "Bundler Version: $(grep "bundler" ios/Gemfile | grep -v "#" | head -n1)"
+    REQUIRED_RUBY_VERSION=$(grep "ruby '" ios/Gemfile | cut -d"'" -f2)
+    REQUIRED_BUNDLER_VERSION=$(grep "bundler" ios/Gemfile | grep -v "#" | head -n1 | grep -o "'.*'" | tr -d "'")
+    CURRENT_RUBY_VERSION=$(ruby -v | cut -d' ' -f2)
+    CURRENT_BUNDLER_VERSION=$(bundle -v | cut -d' ' -f3)
+    
+    echo "Required Ruby Version: $REQUIRED_RUBY_VERSION"
+    echo "Current Ruby Version: $CURRENT_RUBY_VERSION"
+    echo "Required Bundler Version: $REQUIRED_BUNDLER_VERSION"
+    echo "Current Bundler Version: $CURRENT_BUNDLER_VERSION"
+    
+    if [[ ! "$CURRENT_RUBY_VERSION" =~ ^$REQUIRED_RUBY_VERSION ]]; then
+        echo -e "${RED}Error: Ruby version mismatch${NC}"
+        exit 1
+    fi
+    
+    if [[ ! "$CURRENT_BUNDLER_VERSION" =~ ^$REQUIRED_BUNDLER_VERSION ]]; then
+        echo -e "${RED}Error: Bundler version mismatch${NC}"
+        exit 1
+    fi
 else
     echo -e "\n${RED}Warning: ios/Gemfile not found${NC}"
+    exit 1
 fi
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# Check Gemfile configuration
if [ -f "ios/Gemfile" ]; then
echo -e "\n${BOLD}Gemfile Configuration:${NC}"
echo "Ruby Version: $(grep "ruby '" ios/Gemfile | cut -d"'" -f2)"
echo "Bundler Version: $(grep "bundler" ios/Gemfile | grep -v "#" | head -n1)"
else
echo -e "\n${RED}Warning: ios/Gemfile not found${NC}"
fi
# Check Gemfile configuration
if [ -f "ios/Gemfile" ]; then
echo -e "\n${BOLD}Gemfile Configuration:${NC}"
REQUIRED_RUBY_VERSION=$(grep "ruby '" ios/Gemfile | cut -d"'" -f2)
REQUIRED_BUNDLER_VERSION=$(grep "bundler" ios/Gemfile | grep -v "#" | head -n1 | grep -o "'.*'" | tr -d "'")
CURRENT_RUBY_VERSION=$(ruby -v | cut -d' ' -f2)
CURRENT_BUNDLER_VERSION=$(bundle -v | cut -d' ' -f3)
echo "Required Ruby Version: $REQUIRED_RUBY_VERSION"
echo "Current Ruby Version: $CURRENT_RUBY_VERSION"
echo "Required Bundler Version: $REQUIRED_BUNDLER_VERSION"
echo "Current Bundler Version: $CURRENT_BUNDLER_VERSION"
if [[ ! "$CURRENT_RUBY_VERSION" =~ ^$REQUIRED_RUBY_VERSION ]]; then
echo -e "${RED}Error: Ruby version mismatch${NC}"
exit 1
fi
if [[ ! "$CURRENT_BUNDLER_VERSION" =~ ^$REQUIRED_BUNDLER_VERSION ]]; then
echo -e "${RED}Error: Bundler version mismatch${NC}"
exit 1
fi
else
echo -e "\n${RED}Warning: ios/Gemfile not found${NC}"
exit 1
fi

Update Ruby install steps

Update dev client builds

Update dev client builds

Update build checks to use eas dev build instead

Remove build output

Update build machines

fix builds
@alexrisch alexrisch enabled auto-merge (squash) December 22, 2024 20:03
@alexrisch alexrisch merged commit f149777 into release/3.0.0 Dec 22, 2024
6 checks passed
@alexrisch alexrisch deleted the fix/ml/eas-build-ruby-bundler-versioning branch December 22, 2024 20:04
@coderabbitai coderabbitai bot mentioned this pull request Dec 23, 2024
@coderabbitai coderabbitai bot mentioned this pull request Jan 2, 2025
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.

2 participants