rubygems-update 3.3.21 → 3.3.23

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +32 -0
  3. data/Manifest.txt +8 -0
  4. data/POLICIES.md +38 -5
  5. data/bundler/CHANGELOG.md +40 -0
  6. data/bundler/bundler.gemspec +6 -8
  7. data/bundler/lib/bundler/build_metadata.rb +2 -2
  8. data/bundler/lib/bundler/cli/init.rb +5 -1
  9. data/bundler/lib/bundler/cli.rb +2 -1
  10. data/bundler/lib/bundler/current_ruby.rb +14 -5
  11. data/bundler/lib/bundler/definition.rb +7 -20
  12. data/bundler/lib/bundler/dependency.rb +18 -85
  13. data/bundler/lib/bundler/dsl.rb +0 -1
  14. data/bundler/lib/bundler/endpoint_specification.rb +1 -1
  15. data/bundler/lib/bundler/feature_flag.rb +0 -1
  16. data/bundler/lib/bundler/gem_version_promoter.rb +10 -25
  17. data/bundler/lib/bundler/index.rb +3 -26
  18. data/bundler/lib/bundler/injector.rb +2 -1
  19. data/bundler/lib/bundler/lockfile_generator.rb +1 -1
  20. data/bundler/lib/bundler/man/bundle-add.1 +6 -2
  21. data/bundler/lib/bundler/man/bundle-add.1.ronn +4 -1
  22. data/bundler/lib/bundler/man/bundle-binstubs.1 +1 -1
  23. data/bundler/lib/bundler/man/bundle-cache.1 +1 -1
  24. data/bundler/lib/bundler/man/bundle-check.1 +1 -1
  25. data/bundler/lib/bundler/man/bundle-clean.1 +1 -1
  26. data/bundler/lib/bundler/man/bundle-config.1 +1 -1
  27. data/bundler/lib/bundler/man/bundle-console.1 +53 -0
  28. data/bundler/lib/bundler/man/bundle-console.1.ronn +44 -0
  29. data/bundler/lib/bundler/man/bundle-doctor.1 +1 -1
  30. data/bundler/lib/bundler/man/bundle-exec.1 +1 -1
  31. data/bundler/lib/bundler/man/bundle-gem.1 +1 -1
  32. data/bundler/lib/bundler/man/bundle-help.1 +13 -0
  33. data/bundler/lib/bundler/man/bundle-help.1.ronn +12 -0
  34. data/bundler/lib/bundler/man/bundle-info.1 +1 -1
  35. data/bundler/lib/bundler/man/bundle-init.1 +1 -1
  36. data/bundler/lib/bundler/man/bundle-inject.1 +1 -1
  37. data/bundler/lib/bundler/man/bundle-install.1 +1 -1
  38. data/bundler/lib/bundler/man/bundle-list.1 +1 -1
  39. data/bundler/lib/bundler/man/bundle-lock.1 +1 -1
  40. data/bundler/lib/bundler/man/bundle-open.1 +1 -1
  41. data/bundler/lib/bundler/man/bundle-outdated.1 +1 -1
  42. data/bundler/lib/bundler/man/bundle-platform.1 +1 -1
  43. data/bundler/lib/bundler/man/bundle-plugin.1 +1 -1
  44. data/bundler/lib/bundler/man/bundle-pristine.1 +1 -1
  45. data/bundler/lib/bundler/man/bundle-remove.1 +1 -1
  46. data/bundler/lib/bundler/man/bundle-show.1 +1 -1
  47. data/bundler/lib/bundler/man/bundle-update.1 +1 -1
  48. data/bundler/lib/bundler/man/bundle-version.1 +35 -0
  49. data/bundler/lib/bundler/man/bundle-version.1.ronn +24 -0
  50. data/bundler/lib/bundler/man/bundle-viz.1 +1 -1
  51. data/bundler/lib/bundler/man/bundle.1 +6 -2
  52. data/bundler/lib/bundler/man/bundle.1.ronn +4 -1
  53. data/bundler/lib/bundler/man/gemfile.5 +8 -38
  54. data/bundler/lib/bundler/man/gemfile.5.ronn +9 -27
  55. data/bundler/lib/bundler/man/index.txt +3 -0
  56. data/bundler/lib/bundler/match_remote_metadata.rb +4 -1
  57. data/bundler/lib/bundler/resolver/base.rb +50 -0
  58. data/bundler/lib/bundler/resolver.rb +72 -93
  59. data/bundler/lib/bundler/rubygems_ext.rb +24 -3
  60. data/bundler/lib/bundler/settings.rb +0 -1
  61. data/bundler/lib/bundler/spec_set.rb +11 -1
  62. data/bundler/lib/bundler/templates/newgem/gitlab-ci.yml.tt +5 -4
  63. data/bundler/lib/bundler/version.rb +1 -1
  64. data/lib/rubygems/gemcutter_utilities.rb +8 -1
  65. data/lib/rubygems/package.rb +9 -4
  66. data/lib/rubygems/platform.rb +17 -1
  67. data/lib/rubygems/query_utils.rb +2 -2
  68. data/lib/rubygems/resolver.rb +1 -1
  69. data/lib/rubygems.rb +1 -1
  70. data/rubygems-update.gemspec +1 -1
  71. data/test/rubygems/helper.rb +23 -19
  72. data/test/rubygems/packages/Bluebie-legs-0.6.2.gem +0 -0
  73. data/test/rubygems/test_gem.rb +254 -212
  74. data/test/rubygems/test_gem_commands_info_command.rb +26 -0
  75. data/test/rubygems/test_gem_commands_owner_command.rb +105 -24
  76. data/test/rubygems/test_gem_commands_push_command.rb +44 -23
  77. data/test/rubygems/test_gem_commands_signin_command.rb +28 -3
  78. data/test/rubygems/test_gem_commands_yank_command.rb +9 -9
  79. data/test/rubygems/test_gem_gemcutter_utilities.rb +16 -12
  80. data/test/rubygems/test_gem_package.rb +15 -0
  81. data/test/rubygems/test_gem_platform.rb +67 -0
  82. data/test/rubygems/test_gem_resolver.rb +33 -0
  83. data/test/rubygems/test_require.rb +5 -5
  84. data/test/rubygems/utilities.rb +36 -14
  85. metadata +11 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: abfdbab5d664b8189d2ee8b68769e3530bb7ffb54b324b61b70eae773305e142
