rubygems-update 3.2.5 → 3.2.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2f6bb6c4c3306717f1cbb6c31a681fb34fe87a80908be9788cf9b8670acd0f45
4
- data.tar.gz: 54f8871259d5e897c28946c66908e8ee64cf96be9dfd13e3fe47ed75f92a0fca
3
+ metadata.gz: '093385346fd2dadfc857a5fcbea99a97af3067867975c40fc7221369cc2bae20'
4
+ data.tar.gz: 42de60d07aeefb67549285a2d76c01aabe903747affcc348bd8ec1d3ad079469
5
5
  SHA512:
6
- metadata.gz: 56a73fe1ec095a370b2b8ebc93e0a4aa8e8986841b33b02a5eca4475e89fa59929039a4a9aae248e4aa8f6cef2236d7e47d887c98df2487ab5f5f265af1f2084
7
- data.tar.gz: 50aacfbe514a2c5a0567325bded2095de0fdb2a33f794bb8f2872855848ad88594d82189bfcf67767909daf9e8e6f984f3a7b9de5dcd1bf1c4c34f018ea51ec2
6
+ metadata.gz: 3db9aa4bd25ce7f35219c7c3a56c0937f02c31c1d40ff0b51cc4077a7624a44036e01ae31beecac396146021e1063603675956d136670517bdb285d927e2879e
7
+ data.tar.gz: 7a0be9453ed03fc389f4a31e5a39907b1c4295cdffb979f91c9ac77acb3ec66950424992a3da187bfde4ec5a5f1d7d9797ad9c58404039aaf8e5db98f02685cb
@@ -1,3 +1,17 @@
1
+ # 3.2.6 / 2021-01-18
2
+
3
+ ## Enhancements:
4
+
5
+ * Fix `Gem::Platform#inspect` showing duplicate information. Pull request
6
+ #4276 by deivid-rodriguez
7
+
8
+ ## Bug fixes:
9
+
10
+ * Swallow any system call error in `ensure_gem_subdirs` to support jruby
11
+ embedded paths. Pull request #4291 by kares
12
+ * Restore accepting custom make command with extra options as the `make`
13
+ env variable. Pull request #4271 by terceiro
14
+
1
15
  # 3.2.5 / 2021-01-11
2
16
 
3
17
  ## Bug fixes:
data/Rakefile CHANGED
@@ -7,7 +7,12 @@ require 'psych'
7
7
 
8
8
  desc "Setup Rubygems dev environment"
9
9
  task :setup do
10
- sh "ruby bundler/bin/bundle install --gemfile=dev_gems.rb"
10
+ sh "ruby", "bundler/bin/bundle", "install", "--gemfile=dev_gems.rb"
11
+ end
12
+
13
+ desc "Update Rubygems dev environment"
14
+ task :update do |_, args|
15
+ sh "ruby", "bundler/bin/bundle", "update", *args, "--gemfile=dev_gems.rb"
11
16
  end
12
17
 
13
18
  desc "Setup git hooks"
