rubygems-update 3.3.15 → 3.3.18

Sign up to get free protection for your applications and to get access to all the features.
Files changed (115) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +49 -0
  3. data/Manifest.txt +5 -2
  4. data/bundler/CHANGELOG.md +48 -0
  5. data/bundler/lib/bundler/build_metadata.rb +2 -2
  6. data/bundler/lib/bundler/compact_index_client/updater.rb +16 -3
  7. data/bundler/lib/bundler/current_ruby.rb +1 -1
  8. data/bundler/lib/bundler/definition.rb +32 -22
  9. data/bundler/lib/bundler/dependency.rb +5 -2
  10. data/bundler/lib/bundler/dsl.rb +2 -4
  11. data/bundler/lib/bundler/errors.rb +2 -0
  12. data/bundler/lib/bundler/fetcher/base.rb +6 -8
  13. data/bundler/lib/bundler/fetcher.rb +4 -0
  14. data/bundler/lib/bundler/friendly_errors.rb +5 -2
  15. data/bundler/lib/bundler/gem_helpers.rb +2 -0
  16. data/bundler/lib/bundler/index.rb +1 -5
  17. data/bundler/lib/bundler/installer/standalone.rb +29 -2
  18. data/bundler/lib/bundler/lazy_specification.rb +3 -3
  19. data/bundler/lib/bundler/lockfile_parser.rb +4 -0
  20. data/bundler/lib/bundler/man/bundle-add.1 +2 -2
  21. data/bundler/lib/bundler/man/bundle-add.1.ronn +1 -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-doctor.1 +1 -1
  28. data/bundler/lib/bundler/man/bundle-exec.1 +1 -1
  29. data/bundler/lib/bundler/man/bundle-gem.1 +1 -1
  30. data/bundler/lib/bundler/man/bundle-info.1 +1 -1
  31. data/bundler/lib/bundler/man/bundle-init.1 +1 -1
  32. data/bundler/lib/bundler/man/bundle-inject.1 +1 -1
  33. data/bundler/lib/bundler/man/bundle-install.1 +1 -1
  34. data/bundler/lib/bundler/man/bundle-list.1 +1 -1
  35. data/bundler/lib/bundler/man/bundle-lock.1 +1 -1
  36. data/bundler/lib/bundler/man/bundle-open.1 +1 -1
  37. data/bundler/lib/bundler/man/bundle-outdated.1 +1 -1
  38. data/bundler/lib/bundler/man/bundle-platform.1 +1 -1
  39. data/bundler/lib/bundler/man/bundle-pristine.1 +1 -1
  40. data/bundler/lib/bundler/man/bundle-remove.1 +1 -1
  41. data/bundler/lib/bundler/man/bundle-show.1 +1 -1
  42. data/bundler/lib/bundler/man/bundle-update.1 +1 -1
  43. data/bundler/lib/bundler/man/bundle-viz.1 +1 -1
  44. data/bundler/lib/bundler/man/bundle.1 +1 -1
  45. data/bundler/lib/bundler/man/gemfile.5 +62 -38
  46. data/bundler/lib/bundler/man/gemfile.5.ronn +52 -38
  47. data/bundler/lib/bundler/match_platform.rb +0 -1
  48. data/bundler/lib/bundler/plugin/api/source.rb +3 -3
  49. data/bundler/lib/bundler/resolver/spec_group.rb +5 -4
  50. data/bundler/lib/bundler/resolver.rb +16 -15
  51. data/bundler/lib/bundler/rubygems_ext.rb +6 -5
  52. data/bundler/lib/bundler/rubygems_gem_installer.rb +8 -0
  53. data/bundler/lib/bundler/rubygems_integration.rb +3 -21
  54. data/bundler/lib/bundler/runtime.rb +0 -1
  55. data/bundler/lib/bundler/source/git.rb +5 -7
  56. data/bundler/lib/bundler/source/rubygems.rb +87 -78
  57. data/bundler/lib/bundler/spec_set.rb +12 -9
  58. data/bundler/lib/bundler/version.rb +1 -1
  59. data/lib/rubygems/commands/environment_command.rb +5 -2
  60. data/lib/rubygems/commands/install_command.rb +1 -1
  61. data/lib/rubygems/commands/setup_command.rb +5 -4
  62. data/lib/rubygems/commands/sources_command.rb +1 -1
  63. data/lib/rubygems/commands/update_command.rb +5 -1
  64. data/lib/rubygems/core_ext/kernel_require.rb +1 -1
  65. data/lib/rubygems/errors.rb +1 -1
  66. data/lib/rubygems/ext/builder.rb +12 -5
  67. data/lib/rubygems/ext/cargo_builder/link_flag_converter.rb +23 -0
  68. data/lib/rubygems/ext/cargo_builder.rb +98 -82
  69. data/lib/rubygems/ext/ext_conf_builder.rb +31 -56
  70. data/lib/rubygems/gem_runner.rb +3 -7
  71. data/lib/rubygems/gemcutter_utilities.rb +1 -1
  72. data/lib/rubygems/indexer.rb +2 -0
  73. data/lib/rubygems/installer.rb +1 -1
  74. data/lib/rubygems/platform.rb +4 -0
  75. data/lib/rubygems/request.rb +1 -1
  76. data/lib/rubygems/source/git.rb +2 -2
  77. data/lib/rubygems/source.rb +2 -9
  78. data/lib/rubygems/source_list.rb +1 -5
  79. data/lib/rubygems/specification.rb +52 -4
  80. data/lib/rubygems/specification_policy.rb +1 -1
  81. data/lib/rubygems/uri.rb +41 -26
  82. data/lib/rubygems/util.rb +1 -1
  83. data/lib/rubygems.rb +3 -3
  84. data/rubygems-update.gemspec +1 -1
  85. data/test/rubygems/data/excon-0.7.7.gemspec.rz +0 -0
  86. data/test/rubygems/data/{null-type.gemspec.rz → pry-0.4.7.gemspec.rz} +0 -0
  87. data/test/rubygems/helper.rb +8 -2
  88. data/test/rubygems/test_gem.rb +1 -1
  89. data/test/rubygems/test_gem_commands_environment_command.rb +24 -0
  90. data/test/rubygems/test_gem_commands_pristine_command.rb +1 -0
  91. data/test/rubygems/test_gem_commands_sources_command.rb +50 -0
  92. data/test/rubygems/test_gem_commands_update_command.rb +21 -0
  93. data/test/rubygems/test_gem_config_file.rb +3 -3
  94. data/test/rubygems/test_gem_ext_cargo_builder/custom_name/Cargo.lock +47 -178
  95. data/test/rubygems/test_gem_ext_cargo_builder/custom_name/Cargo.toml +2 -2
  96. data/test/rubygems/test_gem_ext_cargo_builder/custom_name/build.rb +2 -2
  97. data/test/rubygems/test_gem_ext_cargo_builder/custom_name/src/lib.rs +0 -3
  98. data/test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/Cargo.lock +47 -178
  99. data/test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/Cargo.toml +2 -2
  100. data/test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/build.rb +2 -2
  101. data/test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/src/lib.rs +0 -3
  102. data/test/rubygems/test_gem_ext_cargo_builder.rb +50 -19
  103. data/test/rubygems/test_gem_ext_cargo_builder_link_flag_converter.rb +33 -0
  104. data/test/rubygems/test_gem_ext_cargo_builder_unit.rb +75 -0
  105. data/test/rubygems/test_gem_gemcutter_utilities.rb +1 -1
  106. data/test/rubygems/test_gem_indexer.rb +4 -0
  107. data/test/rubygems/test_gem_package.rb +2 -4
  108. data/test/rubygems/test_gem_platform.rb +16 -0
  109. data/test/rubygems/test_gem_remote_fetcher.rb +15 -15
  110. data/test/rubygems/test_gem_resolver.rb +1 -1
  111. data/test/rubygems/test_gem_specification.rb +16 -6
  112. data/test/rubygems/test_require.rb +10 -10
  113. data/test/rubygems/test_rubygems.rb +12 -9
  114. metadata +8 -5
  115. data/lib/rubygems/psych_additions.rb +0 -10
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9c8251cdf4ded47257679e20301da2396899478015bbf63592a1e0953949761d
4
- data.tar.gz: 6db38aaea1698dac8472f55f7a778c511f0d3807441e0de7af1d1d4ac607188f
3
+ metadata.gz: 2e4ec6bc7526731f88132fc2b50228513c227ccb3ba0e4d92ad009de6131ee99
4
+ data.tar.gz: 848ab25d5d8e63a8a13a15cbf2814fd90e13e026c7e3d3594315944fd6bb966a
5
5
  SHA512:
