Skip to content

Commit

Permalink
Merge branch 'master' of github.com:bundler/bundler into master_b
Browse files Browse the repository at this point in the history
* 'master' of github.com:bundler/bundler: (163 commits)
  remove always-failing 1.8.7 build
  Rename to force_ruby_platform
  Fail fast in the specs when running from a path with special characters
  Change changelog on rubygems#4974
  Version 1.13.2 with changelog
  Auto merge of rubygems#4990 - bundler:seg-realworld-flex, r=segiddins
  Auto merge of rubygems#4922 - JuanitoFatas:fix/4914-gemfile-engine-symbol-and-string, r=segiddins
  Auto merge of rubygems#4983 - bundler:seg-redefine-method-visibility, r=indirect
  Auto merge of rubygems#4994 - bundler:seg-definition-init-perf, r=segiddins
  Auto merge of rubygems#4971 - bundler:seg-pare-metadata-error, r=indirect
  Auto merge of rubygems#4998 - srbaker:patch-1, r=segiddins
  Auto merge of rubygems#4968 - bundler:seg-exec-load-docs, r=indirect
  Auto merge of rubygems#5002 - alepore:fix-colors, r=indirect
  Auto merge of rubygems#5015 - m1k3:fix-settings-no-config, r=segiddins
  Auto merge of rubygems#4992 - chrismo:fix_disable_shared_gems_gem_path, r=chrismo
  Auto merge of rubygems#5008 - bundler:seg-lazy-specification-materialize-platform, r=indirect
  Auto merge of rubygems#5014 - bundler:seg-auto-install-bool-key, r=indirect
  Auto merge of rubygems#4928 - bundler:seg-update-compact-index, r=segiddins
  Improve IRB behavior in generated bin/console
  Add a spec for only_ruby_platform
  ...
  • Loading branch information
lolwut committed Oct 4, 2016
2 parents db6fa8f + e499c51 commit 18cff11
Show file tree
Hide file tree
Showing 124 changed files with 1,980 additions and 652 deletions.
3 changes: 3 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@ Metrics/AbcSize:
Metrics/CyclomaticComplexity:
Enabled: false

Metrics/ParameterLists:
Enabled: false

# It will be obvious which code is complex, Rubocop should only lint simple
# rules for us.
Metrics/PerceivedComplexity:
Expand Down
40 changes: 26 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ branches:
- /.+-stable$/

notifications:
email:
# andre
- secure: "bCcvqJT7YrBawtkXXwHhT+jOFth7r2Qv/30PkkbhQxk6Jb3xambjCOJ3U6vJ\ngYmiL50exi5lUp3oc3SEbHN5t2CrZqOZDQ6o7P8EAmB5c0oH2RrYaFOkI5Gt\nul/jGH/96A9sj0aMwG7JfdMSfhqj1DUKAm2PnnbXPL853VfmT24="
# terence
- secure: "MQ8eA5Jb8YzEpAo58DRGfVJklAPcEbAulpBZnTxp0am6ldneDtJHbQk21w6R\nj5GsDHlzr/lMp/GHIimtUZ7rLohfND8fj/W7fs1Dkd4eN02/ERt98x3pHlqv\nvZgSnZ39uVYv+OcphraE24QaRaGWLhWZAMYQTVe/Yz50NyG8g1U="
slack:
on_success: change
on_failure: always
Expand All @@ -43,12 +38,16 @@ env:
# We need to know if changes to rubygems will break bundler on release
- RGV=master
# Test the latest rubygems release with all of our supported rubies
- RGV=v2.6.4
- RGV=v2.4.8
- RGV=v2.6.6