4
- data.tar.gz: 7f2b71150cc622d254ea1287dff9dc8c6879a662a2e8452035666f020d1f1be6
3
+ metadata.gz: f93f67c33abbbb5ea165e7d2682601f04071a38b9b513388d9a5e428dd683297
4
+ data.tar.gz: 15847dcefd91515ea3057a9d1b3ff6da9ae367ee714cbdb43c5537d6fa5e7ea9
5
5
  SHA512:
6
- metadata.gz: 5e7973dc92bf831135bfae7327b8f1dd11a890693c4bbfbaf9adac050ce6c6d12c4176f74ec3f372f57a712bcb524e25569e1afde66f48b9a19b421966c61796
7
- data.tar.gz: 993a269fd39cea74ea2c136812e691d1c9b8477470d5180d2f0a06c4819800fabded2a401b2267bbdde72731c4bbb40f14e468d05a8fc52c7b3216a49ea2df30
6
+ metadata.gz: 62659400aed8a1f03108d675fe35674430b1fa5bc2a990ef4bc78fa03072e853b077472a2af0ceace9f7972eb62d8d2c475f9a811f911402a068d28550c26b78
7
+ data.tar.gz: 1ba9446a59bd88a30558850cf20d3b4fabae944e98ef6995e6dcdb940444f41226e923d50f3fac9839f086fce076ad6a4810e1e035b3d0cabce021a4c92dde91
data/CHANGELOG.md CHANGED
@@ -1,3 +1,35 @@
1
+ # 3.3.23 / 2022-10-05
2
+
3
+ ## Enhancements:
4
+
5
+ * Add better error handling for permanent redirect responses. Pull request
6
+ #5931 by jenshenny
7
+ * Installs bundler 2.3.23 as a default gem.
8
+
9
+ ## Bug fixes:
10
+
11
+ * Fix generic arm platform matching against runtime arm platforms with
12
+ eabi modifiers. Pull request #5957 by deivid-rodriguez
13
+ * Fix `Gem::Platform.match` not handling String argument properly. Pull
14
+ request #5939 by flavorjones
15
+ * Fix resolution on non-musl platforms. Pull request #5915 by
16
+ deivid-rodriguez
17
+ * Mask the file mode when extracting files. Pull request #5906 by
18
+ kddnewton
19
+
20
+ # 3.3.22 / 2022-09-07
21
+
22
+ ## Enhancements:
23
+
24
+ * Support non gnu libc arm-linux-eabi platforms. Pull request #5889 by
25
+ ntkme
26
+ * Installs bundler 2.3.22 as a default gem.
27
+
28
+ ## Bug fixes:
29
+
30
+ * Fix `gem info` with explicit `--version`. Pull request #5884 by
31
+ tonyaraujop
32
+
1
33
  # 3.3.21 / 2022-08-24
2
34
 
3
35
  ## Enhancements:
data/Manifest.txt CHANGED
@@ -103,12 +103,16 @@ bundler/lib/bundler/man/bundle-clean.1
103
103
  bundler/lib/bundler/man/bundle-clean.1.ronn
104
104
  bundler/lib/bundler/man/bundle-config.1
105
105
  bundler/lib/bundler/man/bundle-config.1.ronn
106
+ bundler/lib/bundler/man/bundle-console.1
107
+ bundler/lib/bundler/man/bundle-console.1.ronn
106
108
  bundler/lib/bundler/man/bundle-doctor.1
107
109
  bundler/lib/bundler/man/bundle-doctor.1.ronn
108
110
  bundler/lib/bundler/man/bundle-exec.1
109
111
  bundler/lib/bundler/man/bundle-exec.1.ronn
