Xcode Cloud failed to install brew?

My Xcode cloud build have been failing for some time due to failure to install brew for cocoapods. (my only dependency here is cocoa pods)

I followed the instruction in the documentation here

And have a simple ci_post_clone script here

#!/bin/sh
brew install cocoapods
pod install

The error are typically in the brew install part and often refer to a HTTP 500 error, an example pasted below, but they are not always consistent and happening at different random place in the brew update.

What should I add to my ci script to make brew and cocoapods work?

Example of error (never exactly the same)


Initialized empty Git repository in /Users/local/Homebrew/.git/

Updating Homebrew...

error: RPC failed; HTTP 500 curl 22 The requested URL returned error: 500

fatal: expected flush after ref listing

==> Tapping homebrew/core

Cloning into '/Users/local/Homebrew/Library/Taps/homebrew/homebrew-core'...

error: RPC failed; HTTP 500 curl 22 The requested URL returned error: 500

fatal: error reading section header 'shallow-info'

Error: Failure while executing; `git clone https://github.com/Homebrew/homebrew-core /Users/local/Homebrew/Library/Taps/homebrew/homebrew-core --origin=origin --template=` exited with 128.

Error: Failure while executing; `/Users/local/Homebrew/bin/brew tap homebrew/core` exited with 1.

/Volumes/workspace/repository/ci_scripts/ci_post_clone.sh: line 5: pod: command not found
  • Opened a bug report FB9929569

    Similar issue using Carthage. I do not see an attempt to even install brew: ''' source /Volumes/Task/ci_build.env && source /Volumes/Task/ci_plan.env && cd /Volumes/workspace/repository/ci_scripts && bash /Volumes/workspace/repository/ci_scripts/ci_post_clone.sh

    /Volumes/workspace/repository/ci_scripts/ci_post_clone.sh: line 7: brew: command not found

    ./build_framework.sh: line 22: carthage: command not found '''

    This is new in the last few days. Prior to this I had no issues with this ci script downloading and installing homebrew and carthage.

  • Please open a new bug report with Apple and reference FB9929569, this is the best way to gain traction with Apple.

    Also, you should be commenting on the original topic, not answering, as your answers are merely the same issue repeated again. :)

Add a Comment

Replies

same here

I have a similar issue. Previously I was not able to get XCode cloud to work on the main development branch. Weirdly, it was working on feature branches. Today i decided to investigate a bit further and try to get it working, but i stumbled upon this issue which seems to be recent, because the previous errors were different.

The post_clone script seems to be failing for me.

Run ci_post_clone.sh script

Run command: 'source /Volumes/Task/ci_build.env && source /Volumes/Task/ci_plan.env && cd /Volumes/workspace/repository/ci_scripts && bash /Volumes/workspace/repository/ci_scripts/ci_post_clone.sh' /Volumes/workspace/repository/ci_scripts/ci_post_clone.sh: line 4: brew: command not found /Volumes/workspace/repository/ci_scripts/ci_post_clone.sh: line 7: pod: command not found

For me too. this started happening fairly recently.

same here

Same for me. it seems that Homebrew wasn't installed on the machine so I can't use 'brew' command (command not found) I tried various operating system and Xcode versions (in the environment tab)

The same problem all brew commands failed

same here

yes, it takes already 3 days for them to get back homebrew - isn't it a shame?

Same happening here as well ci_post_clone.sh is not running correctly anymore as of a couple of days ago.

same here, i tried adding /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" but still getting error that admin password is needed for sudo

It seems to be fixed.

source /Volumes/Task/ci_build.env && source /Volumes/Task/ci_plan.env && cd /Volumes/workspace/repository/ci_scripts && bash /Volumes/workspace/repository/ci_scripts/ci_post_clone.sh
Initialized empty Git repository in /Users/local/Homebrew/.git/
Updating Homebrew...
From http://github.com/Homebrew/brew
 * [new branch]     master         -> origin/master

Same here, now I am getting the following error

/Volumes/workspace/repository/ios/ci_scripts/ci_post_clone.sh:11: command not found: pod Command exited with non-zero exit-code: 127

Add a Comment

You can use gem bundler in ci_post_clone.sh

# !/bin/sh
 
cd ..
 
echo ">>> SETUP ENVIRONMENT"
echo 'export GEM_HOME=$HOME/gems' >>~/.bash_profile
echo 'export PATH=$HOME/gems/bin:$PATH' >>~/.bash_profile
export GEM_HOME=$HOME/gems
export PATH="$GEM_HOME/bin:$PATH"
 
echo ">>> INSTALL BUNDLER"
gem install bundler --install-dir $GEM_HOME
 
echo ">>> INSTALL DEPENDENCIES"
bundle install
 
echo ">>> INSTALL PODS"
bundle exec pod install

You also create Gemfile same level with ci_scripts folder in Gemfile

source "https://rubygems.org"

gem 'cocoapods'