matrix:
include:
# Ruby 2.2, Rubygems 2.4.5 and up (included by RGV above)
# Ruby 2.3, Rubygems 2.5.1 and up
- rvm: 2.2
env: RGV=v2.5.2
# Ruby 2.2, Rubygems 2.4.5 and up
- rvm: 2.2
env: RGV=v2.4.8
# Ruby 2.1, Rubygems 2.2.2 and up
- rvm: 2.1
env: RGV=v2.2.5
Expand All @@ -74,9 +73,12 @@ matrix:
env: RGV=v1.6.2
- rvm: 1.9.3
env: RGV=v1.5.3

# Ruby 1.8.7, Rubygems 1.3.6 and up
- rvm: 1.8.7
env: RGV=v2.2.5
# ALLOWED FAILURES
# since the great Travis image outage, frequent random segfaults :'(
- rvm: 1.8.7
env: RGV=v2.0.14
- rvm: 1.8.7
Expand All @@ -93,16 +95,26 @@ matrix:
env: RGV=v1.3.7
- rvm: 1.8.7
env: RGV=v1.3.6

# ALLOWED FAILURES
# For no apparent reason, this often goes over the Travis limit
- rvm: 1.8.7
env: RGV=v2.1.11
# Ruby-head (we want to know how we're doing, but not fail the build)
- rvm: ruby-head
env: RGV=master

allow_failures:
- rvm: 1.8.7
env: RGV=v2.1.11
env: RGV=v2.0.14
- rvm: 1.8.7
env: RGV=v1.8.29
- rvm: 1.8.7
env: RGV=v1.7.2
- rvm: 1.8.7
env: RGV=v1.6.2
- rvm: 1.8.7
env: RGV=v1.5.3
- rvm: 1.8.7
env: RGV=v1.4.2
- rvm: 1.8.7
env: RGV=v1.3.7
- rvm: 1.8.7
env: RGV=v1.3.6
- rvm: ruby-head
env: RGV=master
61 changes: 60 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,70 @@
## 1.13.2 (2016-09-30)

Bugfixes:

