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

Ruby 2.6 #6556

Merged
merged 5 commits into from Oct 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
82 changes: 31 additions & 51 deletions .gitignore
Expand Up @@ -35,52 +35,23 @@
!**/vendor/bundle/ruby/*/gems/rubocop-rspec-*/config

# Ignore partially included gems where we don't need all files
**/vendor/bundle/ruby/2.3.0/gems/activesupport-*/lib/active_support.rb
**/vendor/bundle/ruby/2.3.0/gems/activesupport-*/lib/active_support/all.rb
**/vendor/bundle/ruby/2.3.0/gems/activesupport-*/lib/active_support/cache.rb
**/vendor/bundle/ruby/2.3.0/gems/activesupport-*/lib/active_support/cache/
**/vendor/bundle/ruby/2.3.0/gems/activesupport-*/lib/active_support/concurrency/
**/vendor/bundle/ruby/2.3.0/gems/activesupport-*/lib/active_support/dependencies.rb
**/vendor/bundle/ruby/2.3.0/gems/activesupport-*/lib/active_support/dependencies/
**/vendor/bundle/ruby/2.3.0/gems/activesupport-*/lib/active_support/duration/
**/vendor/bundle/ruby/2.3.0/gems/activesupport-*/lib/active_support/json.rb
**/vendor/bundle/ruby/2.3.0/gems/activesupport-*/lib/active_support/json/
**/vendor/bundle/ruby/2.3.0/gems/activesupport-*/lib/active_support/log_subscriber.rb
**/vendor/bundle/ruby/2.3.0/gems/activesupport-*/lib/active_support/log_subscriber/
**/vendor/bundle/ruby/2.3.0/gems/activesupport-*/lib/active_support/messages/
**/vendor/bundle/ruby/2.3.0/gems/activesupport-*/lib/active_support/multibyte/
**/vendor/bundle/ruby/2.3.0/gems/activesupport-*/lib/active_support/number_helper.rb
**/vendor/bundle/ruby/2.3.0/gems/activesupport-*/lib/active_support/number_helper/
**/vendor/bundle/ruby/2.3.0/gems/activesupport-*/lib/active_support/testing/
**/vendor/bundle/ruby/*/gems/backports-*/lib/backports/latest.rb
**/vendor/bundle/ruby/*/gems/backports-*/lib/backports/rails.rb
**/vendor/bundle/ruby/*/gems/backports-*/lib/backports/version.rb
**/vendor/bundle/ruby/*/gems/backports-*/lib/backports/1.*
**/vendor/bundle/ruby/*/gems/backports-*/lib/backports/2.0*
**/vendor/bundle/ruby/*/gems/backports-*/lib/backports/2.1*
**/vendor/bundle/ruby/*/gems/backports-*/lib/backports/2.2*
**/vendor/bundle/ruby/*/gems/backports-*/lib/backports/2.3*
**/vendor/bundle/ruby/*/gems/backports-*/lib/backports/2.6*
**/vendor/bundle/ruby/*/gems/backports-*/lib/backports/2.*.rb
**/vendor/bundle/ruby/*/gems/backports-*/lib/backports/force/
**/vendor/bundle/ruby/*/gems/backports-*/lib/backports/rails/
**/vendor/bundle/ruby/*/gems/backports-*/lib/backports/random/
**/vendor/bundle/ruby/*/gems/backports-*/lib/backports/*/array/
**/vendor/bundle/ruby/*/gems/backports-*/lib/backports/*/comparable/
**/vendor/bundle/ruby/*/gems/backports-*/lib/backports/*/dir/
**/vendor/bundle/ruby/*/gems/backports-*/lib/backports/*/enumerable/
**/vendor/bundle/ruby/*/gems/backports-*/lib/backports/*/false_class/
**/vendor/bundle/ruby/*/gems/backports-*/lib/backports/*/fixnum/
**/vendor/bundle/ruby/*/gems/backports-*/lib/backports/*/float/
**/vendor/bundle/ruby/*/gems/backports-*/lib/backports/*/hash/
**/vendor/bundle/ruby/*/gems/backports-*/lib/backports/*/integer/
**/vendor/bundle/ruby/*/gems/backports-*/lib/backports/*/kernel/
**/vendor/bundle/ruby/*/gems/backports-*/lib/backports/*/module/
**/vendor/bundle/ruby/*/gems/backports-*/lib/backports/*/nil_class/
**/vendor/bundle/ruby/*/gems/backports-*/lib/backports/*/regexp/
**/vendor/bundle/ruby/*/gems/backports-*/lib/backports/*/struct/
**/vendor/bundle/ruby/*/gems/backports-*/lib/backports/*/struct/
**/vendor/bundle/ruby/*/gems/backports-*/lib/backports/*/true_class/
**/vendor/bundle/ruby/*/gems/activesupport-*/lib/active_support.rb
**/vendor/bundle/ruby/*/gems/activesupport-*/lib/active_support/all.rb
**/vendor/bundle/ruby/*/gems/activesupport-*/lib/active_support/cache.rb
**/vendor/bundle/ruby/*/gems/activesupport-*/lib/active_support/cache/
**/vendor/bundle/ruby/*/gems/activesupport-*/lib/active_support/concurrency/
**/vendor/bundle/ruby/*/gems/activesupport-*/lib/active_support/dependencies.rb
**/vendor/bundle/ruby/*/gems/activesupport-*/lib/active_support/dependencies/
**/vendor/bundle/ruby/*/gems/activesupport-*/lib/active_support/duration/
**/vendor/bundle/ruby/*/gems/activesupport-*/lib/active_support/json.rb
**/vendor/bundle/ruby/*/gems/activesupport-*/lib/active_support/json/
**/vendor/bundle/ruby/*/gems/activesupport-*/lib/active_support/log_subscriber.rb
**/vendor/bundle/ruby/*/gems/activesupport-*/lib/active_support/log_subscriber/
**/vendor/bundle/ruby/*/gems/activesupport-*/lib/active_support/messages/
**/vendor/bundle/ruby/*/gems/activesupport-*/lib/active_support/multibyte/
**/vendor/bundle/ruby/*/gems/activesupport-*/lib/active_support/number_helper.rb
**/vendor/bundle/ruby/*/gems/activesupport-*/lib/active_support/number_helper/
**/vendor/bundle/ruby/*/gems/activesupport-*/lib/active_support/testing/
**/vendor/bundle/ruby/*/gems/concurrent-ruby-*/lib/atomic/
**/vendor/bundle/ruby/*/gems/concurrent-ruby-*/lib/atomic_reference/
**/vendor/bundle/ruby/*/gems/concurrent-ruby-*/lib/collection/
Expand All @@ -91,6 +62,20 @@
**/vendor/bundle/ruby/*/gems/concurrent-ruby-*/lib/utility/
**/vendor/bundle/ruby/*/gems/concurrent-ruby-*/lib/*/*.jar
**/vendor/bundle/ruby/*/gems/i18n-*/lib/i18n/tests*
**/vendor/bundle/ruby/*/gems/mechanize-*/lib/*.rb
**/vendor/bundle/ruby/*/gems/mechanize-*/lib/mechanize/http/agent.rb
**/vendor/bundle/ruby/*/gems/mechanize-*/lib/mechanize/http/*auth*.rb
**/vendor/bundle/ruby/*/gems/mechanize-*/lib/mechanize/c*
**/vendor/bundle/ruby/*/gems/mechanize-*/lib/mechanize/d*
**/vendor/bundle/ruby/*/gems/mechanize-*/lib/mechanize/e*
**/vendor/bundle/ruby/*/gems/mechanize-*/lib/mechanize/f*
**/vendor/bundle/ruby/*/gems/mechanize-*/lib/mechanize/h*
**/vendor/bundle/ruby/*/gems/mechanize-*/lib/mechanize/i*
**/vendor/bundle/ruby/*/gems/mechanize-*/lib/mechanize/p*
**/vendor/bundle/ruby/*/gems/mechanize-*/lib/mechanize/r*
**/vendor/bundle/ruby/*/gems/mechanize-*/lib/mechanize/t*
**/vendor/bundle/ruby/*/gems/mechanize-*/lib/mechanize/u*
**/vendor/bundle/ruby/*/gems/mechanize-*/lib/mechanize/x*
**/vendor/bundle/ruby/*/gems/thread_safe-*/lib/thread_safe/util

# Ignore dependencies we don't wish to vendor
Expand Down Expand Up @@ -147,11 +132,6 @@
**/vendor/bundle/ruby/*/gems/unicode-display_width-*/
**/vendor/bundle/ruby/*/gems/webrobots-*/

# Only include the `Mechanize::HTTP::ContentDispositionParser`.
**/vendor/bundle/ruby/*/gems/mechanize-*/lib
!**/vendor/bundle/ruby/*/gems/mechanize-*/lib/mechanize/http/content_disposition_parser.rb
!**/vendor/bundle/ruby/*/gems/mechanize-*/lib/mechanize/version.rb

# Ignore `bin` contents (again).
/bin

Expand Down
1 change: 0 additions & 1 deletion Library/Homebrew/Gemfile
Expand Up @@ -15,7 +15,6 @@ gem "simplecov", require: false

# vendored gems
gem "activesupport"
gem "backports"
gem "concurrent-ruby"
gem "mechanize"
gem "plist"
Expand Down
2 changes: 0 additions & 2 deletions Library/Homebrew/Gemfile.lock
Expand Up @@ -7,7 +7,6 @@ GEM
minitest (~> 5.1)
tzinfo (~> 1.1)
ast (2.4.0)
backports (3.15.0)
concurrent-ruby (1.1.5)
connection_pool (2.2.2)
coveralls (0.8.23)
Expand Down Expand Up @@ -116,7 +115,6 @@ PLATFORMS

DEPENDENCIES
activesupport
backports
concurrent-ruby
coveralls (~> 0.8)
mechanize
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/brew.sh
Expand Up @@ -133,7 +133,7 @@ then

# Set a variable when the macOS system Ruby is new enough to avoid spawning
# a Ruby process unnecessarily.
if [[ "$HOMEBREW_MACOS_VERSION_NUMERIC" -lt "101303" ]]
if [[ "$HOMEBREW_MACOS_VERSION_NUMERIC" -lt "101500" ]]
then
unset HOMEBREW_MACOS_SYSTEM_RUBY_NEW_ENOUGH
else
Expand Down
22 changes: 6 additions & 16 deletions Library/Homebrew/cmd/vendor-install.sh
Expand Up @@ -17,27 +17,17 @@ if [[ -n "$HOMEBREW_MACOS" ]]
then
if [[ "$HOMEBREW_PROCESSOR" = "Intel" ]]
then
ruby_URL="$HOMEBREW_BOTTLE_DOMAIN/bottles-portable-ruby/portable-ruby-2.3.7.mavericks.bottle.tar.gz"
ruby_URL2="https://github.com/Homebrew/homebrew-portable-ruby/releases/download/2.3.7/portable-ruby-2.3.7.mavericks.bottle.tar.gz"
ruby_SHA="539ae571968fc74d4ec3a839cb33edc5786c219a5e6ae7fb6a09ec5fc1b04e4e"
ruby_URL="$HOMEBREW_BOTTLE_DOMAIN/bottles-portable-ruby/portable-ruby--2.6.3.mavericks.bottle.tar.gz"
ruby_URL2="https://github.com/Homebrew/homebrew-portable-ruby/releases/download/2.6.3/portable-ruby--2.6.3.mavericks.bottle.tar.gz"
ruby_SHA="ab81211a2052ccaa6d050741c433b728d0641523d8742eef23a5b450811e5104"
fi
elif [[ -n "$HOMEBREW_LINUX" ]]
then
case "$HOMEBREW_PROCESSOR" in
x86_64)
ruby_URL="$HOMEBREW_BOTTLE_DOMAIN/bottles-portable-ruby/portable-ruby-2.3.7.x86_64_linux.bottle.tar.gz"
ruby_URL2="https://github.com/Homebrew/homebrew-portable-ruby/releases/download/2.3.7/portable-ruby-2.3.7.x86_64_linux.bottle.tar.gz"
ruby_SHA="9df214085a0e566a580eea3dd9eab14a2a94930ff74fbf97fb1284e905c8921d"
;;
aarch64)
ruby_URL="$HOMEBREW_BOTTLE_DOMAIN/bottles-portable-ruby/portable-ruby-2.3.7.aarch64_linux.bottle.tar.gz"
ruby_URL2="https://github.com/Homebrew/homebrew-portable-ruby/releases/download/2.3.7/portable-ruby-2.3.7.aarch64_linux.bottle.tar.gz"
ruby_SHA="e5a72a9deabe500d5d2eaed29e2eb84868ade962eda3ddc68ea169adbb7ac5a2"
;;
armv[67]*)
ruby_URL="$HOMEBREW_BOTTLE_DOMAIN/bottles-portable-ruby/portable-ruby-2.3.7.armv6_linux.bottle.tar.gz"
ruby_URL2="https://github.com/Homebrew/homebrew-portable-ruby/releases/download/2.3.7/portable-ruby-2.3.7.armv6_linux.bottle.tar.gz"
ruby_SHA="17dce8965d7c935ec1dd0c5bb0be937b685ffe65529141d9e6ed78f4925b4570"
ruby_URL="$HOMEBREW_BOTTLE_DOMAIN/bottles-portable-ruby/portable-ruby--2.6.3.x86_64_linux.bottle.tar.gz"
MikeMcQuaid marked this conversation as resolved.
Show resolved Hide resolved
ruby_URL2="https://github.com/Homebrew/homebrew-portable-ruby/releases/download/2.6.3/portable-ruby--2.6.3.x86_64_linux.bottle.tar.gz"
ruby_SHA="e8c9b6d3dc5f40844e07b4b694897b8b7cb5a7dab1013b3b8712a22868f98c98"
;;
esac
fi
Expand Down
6 changes: 1 addition & 5 deletions Library/Homebrew/extend/os/mac/diagnostic.rb
Expand Up @@ -139,11 +139,7 @@ def check_if_xcode_needs_clt_installed
end

def check_ruby_version
ruby_version = if MacOS.version >= :catalina
"2.6.3"
else
"2.3.7"
end
ruby_version = "2.6.3"
return if RUBY_VERSION == ruby_version
return if ARGV.homebrew_developer? && OS::Mac.prerelease?

Expand Down
3 changes: 0 additions & 3 deletions Library/Homebrew/extend/string.rb
@@ -1,8 +1,5 @@
# frozen_string_literal: true

# Contains backports from newer versions of Ruby
require "backports/2.4.0/string/match"
require "backports/2.5.0/string/delete_prefix"
require "active_support/core_ext/object/blank"

class String
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/test/cask/installer_spec.rb
Expand Up @@ -115,7 +115,7 @@
}.to output(
<<~EOS,
==> Satisfying dependencies
==> Downloading file:#{HOMEBREW_LIBRARY_PATH}/test/support/fixtures/cask/caffeine.zip
==> Downloading file://#{HOMEBREW_LIBRARY_PATH}/test/support/fixtures/cask/caffeine.zip
==> Verifying SHA-256 checksum for Cask 'with-installer-manual'.
==> Installing Cask with-installer-manual
To complete the installation of Cask with-installer-manual, you must also
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/test/cmd/install_spec.rb
Expand Up @@ -6,7 +6,7 @@
it_behaves_like "parseable arguments"
end

describe "brew install", :integration_test do
describe "brew install", :integration_test, :needs_no_bad_linux_portable_ruby do
it "installs formulae" do
setup_test_formula "testball1"

Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/test/cmd/migrate_spec.rb
Expand Up @@ -6,7 +6,7 @@
it_behaves_like "parseable arguments"
end

describe "brew migrate", :integration_test do
describe "brew migrate", :integration_test, :needs_no_bad_linux_portable_ruby do
it "migrates a renamed Formula" do
setup_test_formula "testball1"
setup_test_formula "testball2"
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/test/cmd/reinstall_spec.rb
Expand Up @@ -7,7 +7,7 @@
it_behaves_like "parseable arguments"
end

describe "brew reinstall", :integration_test do
describe "brew reinstall", :integration_test, :needs_no_bad_linux_portable_ruby do
it "reinstalls a Formula" do
install_test_formula "testball"
foo_dir = HOMEBREW_CELLAR/"testball/0.1/bin"
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/test/cmd/upgrade_spec.rb
Expand Up @@ -6,7 +6,7 @@
it_behaves_like "parseable arguments"
end

describe "brew upgrade", :integration_test do
describe "brew upgrade", :integration_test, :needs_no_bad_linux_portable_ruby do
it "upgrades a Formula and cleans up old versions" do
setup_test_formula "testball"
(HOMEBREW_CELLAR/"testball/0.0.1/foo").mkpath
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/test/dev-cmd/ruby_spec.rb
Expand Up @@ -6,7 +6,7 @@
it_behaves_like "parseable arguments"
end

describe "brew ruby", :integration_test do
describe "brew ruby", :integration_test, :needs_no_bad_linux_portable_ruby do
it "executes ruby code with Homebrew's libraries loaded" do
expect { brew "ruby", "-e", "exit 0" }
.to be_a_success
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/test/dev-cmd/test_spec.rb
Expand Up @@ -6,7 +6,7 @@
it_behaves_like "parseable arguments"
end

describe "brew test", :integration_test do
describe "brew test", :integration_test, :needs_no_bad_linux_portable_ruby do
it "tests a given Formula" do
install_test_formula "testball", <<~'RUBY'
test do
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/test/rubocops/formula_desc_spec.rb
Expand Up @@ -41,7 +41,7 @@ class Foo < Formula
url 'https://brew.sh/foo-1.0.tgz'
desc 'Bar#{"bar" * 9}'\
'#{"foo" * 21}'
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Description is too long. "name: desc" should be less than 80 characters. Length is calculated as foo + desc. (currently 98)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Description is too long. "name: desc" should be less than 80 characters. Length is calculated as foo + desc. (currently 98)
end
RUBY
end
Expand Down
4 changes: 4 additions & 0 deletions Library/Homebrew/test/spec_helper.rb
Expand Up @@ -132,6 +132,10 @@
skip "unzip not installed." unless which("unzip")
end

config.before(:each, :needs_no_bad_linux_portable_ruby) do
skip "using Linux portable-ruby." if OS.linux? && RUBY_PATH.to_s.end_with?("portable-ruby/2.6.3/bin/ruby")
end

config.around do |example|
def find_files
Find.find(TEST_TMPDIR)
Expand Down
4 changes: 3 additions & 1 deletion Library/Homebrew/utils/ruby.sh
Expand Up @@ -3,7 +3,9 @@ setup-ruby-path() {
local vendor_ruby_current_version
local vendor_ruby_path
local ruby_version_new_enough
local minimum_ruby_version="2.3.7"
# When bumping check if HOMEBREW_MACOS_SYSTEM_RUBY_NEW_ENOUGH (in brew.sh)
# also needs to be changed.
local minimum_ruby_version="2.6.3"

vendor_dir="$HOMEBREW_LIBRARY/Homebrew/vendor"
vendor_ruby_current_version="$vendor_dir/portable-ruby/current"
Expand Down