Skip to content

Conversation

stanley-cheung
Copy link
Contributor

@stanley-cheung stanley-cheung commented May 27, 2020

Trying to fix #23027


There was an error Error: No available formula with the name "brew-cask"

Reference: Homebrew/homebrew-cask#75135 (comment), Homebrew/homebrew-cask#57875 (comment), or maybe rvm/rvm#3995 (comment)

[Edit:] The above seems to be a minor error, is under a set +e and hence is skipped


Investigations

The script seems to be failing on this particular command, originally coming from #17750:

rvm --debug requirements ruby-2.5.0

eventually with this error Requirements installation failed with status: 1..

The last green build has these lines:

==> Upgrading 4 dependents:
libevent 2.1.8 -> 2.1.11_1, sqlite 3.26.0_1 -> 3.31.1, tmux 2.8 -> 3.1b, wget 1.20.1_3 -> 1.20.3_2

Now the failures have these lines:

==> Upgrading 5 dependents:
gnupg 2.2.12 -> 2.2.20, libevent 2.1.8 -> 2.1.11_1, sqlite 3.26.0_1 -> 3.31.1, tmux 2.8 -> 3.1b, wget 1.20.1_3 -> 1.20.3_2

And then later

==> Installing gnupg
==> Pouring gnupg-2.2.20.high_sierra.bottle.tar.gz
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink bin/gpg
Target /usr/local/bin/gpg
already exists. You may want to remove it:
  rm '/usr/local/bin/gpg'

To force the link and overwrite all conflicting files:
  brew link --overwrite gnupg

To list all files that would be deleted:
  brew link --overwrite --dry-run gnupg

Possible conflicting files are:
/usr/local/bin/gpg -> /usr/local/bin/gpg2
/usr/local/bin/gpgconf -> /usr/local/gnupg-2.2/bin/gpgconf
/usr/local/bin/gpgsm -> /usr/local/gnupg-2.2/bin/gpgsm

So looks like somehow an additional dependency about this gnupg package is being pulled in recently, causing the error.

The investigation from this comment on is extremely similar to the issue here.


One thing to note is that the rvm --debug requirements ruby-2.5.0 command used to be under a set +ex before, so it doesn't error out the whole script. After this recent change (#22195) in Mar 2, the command is now under a set -e.

In other words, the command rvm requirements ruby-2.5.0 did pass under a set -e between Mar 2 and May 20.

Fix attempt 1: putting rvm requirements ruby-2.5.0 under a set +e

This will make the build green. But the brew link gnupg error is still there. We just ignored it. Ignoring the error doesn't seem to affect the rest of the build (e.g. rvm install 2.5.0). But, this doesn't exactly feel like the right solution.

Fix attempt 2: just remove the rvm requirements ruby-2.5.0 command

Just removing the rvm requirements ruby-2.5.0 command did not help. Even though we went on to do rvm install 2.5.0 directly, rvm eventually decides to do rvm requirements ruby-2.5.0 anyways, which still leads back to the error with gnupg.

So the problem is still with brew link gnupg.
Another question: what happened between May 20 6:35pm PDT and 8:17pm PDT?

Fix attempt 3: do something special to deal with the error associated with brew upgrade gnupg

Since these Kokoro MacOS workers are images anyways, we can probably just do something special just to deal with the gnupg error. Every run starts fresh anyways. This is borrowed from Alex's attempts in #23048.

@stanley-cheung stanley-cheung added disposition/BUILDNURSE For all buildnurse related build/test failures and flakes release notes: no Indicates if PR should not be in release notes labels May 27, 2020
@stanley-cheung stanley-cheung changed the title Trying to fix brew update error Trying to fix ruby requirements error May 27, 2020
@stanley-cheung stanley-cheung marked this pull request as draft May 27, 2020 10:48
@stanley-cheung stanley-cheung force-pushed the fix-brew-update branch 2 times, most recently from a268b3f to 92786c0 Compare May 27, 2020 21:43
@stanley-cheung stanley-cheung marked this pull request as ready for review May 27, 2020 23:20
Copy link
Contributor

@apolcyn apolcyn left a comment

Choose a reason for hiding this comment

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

thanks!

@stanley-cheung stanley-cheung merged commit 71c8056 into grpc:master May 28, 2020
@stanley-cheung stanley-cheung deleted the fix-brew-update branch May 28, 2020 01:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
disposition/BUILDNURSE For all buildnurse related build/test failures and flakes release notes: no Indicates if PR should not be in release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

macos/grpc_build_artifacts fails consistently with __rvm_rm_rf already gone
2 participants