@@ -1,3 +1,17 @@
1
+ # 2.2.6 (January 18, 2021)
2
+
3
+ ## Enhancements:
4
+
5
+ - Improve resolver debugging [#4288](https://github.com/rubygems/rubygems/pull/4288)
6
+
7
+ ## Bug fixes:
8
+
9
+ - Fix dependency locking for path source [#4293](https://github.com/rubygems/rubygems/pull/4293)
10
+
11
+ ## Performance:
12
+
13
+ - Speed up complex dependency resolves by creating DepProxy factory and cache [#4216](https://github.com/rubygems/rubygems/pull/4216)
14
+
1
15
  # 2.2.5 (January 11, 2021)
2
16
 
3
17
  ## Enhancements:
@@ -4,8 +4,8 @@ module Bundler
4
4
  # Represents metadata from when the Bundler gem was built.
5
5
  module BuildMetadata
6
6
  # begin ivars
7
- @built_at = "2021-01-11".freeze
8
- @git_commit_sha = "ba867aed7f".freeze
7
+ @built_at = "2021-01-19".freeze
8
+ @git_commit_sha = "e95bea3837".freeze
9
9
  @release = true
10
10
  # end ivars
11
11
 
@@ -818,11 +818,6 @@ module Bundler
818
818
  # commonly happens if the version changed in the gemspec
819
819
  next unless new_spec
820
820
 
821
- new_runtime_deps = new_spec.dependencies.select {|d| d.type != :development }
822
- old_runtime_deps = s.dependencies.select {|d| d.type != :development }
823
- # If the dependencies of the path source have changed and locked spec can't satisfy new dependencies, unlock it
824
- next unless new_runtime_deps.sort == old_runtime_deps.sort || new_runtime_deps.all? {|d| satisfies_locked_spec?(d) }
825
-
826
821
  s.dependencies.replace(new_spec.dependencies)
827
822
  end
828
823
 
@@ -897,7 +892,7 @@ module Bundler
897
892
 
898
893
  def expand_dependency_with_platforms(dep, platforms)
899
894
  platforms.map do |p|
900
- DepProxy.new(dep, p)
895
+ DepProxy.get_proxy(dep, p)
901
896
  end
902
897
  end
903
898
 
@@ -977,7 +972,7 @@ module Bundler
977
972
  next requirements if @locked_gems.dependencies[name] != dependency
978
973
  next requirements if dependency.source.is_a?(Source::Path)
979
974
  dep = Gem::Dependency.new(name, ">= #{locked_spec.version}")
980
- requirements[name] = DepProxy.new(dep, locked_spec.platform)
975
+ requirements[name] = DepProxy.get_proxy(dep, locked_spec.platform)
981
976
  requirements
982
977
  end.values
983
978
  end
@@ -4,19 +4,18 @@ module Bundler
4
4
  class DepProxy
5
5
  attr_reader :__platform, :dep
6
6
 
7
+ @proxies = {}
8
+
9
+ def self.get_proxy(dep, platform)
10
+ @proxies[[dep, platform]] ||= new(dep, platform).freeze
11
+ end
12
+
7
13
  def initialize(dep, platform)
8
14
  @dep = dep
9
15
  @__platform = platform
10
16
  end
11
17
 
12
- def hash
13
- @hash ||= [dep, __platform].hash
14
- end
15
-
16
- def ==(other)
17
- return false if other.class != self.class
18
- dep == other.dep && __platform == other.__platform
19
- end
18
+ private_class_method :new
20
19
 
21
20
  alias_method :eql?, :==
22
21
 
@@ -39,6 +38,14 @@ module Bundler
39
38
  s
40
39
  end
41
40
 
41
+ def dup
42
+ raise NoMethodError.new("DepProxy cannot be duplicated")
43
+ end
44
+
45
+ def clone
46
+ raise NoMethodError.new("DepProxy cannot be cloned")
47
+ end
48
+
42
49
  private
43
50
 
44
51
  def method_missing(*args, &blk)
@@ -81,8 +81,8 @@ module Bundler
81
81
  sort_dep_specs(spec_groups, locked_spec)
82
82
  end.tap do |specs|
83
83
  if DEBUG
84
- warn before_result
85
- warn " after sort_versions: #{debug_format_result(dep, specs).inspect}"
84
+ puts before_result
85
+ puts " after sort_versions: #{debug_format_result(dep, specs).inspect}"
86
86
  end
87
87
  end
88
88
  end
@@ -32,7 +32,7 @@ module Bundler
32
32
  @base_dg = Molinillo::DependencyGraph.new
33
33
  @base.each do |ls|
34
34
  dep = Dependency.new(ls.name, ls.version)
35
- @base_dg.add_vertex(ls.name, DepProxy.new(dep, ls.platform), true)
35
+ @base_dg.add_vertex(ls.name, DepProxy.get_proxy(dep, ls.platform), true)
36
36
  end
37
37
  additional_base_requirements.each {|d| @base_dg.add_vertex(d.name, d) }
38
38
  @platforms = platforms
@@ -75,7 +75,7 @@ module Bundler
75
75
  return unless debug?
76
76
  debug_info = yield
77
77
  debug_info = debug_info.inspect unless debug_info.is_a?(String)
78
- puts debug_info.split("\n").map {|s| "BUNDLER: " + " " * depth + s }
78
+ puts debug_info.split("\n").map {|s| depth == 0 ? "BUNDLER: #{s}" : "BUNDLER(#{depth}): #{s}" }
79
79
  end
80
80
 
81
81
  def debug?
@@ -99,7 +99,7 @@ module Bundler
99
99
  spec.dependencies.each do |dep|
100
100
  next if dep.type == :development
101
101
  next if @ignores_bundler_dependencies && dep.name == "bundler".freeze
102
- dependencies[platform] << DepProxy.new(dep, platform)
102
+ dependencies[platform] << DepProxy.get_proxy(dep, platform)
103
103
  end
104
104
  end
105
105
  dependencies[platform]
@@ -110,10 +110,10 @@ module Bundler
110
110
  return [] unless spec && spec.is_a?(Gem::Specification)
111
111
  dependencies = []
112
112
  if !spec.required_ruby_version.nil? && !spec.required_ruby_version.none?
113
- dependencies << DepProxy.new(Gem::Dependency.new("Ruby\0", spec.required_ruby_version), platform)
113
+ dependencies << DepProxy.get_proxy(Gem::Dependency.new("Ruby\0", spec.required_ruby_version), platform)
114
114
  end
115
115
  if !spec.required_rubygems_version.nil? && !spec.required_rubygems_version.none?
116
- dependencies << DepProxy.new(Gem::Dependency.new("RubyGems\0", spec.required_rubygems_version), platform)
116
+ dependencies << DepProxy.get_proxy(Gem::Dependency.new("RubyGems\0", spec.required_rubygems_version), platform)
117
117
  end
118
118
  dependencies
119
119
  end
@@ -158,6 +158,22 @@ module Gem
158
158
  end
159
159
  end
160
160
 
161
+ if Gem::Requirement.new("~> 2.0").hash == Gem::Requirement.new("~> 2.0.0").hash
162
+ class Requirement
163
+ module CorrectHashForLambdaOperator
164
+ def hash
165
+ if requirements.any? {|r| r.first == "~>" }
166
+ requirements.map {|r| r.first == "~>" ? [r[0], r[1].to_s] : r }.sort.hash
167
+ else
168
+ super
169
+ end
170
+ end
171
+ end
172
+
173
+ prepend CorrectHashForLambdaOperator
174
+ end
175
+ end
176
+
161
177
  class Platform
162
178
  JAVA = Gem::Platform.new("java") unless defined?(JAVA)
163
179
  MSWIN = Gem::Platform.new("mswin32") unless defined?(MSWIN)
@@ -28,7 +28,7 @@ module Bundler
28
28
 
29
29
  specs_for_dep.first.dependencies.each do |d|
30
30
  next if d.type == :development
31
- d = DepProxy.new(d, dep.__platform) unless match_current_platform
31
+ d = DepProxy.get_proxy(d, dep.__platform) unless match_current_platform
32
32
  deps << d
33
33
  end
34
34
  elsif check
@@ -329,11 +329,11 @@ module Bundler::Molinillo
329
329
 
330
330
  # Look for past conflicts that could be unwound to affect the
331
331
  # requirement tree for the current conflict
332
+ all_reqs = last_detail_for_current_unwind.all_requirements
333
+ all_reqs_size = all_reqs.size
332
334
  relevant_unused_unwinds = unused_unwind_options.select do |alternative|
333
- intersecting_requirements =
334
- last_detail_for_current_unwind.all_requirements &
335
- alternative.requirements_unwound_to_instead
336
- next if intersecting_requirements.empty?
335
+ diff_reqs = all_reqs - alternative.requirements_unwound_to_instead
336
+ next if diff_reqs.size == all_reqs_size
337
337
  # Find the highest index unwind whilst looping through
338
338
  current_detail = alternative if alternative > current_detail
339
339
  alternative
@@ -344,8 +344,12 @@ module Bundler::Molinillo
344
344
  state.unused_unwind_options += unwind_details.reject { |detail| detail.state_index == -1 }
345
345
 
346
346
  # Update the requirements_unwound_to_instead on any relevant unused unwinds
347
- relevant_unused_unwinds.each { |d| d.requirements_unwound_to_instead << current_detail.state_requirement }
348
- unwind_details.each { |d| d.requirements_unwound_to_instead << current_detail.state_requirement }
347
+ relevant_unused_unwinds.each do |d|
348
+ (d.requirements_unwound_to_instead << current_detail.state_requirement).uniq!
349
+ end
350
+ unwind_details.each do |d|
351
+ (d.requirements_unwound_to_instead << current_detail.state_requirement).uniq!
352
+ end
349
353
 
350
354
  current_detail
351
355
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: false
2
2
 
3
3
  module Bundler
4
- VERSION = "2.2.5".freeze
4
+ VERSION = "2.2.6".freeze
5
5
 
6
6
  def self.bundler_major_version
7
7
  @bundler_major_version ||= VERSION.split(".").first.to_i
@@ -8,7 +8,7 @@
8
8
  require 'rbconfig'
9
9
 
10
10
  module Gem
11
- VERSION = "3.2.5".freeze
11
+ VERSION = "3.2.6".freeze
12
12
  end
13
13
 
14
14
  # Must be first since it unloads the prelude from 1.9.2
@@ -469,7 +469,7 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
469
469
  next if File.exist? subdir
470
470
  begin
471
471
  FileUtils.mkdir_p subdir, **options
472
- rescue Errno::EACCES
472
+ rescue SystemCallError
473
473
  end
474
474
  end
475
475
  ensure
@@ -28,13 +28,14 @@ class Gem::Ext::Builder
28
28
  unless make_program
29
29
  make_program = (/mswin/ =~ RUBY_PLATFORM) ? 'nmake' : 'make'
30
30
  end
31
+ make_program = Shellwords.split(make_program)
31
32
 
32
33
  destdir = 'DESTDIR=%s' % ENV['DESTDIR']
33
34
 
34
35
  ['clean', '', 'install'].each do |target|
35
36
  # Pass DESTDIR via command line to override what's in MAKEFLAGS
36
37
  cmd = [
37
- make_program,
38
+ *make_program,
38
39
  destdir,
39
40
  target,
40
41
  ].reject(&:empty?)
@@ -121,10 +121,6 @@ class Gem::Platform
121
121
  end
122
122
  end
123
123
 
124
- def inspect
125
- "%s @cpu=%p, @os=%p, @version=%p>" % [super[0..-2], *to_a]
126
- end
127
-
128
124
  def to_a
129
125
  [@cpu, @os, @version]
130
126
  end
@@ -190,7 +190,7 @@ class Gem::Requirement
190
190
  end
191
191
 
192
192
  def hash # :nodoc:
193
- requirements.sort.hash
193
+ requirements.map {|r| r.first == "~>" ? [r[0], r[1].to_s] : r }.sort.hash
194
194
  end
195
195
 
196
196
  def marshal_dump # :nodoc:
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "rubygems-update"
5
- s.version = "3.2.5"
5
+ s.version = "3.2.6"
6
6
  s.authors = ["Jim Weirich", "Chad Fowler", "Eric Hodel", "Luis Lavena", "Aaron Patterson", "Samuel Giddins", "André Arko", "Evan Phoenix", "Hiroshi SHIBATA"]
7
7
  s.email = ["", "", "drbrain@segment7.net", "luislavena@gmail.com", "aaron@tenderlovemaking.com", "segiddins@segiddins.me", "andre@arko.net", "evan@phx.io", "hsbt@ruby-lang.org"]
8
8
 
@@ -692,6 +692,11 @@ class TestGem < Gem::TestCase
692
692
  ensure
693
693
  FileUtils.chmod 0600, parent
694
694
  end
695
+
696
+ def test_self_ensure_gem_directories_non_existent_paths
697
+ Gem.ensure_gem_subdirectories '/proc/0123456789/bogus' # should not raise
698
+ Gem.ensure_gem_subdirectories 'classpath:/bogus/x' # JRuby embed scenario
699
+ end
695
700
  end
696
701
 
697
702
  def test_self_extension_dir_shared
@@ -14,6 +14,7 @@ class TestGemExtBuilder < Gem::TestCase
14
14
  FileUtils.mkdir_p @dest_path
15
15
 
16
16
  @orig_DESTDIR = ENV['DESTDIR']
17
+ @orig_make = ENV['make']
17
18
 
18
19
  @spec = util_spec 'a'
19
20
 
@@ -22,6 +23,7 @@ class TestGemExtBuilder < Gem::TestCase
22
23
 
23
24
  def teardown
24
25
  ENV['DESTDIR'] = @orig_DESTDIR
26
+ ENV['make'] = @orig_make
25
27
 
26
28
  super
27
29
  end
@@ -81,6 +83,28 @@ install:
81
83
  assert_match %r{DESTDIR\\=#{ENV['DESTDIR']} install$}, results
82
84
  end
83
85
 
86
+ def test_custom_make_with_options
87
+ ENV['make'] = 'make V=1'
88
+ results = []
89
+ File.open File.join(@ext, 'Makefile'), 'w' do |io|
90
+ io.puts <<-MAKEFILE
91
+ all:
92
+ \t@#{Gem.ruby} -e "puts 'all: OK'"
93
+
94
+ clean:
95
+ \t@#{Gem.ruby} -e "puts 'clean: OK'"
96
+
97
+ install:
98
+ \t@#{Gem.ruby} -e "puts 'install: OK'"
99
+ MAKEFILE
100
+ end
101
+ Gem::Ext::Builder.make @dest_path, results, @ext
102
+ results = results.join("\n").b
103
+ assert_match %r{clean: OK}, results
104
+ assert_match %r{all: OK}, results
105
+ assert_match %r{install: OK}, results
106
+ end
107
+
84
108
  def test_build_extensions
85
109
  @spec.extensions << 'ext/extconf.rb'
86
110
 
@@ -356,6 +356,14 @@ class TestGemPlatform < Gem::TestCase
356
356
  assert_local_match 'sparc-solaris2.8-mq5.3'
357
357
  end
358
358
 
359
+ def test_inspect
360
+ result = Gem::Platform.new("universal-java11").inspect
361
+
362
+ assert_equal 1, result.scan(/@cpu=/).size
363
+ assert_equal 1, result.scan(/@os=/).size
364
+ assert_equal 1, result.scan(/@version=/).size
365
+ end
366
+
359
367
  def assert_local_match(name)
360
368
  assert_match Gem::Platform.local, name
361
369
  end
@@ -402,6 +402,27 @@ class TestGemRequirement < Gem::TestCase
402
402
  assert_equal r1.hash, r2.hash
403
403
  end
404
404
 
405
+ def test_hash_returns_equal_hashes_for_equivalent_requirements
406
+ refute_requirement_hash_equal "= 1.2", "= 1.3"
407
+ refute_requirement_hash_equal "= 1.3", "= 1.2"
408
+
409
+ refute_requirement_hash_equal "~> 1.3", "~> 1.3.0"
410
+ refute_requirement_hash_equal "~> 1.3.0", "~> 1.3"
411
+
412
+ assert_requirement_hash_equal ["> 2", "~> 1.3", "~> 1.3.1"], ["~> 1.3.1", "~> 1.3", "> 2"]
413
+
414
+ assert_requirement_hash_equal ["> 2", "~> 1.3"], ["> 2.0", "~> 1.3"]
415
+ assert_requirement_hash_equal ["> 2.0", "~> 1.3"], ["> 2", "~> 1.3"]
416
+
417
+ assert_requirement_hash_equal "= 1.0", "= 1.0.0"
418
+ assert_requirement_hash_equal "= 1.1", "= 1.1.0"
419
+ assert_requirement_hash_equal "= 1", "= 1.0.0"
420
+
421
+ assert_requirement_hash_equal "1.0", "1.0.0"
422
+ assert_requirement_hash_equal "1.1", "1.1.0"
423
+ assert_requirement_hash_equal "1", "1.0.0"
424
+ end
425
+
405
426
  # Assert that two requirements are equal. Handles Gem::Requirements,
406
427
  # strings, arrays, numbers, and versions.
407
428
 
@@ -416,6 +437,13 @@ class TestGemRequirement < Gem::TestCase
416
437
  "#{requirement} is satisfied by #{version}"
417
438
  end
418
439
 
440
+ # Assert that two requirement hashes are equal. Handles Gem::Requirements,
441
+ # strings, arrays, numbers, and versions.
442
+
443
+ def assert_requirement_hash_equal(expected, actual)
444
+ assert_equal req(expected).hash, req(actual).hash
445
+ end
446
+
419
447
  # Refute the assumption that two requirements are equal.
420
448
 
421
449
  def refute_requirement_equal(unexpected, actual)
@@ -428,4 +456,10 @@ class TestGemRequirement < Gem::TestCase
428
456
  refute req(requirement).satisfied_by?(v(version)),
429
457
  "#{requirement} is not satisfied by #{version}"
430
458
  end
459
+
460
+ # Refute the assumption that two requirements hashes are equal.
461
+
462
+ def refute_requirement_hash_equal(unexpected, actual)
463
+ refute_equal req(unexpected).hash, req(actual).hash
464
+ end
431
465
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubygems-update
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.5
4
+ version: 3.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jim Weirich
@@ -16,7 +16,7 @@ authors:
16
16
  autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
- date: 2021-01-11 00:00:00.000000000 Z
19
+ date: 2021-01-19 00:00:00.000000000 Z
20
20
  dependencies: []
21
21
  description: |-
22
22
  A package (also known as a library) contains a set of functionality