- allow `Settings` to be initialized without a root directory (@m1k3)
- allow specifying ruby engines in the gemfile as a symbol (#4919, @JuanitoFatas)
- avoid an execption when using `bundler/deployment` with Vlad (@srbaker)
- ensure redefined methods have the same visibility as the one they're replacing, fixing `Kernel.require` failing on JRuby (#4975, @segiddins)
- ensure that Bundler won't complain about a corrupt lockfile when no lockfile exists when using `gemspec` in the Gemfile (#5006, @segiddins)
- fail gracefully when parsing the metadata for a gemspec from the compact index fails (@segiddins)
- fix system gems not being copied to --path on bundle install (e.g. --deployment) (#4974, @chrismo)

Performance:

- avoid parsing the lockfile twice when evaluating gemfiles (@segiddins)

## 1.13.1 (2016-09-13)

Bugfixes:

- ensure that `Gem::Source` is available, fixing several exceptions (#4944, @dekellum)
- ensure that dependency resolution works when multiple gems have the same dependency (#4961, @segiddins)

## 1.13.0 (2016-09-05)

This space deliberately left blank.

## 1.13.0.rc.2 (2016-08-21)

Features:

- add setting `exec_disable_load` to force `exec` to spawn a new Ruby process (@segiddins)
- add `doctor` command to help with issues like unlinked compiled gems (#4765, @mistydemeo)
- rework the `update` command, providing fine-grained control via flags (#4676, @chrismo)
- add URI to http response output in debug mode (#4808, @NickLaMuro)
- add manpage for `binstubs` command (#4847, @Zorbash)
- support `mirror` settings for sources by hostname, not only full URL (@opiethehokie)
- print gem installation errors after other install output (#4834, @segiddins)
- add `lock --remove-platform` flag to remove platforms from the lock (#4877, @segiddins)
- add `only_update_to_newer_versions` setting to prevent downgrades during `update` (@segiddins)
- expanded experimental plugin support to include hooks and sources (@asutoshpalai)

Bugfixes:

- retry gem downloads (#4846, @jkeiser)
- improve the CompactIndex to handle capitalized legacy gems (#4867, @segiddins)
- re-use persistent HTTP connections for CompactIndex (@NickLaMuro)
- respect `required_ruby_version` when Gemfile contains `ruby` version (@indirect)
- allow `rake release` to sign git tags (#4743, @eagletmt)
- set process titles when using `#load` during `exec` (@yob)
- recognize JRuby shebangs for using `#load` during `exec` (@ojab)
- handle world-writable home directories (#4726, @allenzhao)
- support multi-platform gems via the `gemspec` Gemfile method (#4798, @segiddins)
- print dots correctly for CompactIndex fetcher (@NickLaMuro)
- set an `open_timeout` when requesting gem data via HTTP (@NickLaMuro)
- rename the BUNDLE\_ORIG\_ENV variable so it no longer shows up in `config` (@indirect)
- show help only when `-h` or `--help` is passed to Bundler, not to `exec` (#4801, @segiddins)
- handle symlinks to binstubs created by `--standalone` (#4782, @terinjokes)

## 1.13.0.rc.1 (2016-06-27)

Features:

- when `bundle config major_deprecations` or `BUNDLE_MAJOR_DEPRECATIONS` is set, deprecation warnings for bundler 2 will be printed (@segiddins)
- when running with `--verbose`, bundler will print the reason it is re-resolving a gemfile (@segiddins)

Bug fixes:
Bugfixes:

- fix support for running RubyGems 1.x on Ruby 2.3 (#4698, @segiddins)
- fix bundle exec'ing to a ruby file when gems are installed into a path (#4592, @chrismo)
Expand Down
4 changes: 3 additions & 1 deletion DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ If you have any questions after reading this page, please feel free to contact e

## How you can help

We track [small bugs and features](https://github.com/bundler/bundler/issues?labels=small) so that anyone who wants to help can start with something that's not too overwhelming. We also keep a [list of things anyone can help with, any time](https://github.com/bundler/bundler/blob/master/CONTRIBUTING.md#contributing). If nothing on those lists looks good, talk to us, and we'll figure out what you can help with. We can absolutely use your help, no matter what level of programming skill you have at the moment.
We track [small bugs and features](https://github.com/bundler/bundler/labels/contribution%3A%20small) so that anyone who wants to help can start with something that's not too overwhelming. We also keep a [list of things anyone can help with, any time](https://github.com/bundler/bundler/blob/master/CONTRIBUTING.md#contributing). If nothing on those lists looks good, talk to us, and we'll figure out what you can help with. We can absolutely use your help, no matter what level of programming skill you have at the moment.

# Development setup

Expand Down Expand Up @@ -40,6 +40,8 @@ Bundler doesn't use a Gemfile to list development dependencies, because when we

The `BUNDLE_DISABLE_POSTIT` environment variable ensures that the version of Bundler in `/path/to/bundler/lib` will be used. Without that environment setting, Bundler will automatically download, install, and run the version of Bundler listed in `Gemfile.lock`. With that set up, you can test changes you've made to Bundler by running `dbundle`, without interfering with the regular `bundle` command.

To dive into the code with Pry: `RUBYOPT=-rpry dbundle` to require pry and then run commands.

# Submitting Pull Requests

Before you submit a pull request, please remember to do the following:
Expand Down
17 changes: 17 additions & 0 deletions ISSUES.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,23 @@ Detailed information about each Bundler command, including help with common prob

## Troubleshooting

### Permission denied when installing bundler

Certain operating systems such as MacOS and Ubuntu have versions of Ruby that require evelated privileges to install gems.

ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory.

There are multiple ways to solve this issue. You can install bundler with elevated privilges using `sudo` or `su`.

sudo gem install bundler

If you cannot elevated your privileges or do not want to globally install Bundler, you can use the `--user-install` option.

gem install bundler --user-install

This will install Bundler into your home directory. Note that you will need to append `~/.gem/ruby/<ruby version>/bin` to your `$PATH` variable to use `bundle`.

### Heroku errors

Please open a ticket with [Heroku](https://www.heroku.com) if you're having trouble deploying. They have a professional support team who can help you resolve Heroku issues far better than the Bundler team can. If the problem that you are having turns out to be a bug in Bundler itself, [Heroku support](https://www.heroku.com/support) can get the exact details to us.
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ bundle install
bundle exec rspec
```

For help with installation issues, see [ISSUES](https://github.com/bundler/bundler/blob/master/ISSUES.md)

See [bundler.io](http://bundler.io) for the full documentation.

### Troubleshooting
Expand Down
9 changes: 1 addition & 8 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ begin
rubyopt = ENV["RUBYOPT"]
# When editing this list, also edit .travis.yml!
branches = %w(master)
releases = %w(v1.3.6 v1.3.7 v1.4.2 v1.5.3 v1.6.2 v1.7.2 v1.8.29 v2.0.14 v2.1.11 v2.2.5 v2.4.8 v2.6.4)
releases = %w(v1.3.6 v1.3.7 v1.4.2 v1.5.3 v1.6.2 v1.7.2 v1.8.29 v2.0.14 v2.1.11 v2.2.5 v2.4.8 v2.5.2 v2.6.6)
(branches + releases).each do |rg|
desc "Run specs with Rubygems #{rg}"
RSpec::Core::RakeTask.new(rg) do |t|
Expand Down Expand Up @@ -285,13 +285,6 @@ end
begin
require "automatiek"

Automatiek::RakeTask.new("compact_index_client") do |lib|
lib.download = { :github => "https://github.com/bundler/compact_index_client" }
lib.namespace = "CompactIndexClient"
lib.prefix = "Bundler"
lib.vendor_lib = "lib/bundler/vendor/compact_index_client"
end

Automatiek::RakeTask.new("molinillo") do |lib|
lib.download = { :github => "https://github.com/CocoaPods/Molinillo" }
lib.namespace = "Molinillo"
Expand Down
10 changes: 4 additions & 6 deletions exe/bundle
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@
# Exit cleanly from an early interrupt
Signal.trap("INT") { exit 1 }

unless ENV["BUNDLE_DISABLE_POSTIT"]
update = "update".start_with?(ARGV.first || " ") && ARGV.find {|a| a.start_with?("--bundler") }
update &&= update =~ /--bundler(?:=(.+))?/ && $1 || "> 0.a"
ENV["BUNDLER_VERSION"] = update if update
require "bundler/postit_trampoline"
end
update = "update".start_with?(ARGV.first || " ") && ARGV.find {|a| a.start_with?("--bundler") }
update &&= update =~ /--bundler(?:=(.+))?/ && $1 || "> 0.a"
ENV["BUNDLER_VERSION"] = update if update
require "bundler/postit_trampoline"

require "bundler"
# Check if an older version of bundler is installed
Expand Down
65 changes: 60 additions & 5 deletions lib/bundler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
require "pathname"
require "rbconfig"
require "thread"
require "tmpdir"

require "bundler/errors"
require "bundler/environment_preserver"
require "bundler/gem_remote_fetcher"
Expand All @@ -27,6 +29,7 @@ module Bundler
autoload :EndpointSpecification, "bundler/endpoint_specification"
autoload :Env, "bundler/env"
autoload :Fetcher, "bundler/fetcher"
autoload :FeatureFlag, "bundler/feature_flag"
autoload :GemHelper, "bundler/gem_helper"
autoload :GemHelpers, "bundler/gem_helpers"
autoload :GemVersionPromoter, "bundler/gem_version_promoter"
Expand Down Expand Up @@ -90,7 +93,7 @@ def setup(*groups)
# Return if all groups are already loaded
return @setup if defined?(@setup) && @setup

definition.validate_ruby!
definition.validate_runtime!

SharedHelpers.print_major_deprecations!

Expand Down Expand Up @@ -142,8 +145,41 @@ def ruby_scope
"#{Bundler.rubygems.ruby_engine}/#{Bundler.rubygems.config_map[:ruby_version]}"
end

def user_home
@user_home ||= begin
home = Bundler.rubygems.user_home
warning = "Your home directory is not set properly:"
if home.nil?
warning += "\n * It is not set at all"
elsif !File.directory?(home)
warning += "\n * `#{home}` is not a directory"
elsif !File.writable?(home)
warning += "\n * `#{home}` is not writable"
else
return @user_home = Pathname.new(home)
end

login = Etc.getlogin || "unknown"

tmp_home = Pathname.new(Dir.tmpdir).join("bundler", "home", login)
begin
SharedHelpers.filesystem_access(tmp_home, :write) do |p|
FileUtils.mkdir_p(p)
end
rescue => e
warning += "\n\nBundler also failed to create a temporary home directory at `#{tmp_home}`:\n#{e}"
raise warning
end

warning += "\n\nBundler will use `#{tmp_home}` as your home directory temporarily"

Bundler.ui.warn(warning)
tmp_home
end
end

def user_bundle_path
Pathname.new(Bundler.rubygems.user_home).join(".bundle")
Pathname.new(user_home).join(".bundle")
end

def home
Expand Down Expand Up @@ -257,6 +293,11 @@ def clean_exec(*args)
with_clean_env { Kernel.exec(*args) }
end

def local_platform
return Gem::Platform::RUBY if settings[:force_ruby_platform]
Gem::Platform.local
end

def default_gemfile
SharedHelpers.default_gemfile
end
Expand Down Expand Up @@ -328,17 +369,23 @@ def which(executable)
def sudo(str)
SUDO_MUTEX.synchronize do
prompt = "\n\n" + <<-PROMPT.gsub(/^ {6}/, "").strip + " "
Your user account isn't allowed to install to the system Rubygems.
Your user account isn't allowed to install to the system RubyGems.
You can cancel this installation and run:
bundle install --path vendor/bundle
to install the gems into ./vendor/bundle/, or you can enter your password
and install the bundled gems to Rubygems using sudo.
and install the bundled gems to RubyGems using sudo.
Password:
PROMPT

unless @prompted_for_sudo ||= system(%(sudo -k -p "#{prompt}" true))
raise SudoNotPermittedError,
"Bundler requires sudo access to install at the moment. " \
"Try installing again, granting Bundler sudo access when prompted, or installing into a different path."
end

`sudo -p "#{prompt}" #{str}`
end
end
Expand Down Expand Up @@ -389,6 +436,10 @@ def git_present?
@git_present = Bundler.which("git") || Bundler.which("git.exe")
end

def feature_flag
@feature_flag ||= FeatureFlag.new(VERSION)
end

def reset!
@root = nil
@settings = nil
Expand All @@ -398,6 +449,7 @@ def reset!
@locked_gems = nil
@bundle_path = nil
@bin_path = nil
@user_home = nil

Plugin.reset!

Expand Down Expand Up @@ -438,7 +490,10 @@ def configure_gem_home_and_path
def configure_gem_path(env = ENV, settings = self.settings)
blank_home = env["GEM_HOME"].nil? || env["GEM_HOME"].empty?
if settings[:disable_shared_gems]
env["GEM_PATH"] = nil
# this needs to be empty string to cause
# PathSupport.split_gem_path to only load up the
# Bundler --path setting as the GEM_PATH.
env["GEM_PATH"] = ""
elsif blank_home || Bundler.rubygems.gem_dir != bundle_path.to_s
possibles = [Bundler.rubygems.gem_dir, Bundler.rubygems.gem_path]
paths = possibles.flatten.compact.uniq.reject(&:empty?)
Expand Down
Loading

0 comments on commit 18cff11

Please sign in to comment.