110
112
  bundler/lib/bundler/man/bundle-gem.1
111
113
  bundler/lib/bundler/man/bundle-gem.1.ronn
114
+ bundler/lib/bundler/man/bundle-help.1
115
+ bundler/lib/bundler/man/bundle-help.1.ronn
112
116
  bundler/lib/bundler/man/bundle-info.1
113
117
  bundler/lib/bundler/man/bundle-info.1.ronn
114
118
  bundler/lib/bundler/man/bundle-init.1
@@ -137,6 +141,8 @@ bundler/lib/bundler/man/bundle-show.1
137
141
  bundler/lib/bundler/man/bundle-show.1.ronn
138
142
  bundler/lib/bundler/man/bundle-update.1
139
143
  bundler/lib/bundler/man/bundle-update.1.ronn
144
+ bundler/lib/bundler/man/bundle-version.1
145
+ bundler/lib/bundler/man/bundle-version.1.ronn
140
146
  bundler/lib/bundler/man/bundle-viz.1
141
147
  bundler/lib/bundler/man/bundle-viz.1.ronn
142
148
  bundler/lib/bundler/man/bundle.1
@@ -161,6 +167,7 @@ bundler/lib/bundler/plugin/source_list.rb
161
167
  bundler/lib/bundler/process_lock.rb
162
168
  bundler/lib/bundler/remote_specification.rb
163
169
  bundler/lib/bundler/resolver.rb
170
+ bundler/lib/bundler/resolver/base.rb
164
171
  bundler/lib/bundler/resolver/spec_group.rb
165
172
  bundler/lib/bundler/retry.rb
166
173
  bundler/lib/bundler/ruby_dsl.rb
@@ -570,6 +577,7 @@ test/rubygems/invalidchild_cert.pem
570
577
  test/rubygems/invalidchild_cert_32.pem
571
578
  test/rubygems/invalidchild_key.pem
572
579
  test/rubygems/package/tar_test_case.rb
580
+ test/rubygems/packages/Bluebie-legs-0.6.2.gem
573
581
  test/rubygems/packages/ascii_binder-0.1.10.1.gem
574
582
  test/rubygems/packages/ill-formatted-platform-1.0.0.10.gem
575
583
  test/rubygems/plugin/exception/rubygems_plugin.rb
data/POLICIES.md CHANGED
@@ -42,8 +42,19 @@ at version 2.7, so when RubyGems 2.8 is released, it will only support Ruby
42
42
 
43
43
  ## Release Process
44
44
 
45
- Releases of new versions should follow these steps, to ensure the process is
46
- smooth and no needed steps are missed.
45
+ ### Permissions
46
+
47
+ You'll need the following environment variables set to release RubyGems &
48
+ Bundler:
49
+
50
+ * AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY: to be able to push RubyGems zip
51
+ files to s3 so that they appear at RubyGems [download page].
52
+
53
+ * GITHUB_RELEASE_PAT: A [GitHub PAT] with repo permissions, in order to push
54
+ GitHub releases and to use the GitHub API for changelog generation.
55
+
56
+ [download page]: https://rubygems.org/pages/download
57
+ [GitHub PAT]: https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token
47
58
 
48
59
  ### Recommendations for security releases
49
60
 
@@ -54,14 +65,36 @@ smooth and no needed steps are missed.
54
65
  have to work on weekends.
55
66
  * Continue with the regular release process below.
56
67
 
68
+ ### Automatic changelog and backport generation
69
+
70
+ PR labels and titles are used to automatically generate changelogs for patch and
71
+ minor releases.
72
+
73
+ When releasing, a changelog generation script goes through all PRs that have
74
+ never made it into a release, and selects only the ones with specific labels as
75
+ detailed in the `.changelog.yml` and `bundler/.changelog.yml` files. Those
76
+ particular PRs get backported to the stable branch and included in the release
77
+ changelog.
78
+
79
+ If PRs don't have a proper label, they won't be backported to patch releases.
80
+
81
+ If you want a PR to be backported to a patch level release, but don't want to
82
+ include it in the changelog, you can use the special `rubygems: backport` and
83
+ `bundler: backport` labels. For example, this is useful when backporting a PR
84
+ generates conflicts that are solved by backporting another PR with no user
85
+ visible changes. You can use these special labels to also backport the other PR
86
+ and not get any conflicts.
57
87
 
58
88
  ### Steps for patch releases
59
89
 
60
90
  * Confirm all PRs that you want backported are properly tagged with `rubygems:
61
91
  <type>` or `bundler: <type>` labels at GitHub.
62
- * Run `rake prepare_release[<target_version>]`, create a PR and merge it
63
- to the stable branch once CI passes.
64
- * Switch to the stable branch and pull the PR just merged.
92
+ * Run `rake prepare_release[<target_version>]`. This will create a PR to the
93
+ stable branch with the backports included in the release, and proper
94
+ changelogs and version bumps. It will also create a PR to merge release
95
+ changelogs into master.
96
+ * Once CI passes, merge the release PR, switch to the stable branch and pull
97
+ the PR just merged.
65
98
  * Release `bundler` with `(cd bundler && bin/rake release)`.
