bundler 1.14.4 → 1.14.5

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of bundler might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2e0f2e439c63ecff52ba92e4ad2909db13bb291c705609e245105a04a0ae89ac
4
- data.tar.gz: 79b7f7de1d3cacf9ca9552fb0981bfbfb886c38d5667e2f12db52b429ba908a0
3
+ metadata.gz: 2100f5dffe1a1a753faca372bf1c5f3838715580c2acb0aa9513e938100575cc
4
+ data.tar.gz: c564d74033eefd53cdda1a9e5c8992e5090ac67c251c9c691ed2c51d692a0b6e
5
5
  SHA512:
6
- metadata.gz: 31397cf61f59e568acfce1d5646303f18107679f3a3e0d9e87d360d95108eedab6ad303548863bf77329a6129fbeccf3958f4939676017f548067100efbecc10
7
- data.tar.gz: 6f1ed7f36b19027ec440a8659a492dddd72e289c6855ec3ed288ef31f07e9724d5a2a416db9a4e5d36c3c0889212aa4b1ba5c5b4568952166a147d07829f6bea
6
+ metadata.gz: af14db114e66673f77255884adc891aa7c390d9f07ad8502c938b355b228e082f7a2babd0f29fc19bf2579a7fac2e2e6eeb8fca5a8867f147c556189410c3c90
7
+ data.tar.gz: b58357e2fefceb182a35d350246633c840d78206ff7151cbc1d6149a11ebef17f01b599ae4d940b39921cfa49d19b9a6da8060f65fa330bb256b1abea7aeccf2
@@ -1,3 +1,18 @@
1
+ ## 1.14.5 (2017-02-22)
2
+
3
+ Bugfixes:
4
+
5
+ - avoid loading all unused gemspecs during `bundle exec` on RubyGems 2.3+ (@segiddins)
6
+ - improve resolver performance when dependencies have zero or one total possibilities ignoring requirements (#5444, #5457, @segiddins)
7
+ - enable compact index when OpenSSL FIPS mode is enabled but not active (#5433, @wjordan)
8
+ - use github username instead of git name for the github url in `bundle gem` (#5438, @danielpclark)
9
+ - avoid a TypeError on RubyGems 2.6.8 when no build settings are set for native extensions (@okkez)
10
+ - fail gracefully when the dependency api is missing runtime dependencies for a gem (@segiddins)
11
+ - handle when a platform-specific gem has more dependencies than the ruby platform version (#5339, #5426, @segiddins)
12
+ - allow running bundler on a machine with no home directory where the temporary directory is not writable (#5371, @segiddins)
13
+ - avoid gem version conflicts on openssl using Ruby 2.5 (#5235, @rhenium)
14
+ - fail when installing in frozen mode and the dependencies for `gemspec` gems have changed without the lockfile being updated (#5264, @segiddins)
15
+
1
16
  ## 1.14.4 (2017-02-12)
2
17
 
3
18
  Bugfixes:
@@ -8,7 +8,11 @@ Gem::Specification.new do |s|
8
8
  s.name = "bundler"
9
9
  s.version = Bundler::VERSION
10
10
  s.license = "MIT"
11
- s.authors = ["André Arko", "Samuel Giddins"]
11
+ s.authors = [
12
+ "André Arko", "Samuel Giddins", "Chris Morris", "James Wen", "Tim Moore",
13
+ "André Medeiros", "Jessica Lynn Suttles", "Terence Lee", "Carl Lerche",
14
+ "Yehuda Katz"
15
+ ]
12
16
  s.email = ["team@bundler.io"]
13
17
  s.homepage = "http://bundler.io"
14
18
  s.summary = "The best way to manage your application's dependencies"
@@ -32,11 +36,4 @@ Gem::Specification.new do |s|
32
36
  s.bindir = "exe"
33
37
  s.executables = %w(bundle bundler)
34
38
  s.require_paths = ["lib"]
35
-
36
- s.post_install_message = <<-END.lines.map(&:strip).join(" ")
37
- Did you know that maintaining and improving Bundler and RubyGems.org costs
38
- more than $25,000 USD every month? Help us keep the gem ecosystem free for
39
- everyone by joining the hundreds of companies and individuals who help
40
- cover these costs: https://ruby.to/support-bundler
41
- END
42
39
  end
@@ -176,7 +176,7 @@ module Bundler
176
176
  tmp_home_path.join(login).tap(&:mkpath)
177
177
  end
178
178
  rescue => e
179
- raise "#{warning}\nBundler also failed to create a temporary home directory at `#{path}':\n#{e}"
179
+ raise e.exception("#{warning}\nBundler also failed to create a temporary home directory at `#{path}':\n#{e}")
180
180
  end
181
181
 
182
182
  def user_bundle_path
@@ -29,7 +29,8 @@ module Bundler
29
29
  constant_name = name.gsub(/-[_-]*(?![_-]|$)/) { "::" }.gsub(/([_-]+|(::)|^)(.|$)/) { $2.to_s + $3.upcase }
30
30
  constant_array = constant_name.split("::")
31
31
 
32
- git_user_name = `git config user.name`.chomp
32
+ git_author_name = `git config user.name`.chomp
33
+ github_username = `git config github.user`.chomp
33
34
  git_user_email = `git config user.email`.chomp
34
35
 
35
36
  config = {
@@ -39,13 +40,13 @@ module Bundler
39
40
  :makefile_path => "#{underscored_name}/#{underscored_name}",
40
41
  :constant_name => constant_name,
41
42
  :constant_array => constant_array,
42
- :author => git_user_name.empty? ? "TODO: Write your name" : git_user_name,
43
+ :author => git_author_name.empty? ? "TODO: Write your name" : git_author_name,
43
44
  :email => git_user_email.empty? ? "TODO: Write your email address" : git_user_email,
44
45
  :test => options[:test],
45
46
  :ext => options[:ext],
46
47
  :exe => options[:exe],
47
48
  :bundler_version => bundler_dependency_version,
48
- :git_user_name => git_user_name.empty? ? "[USERNAME]" : git_user_name
49
+ :github_username => github_username.empty? ? "[USERNAME]" : github_username
49
50
  }
50
51
  ensure_safe_gem_name(name, constant_array)
51
52
 
@@ -104,7 +104,7 @@ module Bundler
104
104
 
105
105
  add_current_platform unless Bundler.settings[:frozen]
106
106
 
107
- converge_gemspec_sources
107
+ converge_path_sources_to_gemspec_sources
108
108
  @path_changes = converge_paths
109
109
  @source_changes = converge_sources
110
110
 
@@ -462,12 +462,13 @@ module Bundler
462
462
  changed << "* #{name} from `#{gemfile_source_name}` to `#{lockfile_source_name}`"
463
463
  end
464
464
 
465
+ msg << "\n\n#{change_reason.split(", ").join("\n")}\n"
465
466
  msg << "\n\nYou have added to the Gemfile:\n" << added.join("\n") if added.any?
466
467
  msg << "\n\nYou have deleted from the Gemfile:\n" << deleted.join("\n") if deleted.any?
467
468
  msg << "\n\nYou have changed in the Gemfile:\n" << changed.join("\n") if changed.any?
468
469
  msg << "\n"
469
470
 
470
- raise ProductionError, msg if added.any? || deleted.any? || changed.any?
471
+ raise ProductionError, msg if added.any? || deleted.any? || changed.any? || !nothing_changed?
471
472
  end
472
473
 
473
474
  def validate_runtime!
@@ -592,7 +593,8 @@ module Bundler
592
593
  locked_index = Index.new
593
594
  locked_index.use(@locked_specs.select {|s| source.can_lock?(s) })
594
595
 
595
- source.specs != locked_index
596
+ # order here matters, since Index#== is checking source.specs.include?(locked_index)
597
+ locked_index != source.specs
596
598
  end
597
599
 
598
600
  # Get all locals and override their matching sources.
@@ -628,7 +630,7 @@ module Bundler
628
630
  gemspec_source || source
629
631
  end
630
632
 
631
- def converge_gemspec_sources
633
+ def converge_path_sources_to_gemspec_sources
632
634
  @locked_sources.map! do |source|
633
635
  converge_path_source_to_gemspec_source(source)
634
636
  end
@@ -750,8 +752,9 @@ module Bundler
750
752
  next unless other
751
753
 
752
754
  deps2 = other.dependencies.select {|d| d.type != :development }
755
+ runtime_dependencies = s.dependencies.select {|d| d.type != :development }
753
756
  # If the dependencies of the path source have changed, unlock it
754
- next unless s.dependencies.sort == deps2.sort
757
+ next unless runtime_dependencies.sort == deps2.sort
755
758
  end
756
759
 
757
760
  converged << s
@@ -91,6 +91,13 @@ module Bundler
91
91
  end
92
92
 
93
93
  def __swap__(spec)
94
+ without_type = proc {|d| Gem::Dependency.new(d.name, d.requirements_list.sort) }
95
+ if (extra_deps = spec.runtime_dependencies.map(&without_type).-(dependencies.map(&without_type))) && extra_deps.any?
96
+ Bundler.ui.debug "#{full_name} from #{remote} has corrupted API dependencies (API returned #{dependencies}, real spec has (#{spec.runtime_dependencies}))"
97
+ raise APIResponseMismatchError,
98
+ "Downloading #{full_name} revealed dependencies not in the API (#{extra_deps.map(&:to_s).join(", ")})." \
99
+ "\nInstalling with `--full-index` should fix the problem."
100
+ end
94
101
  @remote_specification = spec
95
102
  end
96
103
 
@@ -54,6 +54,7 @@ module Bundler
54
54
  class PluginError < BundlerError; status_code(29); end
55
55
  class SudoNotPermittedError < BundlerError; status_code(30); end
56
56
  class ThreadCreationError < BundlerError; status_code(33); end
57
+ class APIResponseMismatchError < BundlerError; status_code(34); end
57
58
  class GemfileEvalError < GemfileError; end
58
59
  class MarshalError < StandardError; end
59
60
 
@@ -122,14 +122,13 @@ module Bundler
122
122
  end
123
123
 
124
124
  def md5_available?
125
- begin
126
- require "openssl"
127
- return false if defined?(OpenSSL::OPENSSL_FIPS) && OpenSSL::OPENSSL_FIPS
128
- rescue LoadError
129
- nil
130
- end
131
-
125
+ require "openssl"
126
+ OpenSSL::Digest::MD5.digest("")
127
+ true
128
+ rescue LoadError
132
129
  true
130
+ rescue OpenSSL::Digest::DigestError
131
+ false
133
132
  end
134
133
  end
135
134
  end
@@ -144,6 +144,8 @@ module Bundler
144
144
  end
145
145
  end
146
146
 
147
+ # Whether all the specs in self are in other
148
+ # TODO: rename to #include?
147
149
  def ==(other)
148
150
  all? do |spec|
149
151
  other_spec = other[spec].first
@@ -16,7 +16,7 @@ module Bundler
16
16
  Bundler.ui.debug "#{worker}: #{spec.name} (#{spec.version}) from #{spec.loaded_from}"
17
17
  generate_executable_stubs
18
18
  return true, post_install_message
19
- rescue Bundler::InstallHookError, Bundler::SecurityError
19
+ rescue Bundler::InstallHookError, Bundler::SecurityError, APIResponseMismatchError
20
20
  raise
21
21
  rescue Errno::ENOSPC
22
22
  return false, out_of_space_message
@@ -52,7 +52,7 @@ module Bundler
52
52
  end
53
53
 
54
54
  def install
55
- spec.source.install(spec, :force => force, :ensure_builtin_gems_cached => standalone, :build_args => [spec_settings])
55
+ spec.source.install(spec, :force => force, :ensure_builtin_gems_cached => standalone, :build_args => Array(spec_settings))
56
56
  end
57
57
 
58
58
  def install_with_settings
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
  require "uri"
3
- require "rubygems/spec_fetcher"
4
3
  require "bundler/match_platform"
5
4
 
6
5
  module Bundler
@@ -73,7 +72,14 @@ module Bundler
73
72
  @specification = if source.is_a?(Source::Gemspec) && source.gemspec.name == name
74
73
  source.gemspec.tap {|s| s.source = source }
75
74
  else
76
- source.specs.search(search_object).last
75
+ search = source.specs.search(search_object).last
76
+ if search && search.platform != platform && !search.runtime_dependencies.-(dependencies.reject {|d| d.type == :development }).empty?
77
+ Bundler.ui.warn "Unable to use the platform-specific (#{search.platform}) version of #{name} (#{version}) " \
78
+ "because it has different dependencies from the #{platform} version. " \
79
+ "To use the platform-specific version of the gem, run `bundle config specific_platform true` and install again."
80
+ search = source.specs.search(self).last
81
+ end
82
+ search
77
83
  end
78
84
  end
79
85
 
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
  require "uri"
3
- require "rubygems/spec_fetcher"
4
3
 
5
4
  module Bundler
6
5
  # Represents a lazily loaded gem specification, where the full specification
@@ -50,6 +49,13 @@ module Bundler
50
49
  # once the remote gem is downloaded, the backend specification will
51
50
  # be swapped out.
52
51
  def __swap__(spec)
52
+ without_type = proc {|d| Gem::Dependency.new(d.name, d.requirements_list) }
53
+ if (extra_deps = spec.runtime_dependencies.map(&without_type).-(dependencies.map(&without_type))) && extra_deps.any?
54
+ Bundler.ui.debug "#{full_name} from #{remote} has corrupted API dependencies (API returned #{dependencies}, real spec has (#{spec.runtime_dependencies}))"
55
+ raise APIResponseMismatchError,
56
+ "Downloading #{full_name} revealed dependencies not in the API (#{extra_deps.map(&without_type).map(&:to_s).join(", ")})." \
57
+ "\nInstalling with `--full-index` should fix the problem."
58
+ end
53
59
  @_remote_specification = spec
54
60
  end
55
61
 
@@ -230,11 +230,11 @@ module Bundler
230
230
 
231
231
  def debug?
232
232
  return @debug_mode if defined?(@debug_mode)
233
- @debug_mode = ENV["DEBUG_RESOLVER"] || ENV["DEBUG_RESOLVER_TREE"]
233
+ @debug_mode = ENV["DEBUG_RESOLVER"] || ENV["DEBUG_RESOLVER_TREE"] || false
234
234
  end
235
235
 
236
236
  def before_resolution
237
- Bundler.ui.info "Resolving dependencies...", false
237
+ Bundler.ui.info "Resolving dependencies...", debug?
238
238
  end
239
239
 
240
240
  def after_resolution
@@ -242,7 +242,7 @@ module Bundler
242
242
  end
243
243
 
244
244
  def indicate_progress
245
- Bundler.ui.info ".", false
245
+ Bundler.ui.info ".", false unless debug?
246
246
  end
247
247
 
248
248
  include Molinillo::SpecificationProvider
@@ -328,6 +328,12 @@ module Bundler
328
328
 
329
329
  private
330
330
 
331
+ # returns an integer \in (-\infty, 0]
332
+ # a number closer to 0 means the dependency is less constraining
333
+ #
334
+ # dependencies w/ 0 or 1 possibilities (ignoring version requirements)
335
+ # are given very negative values, so they _always_ sort first,
336
+ # before dependencies that are unconstrained
331
337
  def amount_constrained(dependency)
332
338
  @amount_constrained ||= {}
333
339
  @amount_constrained[dependency.name] ||= begin
@@ -335,8 +341,9 @@ module Bundler
335
341
  dependency.requirement.satisfied_by?(base.first.version) ? 0 : 1
336
342
  else
337
343
  all = index_for(dependency).search(dependency.name).size
344
+
338
345
  if all <= 1
339
- all
346
+ all - 1_000_000
340
347
  else
341
348
  search = search_for(dependency).size
342
349
  search - all
@@ -213,6 +213,7 @@ module Bundler
213
213
  end
214
214
 
215
215
  def fetch_specs(all, pre, &blk)
216
+ require "rubygems/spec_fetcher"
216
217
  specs = Gem::SpecFetcher.new.list(all, pre)
217
218
  specs.each { yield } if block_given?
218
219
  specs
@@ -284,7 +284,11 @@ module Bundler
284
284
  if ENV["BUNDLE_CONFIG"] && !ENV["BUNDLE_CONFIG"].empty?
285
285
  Pathname.new(ENV["BUNDLE_CONFIG"])
286
286
  else
287
- Bundler.user_bundle_path.join("config")
287
+ begin
288
+ Bundler.user_bundle_path.join("config")
289
+ rescue PermissionError, GenericSystemCallError
290
+ nil
291
+ end
288
292
  end
289
293
  end
290
294
 
@@ -4,10 +4,12 @@ module Bundler
4
4
  class Path < Source
5
5
  autoload :Installer, "bundler/source/path/installer"
6
6
 
7
- attr_reader :path, :options, :root_path
7
+ attr_reader :path, :options, :root_path, :original_path
8
8
  attr_writer :name
9
9
  attr_accessor :version
10
10
 
11
+ protected :original_path
12
+
11
13
  DEFAULT_GLOB = "{,*,*/*}.gemspec".freeze
12
14
 
13
15
  def initialize(options)
@@ -61,7 +63,7 @@ module Bundler
61
63
 
62
64
  def eql?(other)
63
65
  return unless other.class == self.class
64
- expanded_path == expand(other.path) &&
66
+ expand(@original_path) == expand(other.original_path) &&
65
67
  version == other.version
66
68
  end
67
69
 
@@ -130,8 +132,8 @@ module Bundler
130
132
  end
131
133
 
132
134
  def lockfile_path
133
- return relative_path if path.absolute?
134
- expand(path).relative_path_from(Bundler.root)
135
+ return relative_path(original_path) if original_path.absolute?
136
+ expand(original_path).relative_path_from(Bundler.root)
135
137
  end
136
138
 
137
139
  def app_cache_path(custom_path = nil)
@@ -186,7 +188,7 @@ module Bundler
186
188
  index
187
189
  end
188
190
 
189
- def relative_path
191
+ def relative_path(path = self.path)
190
192
  if path.to_s.start_with?(root_path.to_s)
191
193
  return path.relative_path_from(root_path)
192
194
  end
@@ -1,7 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  require "uri"
3
3
  require "rubygems/user_interaction"
4
- require "rubygems/spec_fetcher"
5
4
 
6
5
  module Bundler
7
6
  class Source
@@ -30,6 +30,10 @@ module Bundler
30
30
  end
31
31
  end
32
32
 
33
+ def to_s
34
+ "rubygems remote at #{anonymized_uri}"
35
+ end
36
+
33
37
  private
34
38
 
35
39
  def apply_auth(uri, auth)
@@ -20,8 +20,8 @@ module Bundler
20
20
  specs = []
21
21
  skip += ["bundler"]
22
22
 
23
- until deps.empty?
24
- dep = deps.shift
23
+ loop do
24
+ break unless dep = deps.shift
25
25
  next if handled[dep] || skip.include?(dep.name)
26
26
 
27
27
  handled[dep] = true
@@ -155,14 +155,15 @@ module Bundler
155
155
  end
156
156
 
157
157
  def spec_for_dependency(dep, match_current_platform)
158
+ specs_for_platforms = lookup[dep.name]
158
159
  if match_current_platform
159
160
  Bundler.rubygems.platforms.reverse_each do |pl|
160
- match = GemHelpers.select_best_platform_match(lookup[dep.name], pl)
161
+ match = GemHelpers.select_best_platform_match(specs_for_platforms, pl)
161
162
  return match if match
162
163
  end
163
164
  nil
164
165
  else
165
- GemHelpers.select_best_platform_match(lookup[dep.name], dep.__platform)
166
+ GemHelpers.select_best_platform_match(specs_for_platforms, dep.__platform)
166
167
  end
167
168
  end
168
169
 
@@ -15,6 +15,13 @@ module Bundler
15
15
  _remote_specification.to_yaml
16
16
  end
17
17
 
18
+ if Bundler.rubygems.provides?(">= 2.3")
19
+ # This is defined directly to avoid having to load every installed spec
20
+ def missing_extensions?
21
+ stub.missing_extensions?
22
+ end
23
+ end
24
+
18
25
  private
19
26
 
20
27
  def _remote_specification
@@ -32,7 +32,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
32
32
 
33
33
  ## Contributing
34
34
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/<%= config[:git_user_name] %>/<%= config[:name] %>.<% if config[:coc] %> This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.<% end %>
35
+ Bug reports and pull requests are welcome on GitHub at https://github.com/<%= config[:github_username] %>/<%= config[:name] %>.<% if config[:coc] %> This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.<% end %>
36
36
  <% if config[:mit] %>
37
37
 
38
38
  ## License
@@ -7,5 +7,5 @@ module Bundler
7
7
  # We're doing this because we might write tests that deal
8
8
  # with other versions of bundler and we are unsure how to
9
9
  # handle this better.
10
- VERSION = "1.14.4" unless defined?(::Bundler::VERSION)
10
+ VERSION = "1.14.5" unless defined?(::Bundler::VERSION)
11
11
  end
@@ -268,10 +268,23 @@ mirror to fetch gems.
268
268
 
269
269
  bundle config mirror.SOURCE_URL MIRROR_URL
270
270
 
271
- For example, to use a mirror of rubygems.org hosted at
271
+ For example, to use a mirror of rubygems.org hosted at rubygems-mirror.org:
272
272
 
273
273
  bundle config mirror.http://rubygems.org http://rubygems-mirror.org
274
274
 
275
+ Each mirror also provides a fallback timeout setting. If the mirror does not
276
+ respond within the fallback timeout, Bundler will try to use the original
277
+ server instead of the mirror.
278
+
279
+ bundle config mirror.SOURCE_URL.fallback_timeout TIMEOUT
280
+
281
+ For example, to fall back to rubygems.org after 3 seconds:
282
+
283
+ bundle config mirror.https://rubygems.org.fallback_timeout 3
284
+
285
+ The default fallback timeout is 0.1 seconds, but the setting can currently
286
+ only accept whole seconds (for example, 1, 15, or 30).
287
+
275
288
  ## CREDENTIALS FOR GEM SOURCES
276
289
 
277
290
  Bundler allows you to configure credentials for any gem source, which allows
metadata CHANGED
@@ -1,15 +1,23 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bundler
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.14.4
4
+ version: 1.14.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - André Arko
8
8
  - Samuel Giddins
9
+ - Chris Morris
10
+ - James Wen
11
+ - Tim Moore
12
+ - André Medeiros
13
+ - Jessica Lynn Suttles
14
+ - Terence Lee
15
+ - Carl Lerche
16
+ - Yehuda Katz
9
17
  autorequire:
10
18
  bindir: exe
11
19
  cert_chain: []
12
- date: 2017-02-12 00:00:00.000000000 Z
20
+ date: 2017-02-22 00:00:00.000000000 Z
13
21
  dependencies:
14
22
  - !ruby/object:Gem::Dependency
15
23
  name: automatiek
@@ -371,10 +379,7 @@ homepage: http://bundler.io
371
379
  licenses:
372
380
  - MIT
373
381
  metadata: {}
374
- post_install_message: 'Did you know that maintaining and improving Bundler and RubyGems.org
375
- costs more than $25,000 USD every month? Help us keep the gem ecosystem free for
376
- everyone by joining the hundreds of companies and individuals who help cover these
377
- costs: https://ruby.to/support-bundler'
382
+ post_install_message:
378
383
  rdoc_options: []
379
384
  require_paths:
380
385
  - lib