-
Notifications
You must be signed in to change notification settings - Fork 7
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
fix: eas build failed after changing ruby versions #1428
Conversation
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 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. 📒 Files selected for processing (5)
WalkthroughThe pull request updates several configuration files for an iOS project, including the Changes
Possibly related PRs
Poem
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? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this 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 commentThe 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
⛔ 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:
- The EAS build environment supports Ruby 3.3.x
- 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
Performance Comparison ReportSignificant Changes To DurationThere are no entries Meaningless Changes To DurationShow entries
Show details
Render Count ChangesThere are no entries Render IssuesThere are no entries Added ScenariosThere are no entries Removed ScenariosThere are no entries |
There was a problem hiding this 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 variableThe
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 appropriateThe 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
⛔ 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
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\"" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
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" |
echo "Running yarn install..." | ||
yarn install | ||
|
||
echo "Running pod install..." | ||
cd ios && pod install && cd .. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
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 |
# 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 |
There was a problem hiding this comment.
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.
# 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
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