66
99
  * Release `rubygems` with `rake release`.
67
100
 
data/bundler/CHANGELOG.md CHANGED
@@ -1,3 +1,43 @@
1
+ # 2.3.23 (October 5, 2022)
2
+
3
+ ## Enhancements:
4
+
5
+ - Update GitLab CI template with new one [#5944](https://github.com/rubygems/rubygems/pull/5944)
6
+
7
+ ## Bug fixes:
8
+
9
+ - Fix `bundle init` not respecting umask in generated gem's Gemfile [#5947](https://github.com/rubygems/rubygems/pull/5947)
10
+
11
+ ## Performance:
12
+
13
+ - Further speed up Bundler by not sorting specs unnecessarily [#5868](https://github.com/rubygems/rubygems/pull/5868)
14
+
15
+ ## Documentation:
16
+
17
+ - Update Bundler new feature instructions [#5912](https://github.com/rubygems/rubygems/pull/5912)
18
+
19
+ # 2.3.22 (September 7, 2022)
20
+
21
+ ## Enhancements:
22
+
23
+ - Use a more accurate source code uri in gemspec [#5896](https://github.com/rubygems/rubygems/pull/5896)
24
+ - Support `--path` option in `bundle add` [#5897](https://github.com/rubygems/rubygems/pull/5897)
25
+ - Improve lockfile dependency unlocking [#5881](https://github.com/rubygems/rubygems/pull/5881)
26
+ - Add platform alias `:windows` to Gemfile DSL [#5650](https://github.com/rubygems/rubygems/pull/5650)
27
+ - Make `#to_lock` consistent between `Gem::Dependency` and `Bundler::Dependency` [#5872](https://github.com/rubygems/rubygems/pull/5872)
28
+ - Support marshaled index specifications with `nil` required ruby version [#5824](https://github.com/rubygems/rubygems/pull/5824)
29
+
30
+ ## Bug fixes:
31
+
32
+ - Fix resolution hanging on musl platforms [#5875](https://github.com/rubygems/rubygems/pull/5875)
33
+ - Fix another regression affecting the sorbet family of gems [#5874](https://github.com/rubygems/rubygems/pull/5874)
34
+
35
+ ## Documentation:
36
+
37
+ - Introduce bundle-console(1) man [#5901](https://github.com/rubygems/rubygems/pull/5901)
38
+ - Introduce bundle-version(1) man [#5895](https://github.com/rubygems/rubygems/pull/5895)
39
+ - Introduce bundle-help(1) man [#5886](https://github.com/rubygems/rubygems/pull/5886)
40
+
1
41
  # 2.3.21 (August 24, 2022)
2
42
 
3
43
  ## Enhancements:
@@ -22,14 +22,12 @@ Gem::Specification.new do |s|
22
22
  s.summary = "The best way to manage your application's dependencies"
23
23
  s.description = "Bundler manages an application's dependencies through its entire life, across many machines, systematically and repeatably"
24
24
 
25
- if s.respond_to?(:metadata=)
26
- s.metadata = {
27
- "bug_tracker_uri" => "https://github.com/rubygems/rubygems/issues?q=is%3Aopen+is%3Aissue+label%3ABundler",
28
- "changelog_uri" => "https://github.com/rubygems/rubygems/blob/master/bundler/CHANGELOG.md",
29
- "homepage_uri" => "https://bundler.io/",
30
- "source_code_uri" => "https://github.com/rubygems/rubygems/",
31
- }
32
- end
25
+ s.metadata = {
26
+ "bug_tracker_uri" => "https://github.com/rubygems/rubygems/issues?q=is%3Aopen+is%3Aissue+label%3ABundler",
27
+ "changelog_uri" => "https://github.com/rubygems/rubygems/blob/master/bundler/CHANGELOG.md",
28
+ "homepage_uri" => "https://bundler.io/",
29
+ "source_code_uri" => "https://github.com/rubygems/rubygems/tree/master/bundler",
30
+ }
33
31
 
34
32
  s.required_ruby_version = ">= 2.3.0"
35
33
  s.required_rubygems_version = ">= 2.5.2"
@@ -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 = "2022-08-24".freeze
8
- @git_commit_sha = "d54be5fdd8".freeze
7
+ @built_at = "2022-10-05".freeze
8
+ @git_commit_sha = "250d9d485d".freeze
9
9
  @release = true
10
10
  # end ivars
11
11
 
@@ -32,7 +32,11 @@ module Bundler
32
32
  file << spec.to_gemfile
33
33
  end
34
34
  else
35
- FileUtils.cp(File.expand_path("../templates/#{gemfile}", __dir__), gemfile)
35
+ File.open(File.expand_path("../templates/#{gemfile}", __dir__), "r") do |template|
36
+ File.open(gemfile, "wb") do |destination|
37
+ IO.copy_stream(template, destination)
38
+ end
39
+ end
36
40
  end
37
41
 
38
42
  puts "Writing new #{gemfile} to #{SharedHelpers.pwd}/#{gemfile}"
@@ -372,6 +372,7 @@ module Bundler
372
372
  method_option "group", :aliases => "-g", :type => :string
373
373
  method_option "source", :aliases => "-s", :type => :string
374
374
  method_option "require", :aliases => "-r", :type => :string, :banner => "Adds require path to gem. Provide false, or a path as a string."
375
+ method_option "path", :type => :string
375
376
  method_option "git", :type => :string
376
377
  method_option "github", :type => :string
377
378
  method_option "branch", :type => :string
@@ -516,7 +517,7 @@ module Bundler
516
517
  end
517
518
  end
518
519
 
519
- desc "version", "Prints the bundler's version information"
520
+ desc "version", "Prints Bundler version information"
520
521
  def version
521
522
  cli_help = current_command.name == "cli_help"
522
523
  if cli_help || ARGV.include?("version")
@@ -36,17 +36,18 @@ module Bundler
36
36
  rbx
37
37
  ruby
38
38
  truffleruby
39
+ windows
39
40
  x64_mingw
40
41
  ].freeze
41
42
 
42
43
  def ruby?
43
44
  return true if Bundler::GemHelpers.generic_local_platform == Gem::Platform::RUBY
44
45
 
45
- !mswin? && (RUBY_ENGINE == "ruby" || RUBY_ENGINE == "rbx" || RUBY_ENGINE == "maglev" || RUBY_ENGINE == "truffleruby")
46
+ !windows? && (RUBY_ENGINE == "ruby" || RUBY_ENGINE == "rbx" || RUBY_ENGINE == "maglev" || RUBY_ENGINE == "truffleruby")
46
47
  end
47
48
 
48
49
  def mri?
49
- !mswin? && RUBY_ENGINE == "ruby"
50
+ !windows? && RUBY_ENGINE == "ruby"
50
51
  end
51
52
 
52
53
  def rbx?
@@ -65,16 +66,24 @@ module Bundler
65
66
  RUBY_ENGINE == "truffleruby"
66
67
  end
67
68
 
68
- def mswin?
69
+ def windows?
69
70
  Gem.win_platform?
70
71
  end
71
72
 
73
+ def mswin?
74
+ # For backwards compatibility
75
+ windows?
76
+
77
+ # TODO: This should correctly be:
78
+ # windows? && Bundler.local_platform != Gem::Platform::RUBY && Bundler.local_platform.os == "mswin32" && Bundler.local_platform.cpu == "x86"
79
+ end
80
+
72
81
  def mswin64?
73
- Gem.win_platform? && Bundler.local_platform != Gem::Platform::RUBY && Bundler.local_platform.os == "mswin64" && Bundler.local_platform.cpu == "x64"
82
+ windows? && Bundler.local_platform != Gem::Platform::RUBY && Bundler.local_platform.os == "mswin64" && Bundler.local_platform.cpu == "x64"
74
83
  end
75
84
 
76
85
  def mingw?
77
- Gem.win_platform? && Bundler.local_platform != Gem::Platform::RUBY && Bundler.local_platform.os == "mingw32" && Bundler.local_platform.cpu != "x64"
86
+ windows? && Bundler.local_platform != Gem::Platform::RUBY && Bundler.local_platform.os == "mingw32" && Bundler.local_platform.cpu != "x64"
78
87
  end
79
88
 
80
89
  def x64_mingw?
@@ -106,6 +106,7 @@ module Bundler
106
106
  @locked_gems = nil
107
107
  @locked_deps = {}
108
108
  @locked_specs = SpecSet.new([])
109
+ @originally_locked_specs = @locked_specs
109
110
  @locked_sources = []
110
111
  @locked_platforms = []
111
112
  end
@@ -149,18 +150,7 @@ module Bundler
149
150
  end
150
151
 
151
152
  def gem_version_promoter
152
- @gem_version_promoter ||= begin
153
- locked_specs =
154
- if unlocking? && @locked_specs.empty? && !@lockfile_contents.empty?
155
- # Definition uses an empty set of locked_specs to indicate all gems
156
- # are unlocked, but GemVersionPromoter needs the locked_specs
157
- # for conservative comparison.
158
- Bundler::SpecSet.new(@locked_gems.specs)
159
- else
160
- @locked_specs
161
- end
162
- GemVersionPromoter.new(locked_specs, @unlock[:gems])
163
- end
153
+ @gem_version_promoter ||= GemVersionPromoter.new(@originally_locked_specs, @unlock[:gems])
164
154
  end
165
155
 
166
156
  def resolve_only_locally!
@@ -484,15 +474,13 @@ module Bundler
484
474
  def resolver
485
475
  @resolver ||= begin
486
476
  last_resolve = converge_locked_specs
487
- Resolver.new(source_requirements, last_resolve, gem_version_promoter, additional_base_requirements_for_resolve, platforms)
477
+ remove_ruby_from_platforms_if_necessary!(dependencies)
478
+ Resolver.new(source_requirements, last_resolve, gem_version_promoter, additional_base_requirements_for_resolve(last_resolve), platforms)
488
479
  end
489
480
  end
490
481
 
491
482
  def expanded_dependencies
492
- @expanded_dependencies ||= begin
493
- remove_ruby_from_platforms_if_necessary!(dependencies)
494
- expand_dependencies(dependencies + metadata_dependencies, true)
495
- end
483
+ @expanded_dependencies ||= expand_dependencies(dependencies + metadata_dependencies, true)
496
484
  end
497
485
 
498
486
  def filter_specs(specs, deps)
@@ -880,9 +868,9 @@ module Bundler
880
868
  end
881
869
  end
882
870
 
883
- def additional_base_requirements_for_resolve
871
+ def additional_base_requirements_for_resolve(last_resolve)
884
872
  return [] unless @locked_gems && unlocking? && !sources.expired_sources?(@locked_gems.sources)
885
- converge_specs(@originally_locked_specs).map do |locked_spec|
873
+ converge_specs(@originally_locked_specs - last_resolve).map do |locked_spec|
886
874
  Dependency.new(locked_spec.name, ">= #{locked_spec.version}")
887
875
  end.uniq
888
876
  end
@@ -896,7 +884,6 @@ module Bundler
896
884
 
897
885
  remove_platform(Gem::Platform::RUBY)
898
886
  add_current_platform
899
- resolver.platforms = @platforms
900
887
  end
901
888
 
902
889
  def source_map
@@ -7,92 +7,24 @@ require_relative "rubygems_ext"
7
7
  module Bundler
8
8
  class Dependency < Gem::Dependency
9
9
  attr_reader :autorequire
10
- attr_reader :groups, :platforms, :gemfile, :git, :github, :branch, :ref, :force_ruby_platform
10
+ attr_reader :groups, :platforms, :gemfile, :path, :git, :github, :branch, :ref, :force_ruby_platform
11
11
 
12
- # rubocop:disable Naming/VariableNumber
12
+ ALL_RUBY_VERSIONS = ((18..27).to_a + (30..31).to_a).freeze
13
13
  PLATFORM_MAP = {
14
- :ruby => Gem::Platform::RUBY,
15
- :ruby_18 => Gem::Platform::RUBY,
16
- :ruby_19 => Gem::Platform::RUBY,
17
- :ruby_20 => Gem::Platform::RUBY,
18
- :ruby_21 => Gem::Platform::RUBY,
19
- :ruby_22 => Gem::Platform::RUBY,
20
- :ruby_23 => Gem::Platform::RUBY,
21
- :ruby_24 => Gem::Platform::RUBY,
22
- :ruby_25 => Gem::Platform::RUBY,
23
- :ruby_26 => Gem::Platform::RUBY,
24
- :ruby_27 => Gem::Platform::RUBY,
25
- :ruby_30 => Gem::Platform::RUBY,
26
- :ruby_31 => Gem::Platform::RUBY,
27
- :mri => Gem::Platform::RUBY,
28
- :mri_18 => Gem::Platform::RUBY,
29
- :mri_19 => Gem::Platform::RUBY,
30
- :mri_20 => Gem::Platform::RUBY,
31
- :mri_21 => Gem::Platform::RUBY,
32
- :mri_22 => Gem::Platform::RUBY,
33
- :mri_23 => Gem::Platform::RUBY,
34
- :mri_24 => Gem::Platform::RUBY,
35
- :mri_25 => Gem::Platform::RUBY,
36
- :mri_26 => Gem::Platform::RUBY,
37
- :mri_27 => Gem::Platform::RUBY,
38
- :mri_30 => Gem::Platform::RUBY,
39
- :mri_31 => Gem::Platform::RUBY,
40
- :rbx => Gem::Platform::RUBY,
41
- :truffleruby => Gem::Platform::RUBY,
42
- :jruby => Gem::Platform::JAVA,
43
- :jruby_18 => Gem::Platform::JAVA,
44
- :jruby_19 => Gem::Platform::JAVA,
45
- :mswin => Gem::Platform::MSWIN,
46
- :mswin_18 => Gem::Platform::MSWIN,
47
- :mswin_19 => Gem::Platform::MSWIN,
48
- :mswin_20 => Gem::Platform::MSWIN,
49
- :mswin_21 => Gem::Platform::MSWIN,
50
- :mswin_22 => Gem::Platform::MSWIN,
51
- :mswin_23 => Gem::Platform::MSWIN,
52
- :mswin_24 => Gem::Platform::MSWIN,
53
- :mswin_25 => Gem::Platform::MSWIN,
54
- :mswin_26 => Gem::Platform::MSWIN,
55
- :mswin_27 => Gem::Platform::MSWIN,
56
- :mswin_30 => Gem::Platform::MSWIN,
57
- :mswin_31 => Gem::Platform::MSWIN,
58
- :mswin64 => Gem::Platform::MSWIN64,
59
- :mswin64_19 => Gem::Platform::MSWIN64,
60
- :mswin64_20 => Gem::Platform::MSWIN64,
61
- :mswin64_21 => Gem::Platform::MSWIN64,
62
- :mswin64_22 => Gem::Platform::MSWIN64,
63
- :mswin64_23 => Gem::Platform::MSWIN64,
64
- :mswin64_24 => Gem::Platform::MSWIN64,
65
- :mswin64_25 => Gem::Platform::MSWIN64,
66
- :mswin64_26 => Gem::Platform::MSWIN64,
67
- :mswin64_27 => Gem::Platform::MSWIN64,
68
- :mswin64_30 => Gem::Platform::MSWIN64,
69
- :mswin64_31 => Gem::Platform::MSWIN64,
70
- :mingw => Gem::Platform::MINGW,
71
- :mingw_18 => Gem::Platform::MINGW,
72
- :mingw_19 => Gem::Platform::MINGW,
73
- :mingw_20 => Gem::Platform::MINGW,
74
- :mingw_21 => Gem::Platform::MINGW,
75
- :mingw_22 => Gem::Platform::MINGW,
76
- :mingw_23 => Gem::Platform::MINGW,
77
- :mingw_24 => Gem::Platform::MINGW,
78
- :mingw_25 => Gem::Platform::MINGW,
79
- :mingw_26 => Gem::Platform::MINGW,
80
- :mingw_27 => Gem::Platform::MINGW,
81
- :mingw_30 => Gem::Platform::MINGW,
82
- :mingw_31 => Gem::Platform::MINGW,
83
- :x64_mingw => Gem::Platform::X64_MINGW,
84
- :x64_mingw_20 => Gem::Platform::X64_MINGW,
85
- :x64_mingw_21 => Gem::Platform::X64_MINGW,
86
- :x64_mingw_22 => Gem::Platform::X64_MINGW,
87
- :x64_mingw_23 => Gem::Platform::X64_MINGW,
88
- :x64_mingw_24 => Gem::Platform::X64_MINGW,
89
- :x64_mingw_25 => Gem::Platform::X64_MINGW,
90
- :x64_mingw_26 => Gem::Platform::X64_MINGW,
91
- :x64_mingw_27 => Gem::Platform::X64_MINGW,
92
- :x64_mingw_30 => Gem::Platform::X64_MINGW,
93
- :x64_mingw_31 => Gem::Platform::X64_MINGW,
94
- }.freeze
95
- # rubocop:enable Naming/VariableNumber
14
+ :ruby => [Gem::Platform::RUBY, ALL_RUBY_VERSIONS],
15
+ :mri => [Gem::Platform::RUBY, ALL_RUBY_VERSIONS],
16
+ :rbx => [Gem::Platform::RUBY],
17
+ :truffleruby => [Gem::Platform::RUBY],
18
+ :jruby => [Gem::Platform::JAVA, [18, 19]],
19
+ :windows => [Gem::Platform::WINDOWS, ALL_RUBY_VERSIONS],
20
+ :mswin => [Gem::Platform::MSWIN, ALL_RUBY_VERSIONS],
21
+ :mswin64 => [Gem::Platform::MSWIN64, ALL_RUBY_VERSIONS - [18]],
22
+ :mingw => [Gem::Platform::MINGW, ALL_RUBY_VERSIONS],
23
+ :x64_mingw => [Gem::Platform::X64_MINGW, ALL_RUBY_VERSIONS - [18, 19]],
24
+ }.each_with_object({}) do |(platform, spec), hash|
25
+ hash[platform] = spec[0]
26
+ spec[1]&.each {|version| hash[:"#{platform}_#{version}"] = spec[0] }
27
+ end.freeze
96
28
 
97
29
  def initialize(name, version, options = {}, &blk)
98
30
  type = options["type"] || :runtime
@@ -101,6 +33,7 @@ module Bundler
101
33
  @autorequire = nil
102
34
  @groups = Array(options["group"] || :default).map(&:to_sym)
103
35
  @source = options["source"]
36
+ @path = options["path"]
104
37
  @git = options["git"]
105
38
  @github = options["github"]
106
39
  @branch = options["branch"]
@@ -151,7 +84,7 @@ module Bundler
151
84
  def to_lock
152
85
  out = super
153
86
  out << "!" if source
154
- out << "\n"
87
+ out
155
88
  end
156
89
 
157
90
  def specific?
@@ -67,7 +67,6 @@ module Bundler
67
67
 
68
68
  gemspecs = Gem::Util.glob_files_in_dir("{,*}.gemspec", expanded_path).map {|g| Bundler.load_gemspec(g) }.compact
69
69
  gemspecs.reject! {|s| s.name != name } if name
70
- Index.sort_specs(gemspecs)
71
70
  specs_by_name_and_version = gemspecs.group_by {|s| [s.name, s.version] }
72
71
 
73
72
  case specs_by_name_and_version.size
@@ -12,7 +12,7 @@ module Bundler
12
12
  super()
13
13
  @name = name
14
14
  @version = Gem::Version.create version
15
- @platform = platform
15
+ @platform = Gem::Platform.new(platform)
16
16
  @spec_fetcher = spec_fetcher
17
17
  @dependencies = dependencies.map {|dep, reqs| build_dependency(dep, reqs) }
18
18
 
@@ -39,7 +39,6 @@ module Bundler
39
39
  settings_flag(:setup_makes_kernel_gem_public) { !bundler_3_mode? }
40
40
  settings_flag(:suppress_install_using_messages) { bundler_3_mode? }
41
41
  settings_flag(:update_requires_all_flag) { bundler_4_mode? }
42
- settings_flag(:use_gem_version_promoter_for_major_updates) { bundler_3_mode? }
43
42
 
44
43
  settings_option(:default_cli_command) { bundler_3_mode? ? :cli_help : :install }
45
44
 
@@ -55,19 +55,17 @@ module Bundler
55
55
  @level = v
56
56
  end
57
57
 
58
- # Given a Dependency and an Array of SpecGroups of available versions for a
59
- # gem, this method will return the Array of SpecGroups sorted (and possibly
58
+ # Given a Dependency and an Array of Specifications of available versions for a
59
+ # gem, this method will return the Array of Specifications sorted (and possibly
60
60
  # truncated if strict is true) in an order to give preference to the current
61
61
  # level (:major, :minor or :patch) when resolution is deciding what versions
62
62
  # best resolve all dependencies in the bundle.
63
63
  # @param dep [Dependency] The Dependency of the gem.
64
- # @param spec_groups [SpecGroup] An array of SpecGroups for the same gem
64
+ # @param spec_groups [Specification] An array of Specifications for the same gem
65
65
  # named in the @dep param.
66
- # @return [SpecGroup] A new instance of the SpecGroup Array sorted and
66
+ # @return [Specification] A new instance of the Specification Array sorted and
67
67
  # possibly filtered.
68
68
  def sort_versions(dep, spec_groups)
69
- before_result = "before sort_versions: #{debug_format_result(dep, spec_groups).inspect}" if DEBUG
70
-
71
69
  @sort_versions[dep] ||= begin
72
70
  gem_name = dep.name
73
71
 
@@ -79,11 +77,6 @@ module Bundler
79
77
  filter_dep_specs(spec_groups, locked_spec)
80
78
  else
81
79
  sort_dep_specs(spec_groups, locked_spec)
82
- end.tap do |specs|
83
- if DEBUG
84
- puts before_result
85
- puts " after sort_versions: #{debug_format_result(dep, specs).inspect}"
86
- end
87
80
  end
88
81
  end
89
82
  end
@@ -123,15 +116,14 @@ module Bundler
123
116
  end
124
117
 
125
118
  def sort_dep_specs(spec_groups, locked_spec)
126
- return spec_groups unless locked_spec
127
- @gem_name = locked_spec.name
128
- @locked_version = locked_spec.version
119
+ @locked_version = locked_spec&.version
120
+ @gem_name = locked_spec&.name
129
121
 
130
122
  result = spec_groups.sort do |a, b|
131
123
  @a_ver = a.version
132
124
  @b_ver = b.version
133
125
 
134
- unless @prerelease_specified[@gem_name]
126
+ unless @gem_name && @prerelease_specified[@gem_name]
135
127
  a_pre = @a_ver.prerelease?
136
128
  b_pre = @b_ver.prerelease?
137
129
 
@@ -155,7 +147,7 @@ module Bundler
155
147
  end
156
148
 
157
149
  def either_version_older_than_locked
158
- @a_ver < @locked_version || @b_ver < @locked_version
150
+ @locked_version && (@a_ver < @locked_version || @b_ver < @locked_version)
159
151
  end
160
152
 
161
153
  def segments_do_not_match(level)
@@ -164,7 +156,7 @@ module Bundler
164
156
  end
165
157
 
166
158
  def unlocking_gem?
167
- unlock_gems.empty? || unlock_gems.include?(@gem_name)
159
+ unlock_gems.empty? || (@gem_name && unlock_gems.include?(@gem_name))
168
160
  end
169
161
 
170
162
  # Specific version moves can't always reliably be done during sorting
@@ -172,7 +164,7 @@ module Bundler
172
164
  def post_sort(result)
173
165
  # default :major behavior in Bundler does not do this
174
166
  return result if major?
175
- if unlocking_gem?
167
+ if unlocking_gem? || @locked_version.nil?
176
168
  result
177
169
  else
178
170
  move_version_to_end(result, @locked_version)
@@ -183,12 +175,5 @@ module Bundler
183
175
  move, keep = result.partition {|s| s.version.to_s == version.to_s }
184
176
  keep.concat(move)
185
177
  end
186
-
187
- def debug_format_result(dep, spec_groups)
188
- a = [dep.to_s,
189
- spec_groups.map {|sg| [sg.version, sg.dependencies_for_activated_platforms.map {|dp| [dp.name, dp.requirement.to_s] }] }]
190
- last_map = a.last.map {|sg_data| [sg_data.first.version, sg_data.last.map {|aa| aa.join(" ") }] }
191
- [a.first, last_map, level, strict ? :strict : :not_strict]
192
- end
193
178
  end
194
179
  end