6
- metadata.gz: 933a409f4ecba3a01f5141058d3a2796af6920c098a704471ee5400f98df4f9054520e5cd2d0eab88fe8afc010cff4e9d985d05caf84304d17f2e61403b6eb1e
7
- data.tar.gz: 35d232187dde951c88c90e856e304b417b4984c40b6e5409a96bc9456a4bffd9650cdc37aac82c4ae40f83eca108a04bde4ba533e8db0bc29276a054bad659f2
6
+ metadata.gz: 8b6dbc2d36b694c6de2b1adea1be5319b20a81db44d633933d3254852000c4909f1354ccebd6c334fcef95f6c9ab20723e144f28784ccaeb823e026433d879f4
7
+ data.tar.gz: f20de7a450239710b77454b12f1ff78ef2c88951862b3edb2458bde54b5aa4353c697de9ea0b291c37430fff6de6e388254e6c10fdaf67686a4784d67c61f35c
data/CHANGELOG.md CHANGED
@@ -1,3 +1,52 @@
1
+ # 3.3.18 / 2022-07-14
2
+
3
+ ## Enhancements:
4
+
5
+ * Make platform `universal-mingw32` match "x64-mingw-ucrt". Pull request
6
+ #5655 by johnnyshields
7
+ * Add more descriptive messages when `gem update` fails to update some
8
+ gems. Pull request #5676 by brianleshopify
9
+ * Installs bundler 2.3.18 as a default gem.
10
+
11
+ ## Bug fixes:
12
+
13
+ * Make sure RubyGems prints no warnings when loading plugins. Pull request
14
+ #5607 by deivid-rodriguez
15
+
16
+ # 3.3.17 / 2022-06-29
17
+
18
+ ## Enhancements:
19
+
20
+ * Document `gem env` argument aliases and add `gem env user_gemhome` and
21
+ `gem env user_gemdir`. Pull request #5644 by deivid-rodriguez
22
+ * Improve error message when `operating_system.rb` fails to load. Pull
23
+ request #5658 by deivid-rodriguez
24
+ * Clean up temporary directory after `generate_index --update`. Pull
25
+ request #5653 by graywolf-at-work
26
+ * Simplify extension builder. Pull request #5626 by deivid-rodriguez
27
+ * Installs bundler 2.3.17 as a default gem.
28
+
29
+ ## Documentation:
30
+
31
+ * Modify RubyGems issue template to be like the one for Bundler. Pull
32
+ request #5643 by deivid-rodriguez
33
+
34
+ # 3.3.16 / 2022-06-15
35
+
36
+ ## Enhancements:
37
+
38
+ * Auto-fix and warn gem packages including a gemspec with `require_paths`
39
+ as an array of arrays. Pull request #5615 by deivid-rodriguez
40
+ * Misc cargo builder improvements. Pull request #5459 by ianks
41
+ * Installs bundler 2.3.16 as a default gem.
42
+
43
+ ## Bug fixes:
44
+
45
+ * Fix incorrect password redaction when there's an error in `gem source
46
+ -a`. Pull request #5623 by deivid-rodriguez
47
+ * Fix another regression when loading old marshaled specs. Pull request
48
+ #5610 by deivid-rodriguez
49
+
1
50
  # 3.3.15 / 2022-06-01
2
51
 
3
52
  ## Enhancements:
data/Manifest.txt CHANGED
@@ -383,6 +383,7 @@ lib/rubygems/ext.rb
383
383
  lib/rubygems/ext/build_error.rb
384
384
  lib/rubygems/ext/builder.rb
385
385
  lib/rubygems/ext/cargo_builder.rb
386
+ lib/rubygems/ext/cargo_builder/link_flag_converter.rb
386
387
  lib/rubygems/ext/cmake_builder.rb
387
388
  lib/rubygems/ext/configure_builder.rb
388
389
  lib/rubygems/ext/ext_conf_builder.rb
@@ -424,7 +425,6 @@ lib/rubygems/package/tar_writer.rb
424
425
  lib/rubygems/package_task.rb
425
426
  lib/rubygems/path_support.rb
426
427
  lib/rubygems/platform.rb
427
- lib/rubygems/psych_additions.rb
428
428
  lib/rubygems/psych_tree.rb
429
429
  lib/rubygems/query_utils.rb
430
430
  lib/rubygems/rdoc.rb
@@ -538,11 +538,12 @@ test/rubygems/child_cert.pem
538
538
  test/rubygems/child_cert_32.pem
539
539
  test/rubygems/child_key.pem
540
540
  test/rubygems/client.pem
541
+ test/rubygems/data/excon-0.7.7.gemspec.rz
541
542
  test/rubygems/data/gem-private_key.pem
542
543
  test/rubygems/data/gem-public_cert.pem
543
544
  test/rubygems/data/null-required-ruby-version.gemspec.rz
544
545
  test/rubygems/data/null-required-rubygems-version.gemspec.rz
545
- test/rubygems/data/null-type.gemspec.rz
546
+ test/rubygems/data/pry-0.4.7.gemspec.rz
546
547
  test/rubygems/encrypted_private_key.pem
547
548
  test/rubygems/expired_cert.pem
548
549
  test/rubygems/fake_certlib/openssl.rb
@@ -649,6 +650,8 @@ test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/Cargo.toml
649
650
  test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/build.rb
650
651
  test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/rust_ruby_example.gemspec
651
652
  test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/src/lib.rs
653
+ test/rubygems/test_gem_ext_cargo_builder_link_flag_converter.rb
654
+ test/rubygems/test_gem_ext_cargo_builder_unit.rb
652
655
  test/rubygems/test_gem_ext_cmake_builder.rb
653
656
  test/rubygems/test_gem_ext_configure_builder.rb
654
657
  test/rubygems/test_gem_ext_ext_conf_builder.rb
data/bundler/CHANGELOG.md CHANGED
@@ -1,3 +1,51 @@
1
+ # 2.3.18 (July 14, 2022)
2
+
3
+ ## Enhancements:
4
+
5
+ - Extend `gem` DSL with a `force_ruby_platform` option [#4049](https://github.com/rubygems/rubygems/pull/4049)
6
+
7
+ ## Bug fixes:
8
+
9
+ - Fix misleading error if compact index cannot be copied [#5709](https://github.com/rubygems/rubygems/pull/5709)
10
+ - Fix TruffleRuby no longer able to install lockfiles generated with other implementations [#5711](https://github.com/rubygems/rubygems/pull/5711)
11
+ - Fix TruffleRuby no longer installing lockfiles using "ruby" platform correctly [#5694](https://github.com/rubygems/rubygems/pull/5694)
12
+ - Fix crash when updating vendor cache of default gems [#5679](https://github.com/rubygems/rubygems/pull/5679)
13
+
14
+ ## Performance:
15
+
16
+ - Speed up `bundler/setup` by using the raw `Gemfile.lock` information without extra processing whenever possible [#5695](https://github.com/rubygems/rubygems/pull/5695)
17
+
18
+ ## Documentation:
19
+
20
+ - Use modern style hashes in Gemfile DSL docs [#5674](https://github.com/rubygems/rubygems/pull/5674)
21
+
22
+ # 2.3.17 (June 29, 2022)
23
+
24
+ ## Enhancements:
25
+
26
+ - Add support for platform `:x64_mingw` to correctly lookup "x64-mingw-ucrt" [#5649](https://github.com/rubygems/rubygems/pull/5649)
27
+ - Fix some errors being printed twice in `--verbose` mode [#5654](https://github.com/rubygems/rubygems/pull/5654)
28
+ - Fix extension paths in generated standalone script [#5632](https://github.com/rubygems/rubygems/pull/5632)
29
+
30
+ ## Bug fixes:
31
+
32
+ - Raise if ruby platform is forced and there are no ruby variants [#5495](https://github.com/rubygems/rubygems/pull/5495)
33
+ - Fix `bundle package --no-install` no longer skipping install [#5639](https://github.com/rubygems/rubygems/pull/5639)
34
+
35
+ ## Performance:
36
+
37
+ - Improve performance of `Bundler::SpecSet#for` by using hash lookup of handled deps [#5537](https://github.com/rubygems/rubygems/pull/5537)
38
+
39
+ ## Documentation:
40
+
41
+ - Fix formatting issue in `bundle add` man page [#5642](https://github.com/rubygems/rubygems/pull/5642)
42
+
43
+ # 2.3.16 (June 15, 2022)
44
+
45
+ ## Performance:
46
+
47
+ - Improve performance of installing gems from gem server sources [#5614](https://github.com/rubygems/rubygems/pull/5614)
48
+
1
49
  # 2.3.15 (June 1, 2022)
2
50
 
3
51
  ## 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 = "2022-06-01".freeze
8
- @git_commit_sha = "e7e41afd92".freeze
7
+ @built_at = "2022-07-14".freeze
8
+ @git_commit_sha = "fc31b7f7d9".freeze
9
9
  @release = true
10
10
  # end ivars
11
11
 
@@ -31,9 +31,8 @@ module Bundler
31
31
 
32
32
  # first try to fetch any new bytes on the existing file
33
33
  if retrying.nil? && local_path.file?
34
- SharedHelpers.filesystem_access(local_temp_path) do
35
- FileUtils.cp local_path, local_temp_path
36
- end
34
+ copy_file local_path, local_temp_path
35
+
37
36
  headers["If-None-Match"] = etag_for(local_temp_path)
38
37
  headers["Range"] =
39
38
  if local_temp_path.size.nonzero?
@@ -98,6 +97,20 @@ module Bundler
98
97
  SharedHelpers.digest(:MD5).hexdigest(File.read(path))
99
98
  end
100
99
  end
100
+
101
+ private
102
+
103
+ def copy_file(source, dest)
104
+ SharedHelpers.filesystem_access(source, :read) do
105
+ File.open(source, "r") do |s|
106
+ SharedHelpers.filesystem_access(dest, :write) do
107
+ File.open(dest, "wb", s.stat.mode) do |f|
108
+ IO.copy_stream(s, f)
109
+ end
110
+ end
111
+ end
112
+ end
113
+ end
101
114
  end
102
115
  end
103
116
  end
@@ -78,7 +78,7 @@ module Bundler
78
78
  end
79
79
 
80
80
  def x64_mingw?
81
- Gem.win_platform? && Bundler.local_platform != Gem::Platform::RUBY && Bundler.local_platform.os == "mingw32" && Bundler.local_platform.cpu == "x64"
81
+ Gem.win_platform? && Bundler.local_platform != Gem::Platform::RUBY && Bundler.local_platform.os.start_with?("mingw") && Bundler.local_platform.cpu == "x64"
82
82
  end
83
83
 
84
84
  (KNOWN_MINOR_VERSIONS + KNOWN_MAJOR_VERSIONS).each do |version|
@@ -235,6 +235,14 @@ module Bundler
235
235
  @locked_deps.values
236
236
  end
237
237
 
238
+ def new_deps
239
+ @new_deps ||= @dependencies - locked_dependencies
240
+ end
241
+
242
+ def deleted_deps
243
+ @deleted_deps ||= locked_dependencies - @dependencies
244
+ end
245
+
238
246
  def specs_for(groups)
239
247
  return specs if groups.empty?
240
248
  deps = dependencies_for(groups)
@@ -255,20 +263,27 @@ module Bundler
255
263
  #
256
264
  # @return [SpecSet] resolved dependencies
257
265
  def resolve
258
- @resolve ||= begin
259
- if Bundler.frozen_bundle?
260
- Bundler.ui.debug "Frozen, using resolution from the lockfile"
261
- @locked_specs
262
- elsif !unlocking? && nothing_changed?
263
- Bundler.ui.debug("Found no changes, using resolution from the lockfile")
264
- SpecSet.new(filter_specs(@locked_specs, @dependencies.select {|dep| @locked_specs[dep].any? }))
266
+ @resolve ||= if Bundler.frozen_bundle?
267
+ Bundler.ui.debug "Frozen, using resolution from the lockfile"
268
+ @locked_specs
269
+ elsif !unlocking? && nothing_changed?
270
+ if deleted_deps.any?
271
+ Bundler.ui.debug("Some dependencies were deleted, using a subset of the resolution from the lockfile")
272
+ SpecSet.new(filter_specs(@locked_specs, @dependencies - deleted_deps))
265
273
  else
266
- last_resolve = converge_locked_specs
267
- # Run a resolve against the locally available gems
268
- Bundler.ui.debug("Found changes from the lockfile, re-resolving dependencies because #{change_reason}")
269
- expanded_dependencies = expand_dependencies(dependencies + metadata_dependencies, true)
270
- Resolver.resolve(expanded_dependencies, source_requirements, last_resolve, gem_version_promoter, additional_base_requirements_for_resolve, platforms)
274
+ Bundler.ui.debug("Found no changes, using resolution from the lockfile")
275
+ if @locked_gems.may_include_redundant_platform_specific_gems?
276
+ SpecSet.new(filter_specs(@locked_specs, @dependencies))
277
+ else
278
+ @locked_specs
279
+ end
271
280
  end
281
+ else
282
+ last_resolve = converge_locked_specs
283
+ # Run a resolve against the locally available gems
284
+ Bundler.ui.debug("Found changes from the lockfile, re-resolving dependencies because #{change_reason}")
285
+ expanded_dependencies = expand_dependencies(dependencies + metadata_dependencies, true)
286
+ Resolver.resolve(expanded_dependencies, source_requirements, last_resolve, gem_version_promoter, additional_base_requirements_for_resolve, platforms)
272
287
  end
273
288
  end
274
289
 
@@ -361,9 +376,6 @@ module Bundler
361
376
  added.concat new_platforms.map {|p| "* platform: #{p}" }
362
377
  deleted.concat deleted_platforms.map {|p| "* platform: #{p}" }
363
378
 
364
- new_deps = @dependencies - locked_dependencies
365
- deleted_deps = locked_dependencies - @dependencies
366
-
367
379
  added.concat new_deps.map {|d| "* #{pretty_dep(d)}" } if new_deps.any?
368
380
  deleted.concat deleted_deps.map {|d| "* #{pretty_dep(d)}" } if deleted_deps.any?
369
381
 
@@ -735,12 +747,10 @@ module Bundler
735
747
  end
736
748
 
737
749
  def metadata_dependencies
738
- @metadata_dependencies ||= begin
739
- [
740
- Dependency.new("Ruby\0", RubyVersion.system.gem_version),
741
- Dependency.new("RubyGems\0", Gem::VERSION),
742
- ]
743
- end
750
+ @metadata_dependencies ||= [
751
+ Dependency.new("Ruby\0", RubyVersion.system.gem_version),
752
+ Dependency.new("RubyGems\0", Gem::VERSION),
753
+ ]
744
754
  end
745
755
 
746
756
  def expand_dependencies(dependencies, remote = false)
@@ -810,7 +820,7 @@ module Bundler
810
820
  return [] unless @locked_gems && unlocking? && !sources.expired_sources?(@locked_gems.sources)
811
821
  converge_specs(@originally_locked_specs).map do |locked_spec|
812
822
  name = locked_spec.name
813
- dep = Gem::Dependency.new(name, ">= #{locked_spec.version}")
823
+ dep = Dependency.new(name, ">= #{locked_spec.version}")
814
824
  DepProxy.get_proxy(dep, locked_spec.platform)
815
825
  end
816
826
  end
@@ -7,8 +7,9 @@ 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
10
+ attr_reader :groups, :platforms, :gemfile, :git, :github, :branch, :ref, :force_ruby_platform
11
11
 
12
+ # rubocop:disable Naming/VariableNumber
12
13
  PLATFORM_MAP = {
13
14
  :ruby => Gem::Platform::RUBY,
14
15
  :ruby_18 => Gem::Platform::RUBY,
@@ -91,6 +92,7 @@ module Bundler
91
92
  :x64_mingw_30 => Gem::Platform::X64_MINGW,
92
93
  :x64_mingw_31 => Gem::Platform::X64_MINGW,
93
94
  }.freeze
95
+ # rubocop:enable Naming/VariableNumber
94
96
 
95
97
  def initialize(name, version, options = {}, &blk)
96
98
  type = options["type"] || :runtime
@@ -107,6 +109,7 @@ module Bundler
107
109
  @env = options["env"]
108
110
  @should_include = options.fetch("should_include", true)
109
111
  @gemfile = options["gemfile"]
112
+ @force_ruby_platform = options["force_ruby_platform"]
110
113
 
111
114
  @autorequire = Array(options["require"] || []) if options.key?("require")
112
115
  end
@@ -120,7 +123,7 @@ module Bundler
120
123
  end
121
124
 
122
125
  def expanded_platforms
123
- @expanded_platforms ||= @platforms.map {|pl| PLATFORM_MAP[pl] }.compact.uniq
126
+ @expanded_platforms ||= @platforms.map {|pl| PLATFORM_MAP[pl] }.compact.flatten.uniq
124
127
  end
125
128
 
126
129
  def should_include?
@@ -16,7 +16,7 @@ module Bundler
16
16
  VALID_PLATFORMS = Bundler::Dependency::PLATFORM_MAP.keys.freeze
17
17
 
18
18
  VALID_KEYS = %w[group groups git path glob name branch ref tag require submodules
19
- platform platforms type source install_if gemfile].freeze
19
+ platform platforms type source install_if gemfile force_ruby_platform].freeze
20
20
 
21
21
  GITHUB_PULL_REQUEST_URL = %r{\Ahttps://github\.com/([A-Za-z0-9_\-\.]+/[A-Za-z0-9_\-\.]+)/pull/(\d+)\z}.freeze
22
22
 
@@ -511,9 +511,7 @@ module Bundler
511
511
  # be raised.
512
512
  #
513
513
  def contents
514
- @contents ||= begin
515
- dsl_path && File.exist?(dsl_path) && File.read(dsl_path)
516
- end
514
+ @contents ||= dsl_path && File.exist?(dsl_path) && File.read(dsl_path)
517
515
  end
518
516
 
519
517
  # The message of the exception reports the content of podspec for the
@@ -41,12 +41,14 @@ module Bundler
41
41
  class GemspecError < BundlerError; status_code(14); end
42
42
  class InvalidOption < BundlerError; status_code(15); end
43
43
  class ProductionError < BundlerError; status_code(16); end
44
+
44
45
  class HTTPError < BundlerError
45
46
  status_code(17)
46
47
  def filter_uri(uri)
47
48
  URICredentialsFilter.credential_filtered_uri(uri)
48
49
  end
49
50
  end
51
+
50
52
  class RubyVersionMismatch < BundlerError; status_code(18); end
51
53
  class SecurityError < BundlerError; status_code(19); end
52
54
  class LockfileError < BundlerError; status_code(20); end
@@ -19,14 +19,12 @@ module Bundler
19
19
  end
20
20
 
21
21
  def fetch_uri
22
- @fetch_uri ||= begin
23
- if remote_uri.host == "rubygems.org"
24
- uri = remote_uri.dup
25
- uri.host = "index.rubygems.org"
26
- uri
27
- else
28
- remote_uri
29
- end
22
+ @fetch_uri ||= if remote_uri.host == "rubygems.org"
23
+ uri = remote_uri.dup
24
+ uri.host = "index.rubygems.org"
25
+ uri
26
+ else
27
+ remote_uri
30
28
  end
31
29
  end
32
30
 
@@ -20,6 +20,7 @@ module Bundler
20
20
  class TooManyRequestsError < HTTPError; end
21
21
  # This error is raised if the API returns a 413 (only printed in verbose)
22
22
  class FallbackError < HTTPError; end
23
+
23
24
  # This is the error raised if OpenSSL fails the cert verification
24
25
  class CertificateFailureError < HTTPError
25
26
  def initialize(remote_uri)
@@ -33,6 +34,7 @@ module Bundler
33
34
  " sources and change 'https' to 'http'."
34
35
  end
35
36
  end
37
+
36
38
  # This is the error raised when a source is HTTPS and OpenSSL didn't load
37
39
  class SSLError < HTTPError
38
40
  def initialize(msg = nil)
@@ -42,6 +44,7 @@ module Bundler
42
44
  "using RVM are available at rvm.io/packages/openssl."
43
45
  end
44
46
  end
47
+
45
48
  # This error is raised if HTTP authentication is required, but not provided.
46
49
  class AuthenticationRequiredError < HTTPError
47
50
  def initialize(remote_uri)
@@ -52,6 +55,7 @@ module Bundler
52
55
  "or by storing the credentials in the `#{Settings.key_for(remote_uri)}` environment variable"
53
56
  end
54
57
  end
58
+
55
59
  # This error is raised if HTTP authentication is provided, but incorrect.
56
60
  class BadAuthenticationError < HTTPError
57
61
  def initialize(remote_uri)
@@ -29,8 +29,11 @@ module Bundler
29
29
  Bundler.ui.error error.message
30
30
  Bundler.ui.trace error.orig_exception
31
31
  when BundlerError
32
- Bundler.ui.error error.message, :wrap => true
33
- Bundler.ui.trace error
32
+ if Bundler.ui.debug?
33
+ Bundler.ui.trace error
34
+ else
35
+ Bundler.ui.error error.message, :wrap => true
36
+ end
34
37
  when Thor::Error
35
38
  Bundler.ui.error error.message
36
39
  when LoadError
@@ -5,11 +5,13 @@ module Bundler
5
5
  GENERIC_CACHE = { Gem::Platform::RUBY => Gem::Platform::RUBY } # rubocop:disable Style/MutableConstant
6
6
  GENERICS = [
7
7
  [Gem::Platform.new("java"), Gem::Platform.new("java")],
8
+ [Gem::Platform.new("universal-java"), Gem::Platform.new("java")],
8
9
  [Gem::Platform.new("mswin32"), Gem::Platform.new("mswin32")],
9
10
  [Gem::Platform.new("mswin64"), Gem::Platform.new("mswin64")],
10
11
  [Gem::Platform.new("universal-mingw32"), Gem::Platform.new("universal-mingw32")],
11
12
  [Gem::Platform.new("x64-mingw32"), Gem::Platform.new("x64-mingw32")],
12
13
  [Gem::Platform.new("x86_64-mingw32"), Gem::Platform.new("x64-mingw32")],
14
+ [Gem::Platform.new("x64-mingw-ucrt"), Gem::Platform.new("x64-mingw-ucrt")],
13
15
  [Gem::Platform.new("mingw32"), Gem::Platform.new("x86-mingw32")],
14
16
  ].freeze
15
17
 
@@ -192,11 +192,7 @@ module Bundler
192
192
  specs += base if base
193
193
  found = specs.select do |spec|
194
194
  next true if spec.source.is_a?(Source::Gemspec)
195
- if base # allow all platforms when searching from a lockfile
196
- dependency.matches_spec?(spec)
197
- else
198
- dependency.matches_spec?(spec) && Gem::Platform.match_spec?(spec)
199
- end
195
+ dependency.matches_spec?(spec)
200
196
  end
201
197
 
202
198
  found
@@ -12,6 +12,7 @@ module Bundler
12
12
  end
13
13
  File.open File.join(bundler_path, "setup.rb"), "w" do |file|
14
14
  file.puts "require 'rbconfig'"
15
+ file.puts define_path_helpers
15
16
  file.puts reverse_rubygems_kernel_mixin
16
17
  paths.each do |path|
17
18
  if Pathname.new(path).absolute?
@@ -29,14 +30,20 @@ module Bundler
29
30
  @specs.map do |spec|
30
31
  next if spec.name == "bundler"
31
32
  Array(spec.require_paths).map do |path|
32
- gem_path(path, spec).sub(version_dir, '#{RUBY_ENGINE}/#{RbConfig::CONFIG["ruby_version"]}')
33
+ gem_path(path, spec).
34
+ sub(version_dir, '#{RUBY_ENGINE}/#{Gem.ruby_api_version}').
35
+ sub(extensions_dir, 'extensions/\k<platform>/#{Gem.extension_api_version}')
33
36
  # This is a static string intentionally. It's interpolated at a later time.
34
37
  end
35
38
  end.flatten.compact
36
39
  end
37
40
 
38
41
  def version_dir
39
- "#{RUBY_ENGINE}/#{RbConfig::CONFIG["ruby_version"]}"
42
+ "#{RUBY_ENGINE}/#{Gem.ruby_api_version}"
43
+ end
44
+
45
+ def extensions_dir
46
+ %r{extensions/(?<platform>[^/]+)/#{Regexp.escape(Gem.extension_api_version)}}
40
47
  end
41
48
 
42
49
  def bundler_path
@@ -55,6 +62,26 @@ module Bundler
55
62
  raise Gem::InvalidSpecificationException.new(error_message)
56
63
  end
57
64
 
65
+ def define_path_helpers
66
+ <<~'END'
67
+ unless defined?(Gem)
68
+ module Gem
69
+ def self.ruby_api_version
70
+ RbConfig::CONFIG["ruby_version"]
71
+ end
72
+
73
+ def self.extension_api_version
74
+ if 'no' == RbConfig::CONFIG['ENABLE_SHARED']
75
+ "#{ruby_api_version}-static"
76
+ else
77
+ ruby_api_version
78
+ end
79
+ end
80
+ end
81
+ end
82
+ END
83
+ end
84
+
58
85
  def reverse_rubygems_kernel_mixin
59
86
  <<~END
60
87
  kernel = (class << ::Kernel; self; end)
@@ -7,7 +7,7 @@ module Bundler
7
7
  include MatchPlatform
8
8
 
9
9
  attr_reader :name, :version, :dependencies, :platform
10
- attr_accessor :source, :remote
10
+ attr_accessor :source, :remote, :force_ruby_platform
11
11
 
12
12
  def initialize(name, version, platform, source = nil)
13
13
  @name = name
@@ -84,7 +84,7 @@ module Bundler
84
84
  else
85
85
  ruby_platform_materializes_to_ruby_platform? ? self : Dependency.new(name, version)
86
86
  end
87
- platform_object = Gem::Platform.new(platform)
87
+ platform_object = ruby_platform_materializes_to_ruby_platform? ? Gem::Platform.new(platform) : Gem::Platform.local
88
88
  candidates = source.specs.search(search_object)
89
89
  same_platform_candidates = candidates.select do |spec|
90
90
  MatchPlatform.platforms_match?(spec.platform, platform_object)
@@ -152,7 +152,7 @@ module Bundler
152
152
  # explicitly add a more specific platform.
153
153
  #
154
154
  def ruby_platform_materializes_to_ruby_platform?
155
- !Bundler.most_specific_locked_platform?(Gem::Platform::RUBY) || Bundler.settings[:force_ruby_platform]
155
+ !Bundler.most_specific_locked_platform?(generic_local_platform) || force_ruby_platform || Bundler.settings[:force_ruby_platform]
156
156
  end
157
157
  end
158
158
  end
@@ -93,6 +93,10 @@ module Bundler
93
93
  "and then `bundle install` to generate a new lockfile."
94
94
  end
95
95
 
96
+ def may_include_redundant_platform_specific_gems?
97
+ bundler_version.nil? || bundler_version < Gem::Version.new("1.16.2")
98
+ end
99
+
96
100
  private
97
101
 
98
102
  TYPES = {
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-ADD" "1" "May 2022" "" ""
4
+ .TH "BUNDLE\-ADD" "1" "June 2022" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-add\fR \- Add gem to the Gemfile and run bundle install
@@ -41,7 +41,7 @@ Specify version requirements(s) for the added gem\.
41
41
  Specify the group(s) for the added gem\. Multiple groups should be separated by commas\.
42
42
  .
43
43
  .TP
44
- \fB\-\-source\fR, , \fB\-s\fR
44
+ \fB\-\-source\fR, \fB\-s\fR
45
45
  Specify the source for the added gem\.
46
46
  .
47
47
  .TP
@@ -27,7 +27,7 @@ bundle add rails --group "development, test"
27
27
  * `--group`, `-g`:
28
28
  Specify the group(s) for the added gem. Multiple groups should be separated by commas.
29
29
 
30
- * `--source`, , `-s`:
30
+ * `--source`, `-s`:
31
31
  Specify the source for the added gem.
32
32
 
33
33
  * `--require`, `-r`:
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-BINSTUBS" "1" "May 2022" "" ""
4
+ .TH "BUNDLE\-BINSTUBS" "1" "June 2022" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-binstubs\fR \- Install the binstubs of the listed gems
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-CACHE" "1" "May 2022" "" ""
4
+ .TH "BUNDLE\-CACHE" "1" "June 2022" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-cache\fR \- Package your needed \fB\.gem\fR files into your application
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-CHECK" "1" "May 2022" "" ""
4
+ .TH "BUNDLE\-CHECK" "1" "June 2022" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-check\fR \- Verifies if dependencies are satisfied by installed gems
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-CLEAN" "1" "May 2022" "" ""
4
+ .TH "BUNDLE\-CLEAN" "1" "June 2022" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-clean\fR \- Cleans up unused gems in your bundler directory
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-CONFIG" "1" "May 2022" "" ""
4
+ .TH "BUNDLE\-CONFIG" "1" "June 2022" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-config\fR \- Set bundler configuration options
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-DOCTOR" "1" "May 2022" "" ""
4
+ .TH "BUNDLE\-DOCTOR" "1" "June 2022" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-doctor\fR \- Checks the bundle for common problems