Skip to content

Catalina upgrades causes Homebrew to break when you run brew cleanup.…#6940

Closed
rogerhu wants to merge 1 commit intoHomebrew:masterfrom
rogerhu:fix_catalina
Closed

Catalina upgrades causes Homebrew to break when you run brew cleanup.…#6940
rogerhu wants to merge 1 commit intoHomebrew:masterfrom
rogerhu:fix_catalina

Conversation

@rogerhu
Copy link
Copy Markdown

@rogerhu rogerhu commented Jan 15, 2020

Catalina has Ruby 2.6 installed, so the portable Ruby version is not needed.

If you have /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby (which exists for older OS X versions), then the cleanup tool will nuke everything in /usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby.

Traceback (most recent call last):
	4: from /usr/local/Homebrew/Library/Homebrew/brew.rb:23:in `<main>'
	3: from /usr/local/Homebrew/Library/Homebrew/brew.rb:23:in `require_relative'
	2: from /usr/local/Homebrew/Library/Homebrew/global.rb:13:in `<top (required)>'
	1: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- active_support/core_ext/object/blank (LoadError)

You will need to brew update-reset to get back the old packages.

Trying to get feedback on why we're nuking vendor_path code. Can we get rid of it?

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew style with your changes locally?
  • Have you successfully run brew tests with your changes locally?

Copy link
Copy Markdown
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

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

You're right that this code is (now) incorrect. It is needed when you change between portable and system Ruby, though, because otherwise natively compiled Ruby modules will crash.

Comment thread Library/Homebrew/cleanup.rb Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Instead this should run safe_system "git", "clean", "-xf", bundler_path

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Done!

Comment thread Library/Homebrew/cleanup.rb Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Instead this should run puts "Would remove:\n#{Utils.popen_read("git", "clean", "-xnf", bundler_path)}

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Fixed!

… Catalina has Ruby 2.6 installed, so the portable Ruby version is not needed.

If you have /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby (for older OS X versions), then the cleanup tool will nuke everything in usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby. You will need to brew update-reset to get back the old packages.
@MikeMcQuaid
Copy link
Copy Markdown
Member

Merged in #6942.
Thanks so much for your contribution! Without people like you submitting PRs we couldn't run this project. You rock, @rogerhu!

@rogerhu
Copy link
Copy Markdown
Author

rogerhu commented Jan 16, 2020

Thanks for your quick turnaround! (and for updating the unit tests)

@rogerhu
Copy link
Copy Markdown
Author

rogerhu commented Jan 17, 2020

Possible you can do a hot-fix release for this fix? We at squareup.com use an internal tool that invokes brew cleanup and it causes a lot of issues for Catalina upgrades. We can add a workaround if the timing's not right for you so please let us know! Thanks!

@MikeMcQuaid
Copy link
Copy Markdown
Member

@rogerhu Sorry, no. We should do a release early next week (perhaps even Monday afternoon UK time) but this depends a lot on what's going on.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

outdated PR was locked due to age

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants