Skip to content
Snippets Groups Projects
Commit 0d595694 authored by Mike McQuaid's avatar Mike McQuaid Committed by GitHub
Browse files

Merge pull request #2606 from MikeMcQuaid/revert-vendor-gems

Revert gem vendoring experiment.
parents 8d948e4b 57db2e53
No related branches found
No related tags found
No related merge requests found
Showing
with 119 additions and 114 deletions
---
BUNDLE_CLEAN: "true"
BUNDLE_DISABLE_SHARED_GEMS: "true"
BUNDLE_PATH: "Library/Homebrew/vendor"
BUNDLE_JOBS: "3"
......@@ -8,10 +8,15 @@
!/Library/
# Ignore generated files within `Library` (again).
/Library/Homebrew/**/.bundle
/Library/Homebrew/**/vendor/bundle
/Library/Homebrew/doc
/Library/Homebrew/cask/bin
/Library/Homebrew/cask/coverage
/Library/Homebrew/cask/tmp
/Library/Homebrew/test/bin
/Library/Homebrew/test/coverage
/Library/Homebrew/test/fs_leak_log
/Library/Homebrew/tmp
/Library/LinkedKegs
/Library/Locks
......@@ -19,24 +24,8 @@
/Library/PinnedTaps
/Library/Taps
# Ignore some vendored files within `Library`.
# Ignore vendored files within `Library`.
/Library/Homebrew/vendor/portable-ruby
/Library/Homebrew/vendor/ruby/2.0.0/bin
/Library/Homebrew/vendor/ruby/2.0.0/cache
/Library/Homebrew/vendor/ruby/2.0.0/extensions
/Library/Homebrew/vendor/ruby/2.0.0/gems/*
/Library/Homebrew/vendor/ruby/2.0.0/gems/ruby-macho-*/*
/Library/Homebrew/vendor/ruby/2.0.0/gems/plist-*/*
/Library/Homebrew/vendor/ruby/2.0.0/specifications
/Library/Homebrew/vendor/ruby/2.0.0/tmp
# Unignore our vendored gems
!/Library/Homebrew/vendor/ruby/2.0.0/gems/ruby-macho-*
!/Library/Homebrew/vendor/ruby/2.0.0/gems/ruby-macho-*/LICENSE*
!/Library/Homebrew/vendor/ruby/2.0.0/gems/ruby-macho-*/lib
!/Library/Homebrew/vendor/ruby/2.0.0/gems/plist-*
!/Library/Homebrew/vendor/ruby/2.0.0/gems/plist-*/LICENSE*
!/Library/Homebrew/vendor/ruby/2.0.0/gems/plist-*/lib
# Ignore `bin` contents (again).
/bin
......@@ -61,13 +50,13 @@
!/completions
# Unignore our root-level metadata files.
!/.bundle
!/.gitignore
!/.travis.yml
!/.yardopts
!/CODEOFCONDUCT.md
!/CONTRIBUTING.md
!/Gemfile
!/Gemfile.lock
!/LICENSE.txt
!/README.md
# Unignore tests' bundle config
!/Library/Homebrew/test/.bundle
language: ruby
bundler_args: --path Library/Homebrew/vendor --standalone --jobs 3
cache: bundler
cache:
directories:
- $HOME/.gem/ruby
- Library/Homebrew/vendor/bundle
matrix:
include:
......@@ -8,14 +10,9 @@ matrix:
osx_image: xcode8.3
rvm: system
- os: linux
sudo: false
rvm: 2.0.0
before_install:
- rm -rf Library/Homebrew/vendor/bundle/
- export GEM_HOME="$PWD/Library/Homebrew/vendor/ruby/2.0.0"
- gem list --installed bundler || gem install bundler
- export PATH="$GEM_HOME/bin:$PATH"
- export HOMEBREW_DEVELOPER=1
- if [ "${TRAVIS_OS_NAME}" = "osx" ]; then
HOMEBREW_REPOSITORY="$(brew --repo)";
......
source "https://rubygems.org"
# brew *
gem "ruby-macho"
# brew cask
gem "plist"
# brew cask style
group :cask_style do
gem "rubocop-cask", "~> 0.12.0"
end
# brew man
group :man do
gem "ronn"
end
# brew style
group :style do
gem "rubocop", "~> 0.47.1"
end
# brew tests
group :tests do
gem "parallel_tests"
gem "rspec"
gem "rspec-its", require: false
gem "rspec-wait", require: false
end
# brew tests --coverage
group :coverage do
gem "codecov", require: false
gem "simplecov", require: false
end
......@@ -10,12 +10,7 @@ raise "Homebrew must be run under Ruby 2!" unless RUBY_TWO
require "pathname"
HOMEBREW_LIBRARY_PATH = Pathname.new(__FILE__).realpath.parent
$:.unshift(HOMEBREW_LIBRARY_PATH)
load_path_before_bundler = $:.dup
require_relative "#{HOMEBREW_LIBRARY_PATH}/vendor/bundler/setup"
ENV["HOMEBREW_GEMS_LOAD_PATH"] = ($: - load_path_before_bundler).join(":")
$:.unshift(HOMEBREW_LIBRARY_PATH.to_s)
require "global"
require "tap"
......@@ -57,22 +52,11 @@ begin
# Add contributed commands to PATH before checking.
path.append(Pathname.glob(Tap::TAP_DIRECTORY/"*/*/cmd"))
# Add RubyGems.
HOMEBREW_GEM_HOME = HOMEBREW_LIBRARY_PATH/"vendor/#{RUBY_ENGINE}/#{RUBY_VERSION}"
path.append(HOMEBREW_GEM_HOME/"bin")
# Add SCM wrappers.
path.append(HOMEBREW_SHIMS_PATH/"scm")
ENV["PATH"] = path
# Setup RubyGems environment.
ENV["GEM_HOME"] = ENV["GEM_PATH"] = HOMEBREW_GEM_HOME
# Make RubyGems notice environment changes.
Gem.clear_paths
Gem::Specification.reset
Homebrew.run_bundler_if_needed! unless HOMEBREW_GEM_HOME.exist?
if cmd
internal_cmd = require? HOMEBREW_LIBRARY_PATH.join("cmd", cmd)
......
......@@ -69,6 +69,10 @@ then
odie "Cowardly refusing to continue at this prefix: $HOMEBREW_PREFIX"
fi
# Save value to use for installing gems
export GEM_OLD_HOME="$GEM_HOME"
export GEM_OLD_PATH="$GEM_PATH"
# Users may have these set, pointing the system Ruby
# at non-system gem paths
unset GEM_HOME
......
......@@ -2,7 +2,7 @@ require "hbc/artifact/base"
require "hbc/utils/hash_validator"
require "plist"
require "vendor/plist/plist"
module Hbc
module Artifact
......
......@@ -26,7 +26,7 @@ module Hbc
def install_rubocop
capture_stderr do
begin
Homebrew.run_bundler_if_needed!
Homebrew.install_gem_setup_path! "rubocop-cask", HOMEBREW_RUBOCOP_CASK_VERSION, "rubocop"
rescue SystemExit
raise CaskError, Tty.strip_ansi($stderr.string).chomp.sub(/\AError: /, "")
end
......
require "hbc/container/naked"
require "macho"
require "vendor/macho/macho"
module Hbc
class Container
......
require "open3"
require "shellwords"
require "plist"
require "vendor/plist/plist"
require "extend/io"
......
......@@ -65,7 +65,7 @@ module Homebrew
def check_style_impl(files, output_type, options = {})
fix = options[:fix]
Homebrew.run_bundler_if_needed!
Homebrew.install_gem_setup_path! "rubocop", HOMEBREW_RUBOCOP_VERSION
require "rubocop"
require_relative "../rubocops"
......
......@@ -2,6 +2,8 @@ unless ENV["HOMEBREW_BREW_FILE"]
raise "HOMEBREW_BREW_FILE was not exported! Please call bin/brew directly!"
end
require "constants"
# Path to `bin/brew` main executable in HOMEBREW_PREFIX
HOMEBREW_BREW_FILE = Pathname.new(ENV["HOMEBREW_BREW_FILE"])
......@@ -46,8 +48,5 @@ unless defined? HOMEBREW_LIBRARY_PATH
HOMEBREW_LIBRARY_PATH = Pathname.new(__FILE__).realpath.parent
end
# Load path to vendored gems used by Homebrew
HOMEBREW_GEMS_LOAD_PATH = ENV["HOMEBREW_GEMS_LOAD_PATH"]
# Load path used by standalone scripts to access the Homebrew code base
HOMEBREW_LOAD_PATH = [HOMEBREW_LIBRARY_PATH, *HOMEBREW_GEMS_LOAD_PATH].join(":")
HOMEBREW_LOAD_PATH = HOMEBREW_LIBRARY_PATH
# RuboCop version used for `brew style` and `brew cask style`
HOMEBREW_RUBOCOP_VERSION = "0.47.1".freeze
HOMEBREW_RUBOCOP_CASK_VERSION = "~> 0.12.0".freeze # has to be updated when RuboCop version changes
......@@ -65,9 +65,6 @@ module Homebrew
ENV.activate_extensions!
ENV.setup_build_environment
# Add RubyGems (for RuboCop).
ENV["PATH"] = PATH.new(ENV["PATH"]).append(HOMEBREW_GEM_HOME/"bin")
if ARGV.named.empty?
ff = Formula
files = Tap.map(&:formula_dir)
......
......@@ -35,7 +35,7 @@ module Homebrew
end
def regenerate_man_pages
Homebrew.run_bundler_if_needed!
Homebrew.install_gem_setup_path! "ronn"
markup = build_man_page
convert_man_page(markup, TARGET_DOC_PATH/"Manpage.md")
......
......@@ -46,10 +46,9 @@ module Homebrew
travis = <<-EOS.undent
language: ruby
os: osx
env: OSX=10.12
osx_image: xcode8.3
rvm: system
cache:
directories: /usr/local/Homebrew/Library/Homebrew/vendor
before_install:
- export TRAVIS_COMMIT="$(git rev-parse --verify -q HEAD)"
......
......@@ -49,6 +49,8 @@ module Homebrew
FileUtils.rm_f "test/coverage/.resultset.json"
end
ENV["BUNDLE_GEMFILE"] = "#{HOMEBREW_LIBRARY_PATH}/test/Gemfile"
# Override author/committer as global settings might be invalid and thus
# will cause silent failure during the setup of dummy Git repositories.
%w[AUTHOR COMMITTER].each do |role|
......@@ -57,7 +59,10 @@ module Homebrew
ENV["GIT_#{role}_DATE"] = "Sun Jan 22 19:59:13 2017 +0000"
end
Homebrew.run_bundler_if_needed!
Homebrew.install_gem_setup_path! "bundler"
unless quiet_system("bundle", "check")
system "bundle", "install"
end
parallel = true
......@@ -101,15 +106,10 @@ module Homebrew
files = files.reject { |p| p =~ %r{^test/os/linux(/.*|_spec\.rb)$} }
end
files.map! { |p| HOMEBREW_LIBRARY_PATH/p }
(HOMEBREW_LIBRARY_PATH/"vendor/#{RUBY_ENGINE}/#{RUBY_VERSION}").cd do
if parallel
system "parallel_rspec", *opts, "--", *args, "--", *files
else
system "rspec", *args, "--", *files
end
FileUtils.rm_rf "tmp"
if parallel
system "bundle", "exec", "parallel_rspec", *opts, "--", *args, "--", *files
else
system "bundle", "exec", "rspec", *args, "--", *files
end
return if $?.success?
......
require "vendor/macho/macho"
require "os/mac/architecture_list"
module MachOShim
# @private
def macho
@macho ||= begin
require "macho"
MachO.open(to_s)
end
end
......@@ -13,8 +12,6 @@ module MachOShim
# @private
def mach_data
@mach_data ||= begin
require "macho"
machos = []
mach_data = []
......
source "https://rubygems.org"
gem "parallel_tests"
gem "rspec"
gem "rubocop"
gem "rspec-its", require: false
gem "rspec-wait", require: false
group :coverage do
gem "simplecov", require: false
gem "codecov", require: false
end
......@@ -2,47 +2,36 @@ GEM
remote: https://rubygems.org/
specs:
ast (2.3.0)
codecov (0.1.10)
codecov (0.1.9)
json
simplecov
url
diff-lcs (1.3)
docile (1.1.5)
hpricot (0.8.6)
json (2.1.0)
mustache (1.0.5)
parallel (1.11.1)
parallel_tests (2.14.1)
json (2.0.3)
parallel (1.10.0)
parallel_tests (2.13.0)
parallel
parser (2.4.0.0)
ast (~> 2.2)
plist (3.3.0)
powerpack (0.1.1)
public_suffix (2.0.5)
rainbow (2.2.2)
rake
rake (12.0.0)
rdiscount (2.2.0.1)
ronn (0.7.3)
hpricot (>= 0.8.2)
mustache (>= 0.7.0)
rdiscount (>= 1.5.8)
rspec (3.6.0)
rspec-core (~> 3.6.0)
rspec-expectations (~> 3.6.0)
rspec-mocks (~> 3.6.0)
rspec-core (3.6.0)
rspec-support (~> 3.6.0)
rspec-expectations (3.6.0)
rainbow (2.2.1)
rspec (3.5.0)
rspec-core (~> 3.5.0)
rspec-expectations (~> 3.5.0)
rspec-mocks (~> 3.5.0)
rspec-core (3.5.4)
rspec-support (~> 3.5.0)
rspec-expectations (3.5.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.6.0)
rspec-support (~> 3.5.0)
rspec-its (1.2.0)
rspec-core (>= 3.0.0)
rspec-expectations (>= 3.0.0)
rspec-mocks (3.6.0)
rspec-mocks (3.5.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.6.0)
rspec-support (3.6.0)
rspec-support (~> 3.5.0)
rspec-support (3.5.0)
rspec-wait (0.0.9)
rspec (>= 3, < 4)
rubocop (0.47.1)
......@@ -51,17 +40,13 @@ GEM
rainbow (>= 1.99.1, < 3.0)
ruby-progressbar (~> 1.7)
unicode-display_width (~> 1.0, >= 1.0.1)
rubocop-cask (0.12.0)
public_suffix (~> 2.0)
rubocop (~> 0.47.1)
ruby-macho (1.1.0)
ruby-progressbar (1.8.1)
simplecov (0.14.1)
simplecov (0.13.0)
docile (~> 1.1.0)
json (>= 1.8, < 3)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.0)
unicode-display_width (1.2.1)
unicode-display_width (1.1.3)
url (0.3.2)
PLATFORMS
......@@ -70,15 +55,11 @@ PLATFORMS
DEPENDENCIES
codecov
parallel_tests
plist
ronn
rspec
rspec-its
rspec-wait
rubocop (~> 0.47.1)
rubocop-cask (~> 0.12.0)
ruby-macho
rubocop
simplecov
BUNDLED WITH
1.14.6
1.14.5
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment