rubygems-update 3.5.23 → 3.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +57 -0
- data/Manifest.txt +23 -16
- data/README.md +14 -9
- data/bundler/CHANGELOG.md +59 -0
- data/bundler/bundler.gemspec +2 -2
- data/bundler/lib/bundler/build_metadata.rb +2 -2
- data/bundler/lib/bundler/cli/console.rb +0 -4
- data/bundler/lib/bundler/cli/doctor.rb +4 -4
- data/bundler/lib/bundler/cli/exec.rb +1 -0
- data/bundler/lib/bundler/cli/gem.rb +1 -1
- data/bundler/lib/bundler/cli/info.rb +2 -2
- data/bundler/lib/bundler/cli/inject.rb +1 -1
- data/bundler/lib/bundler/cli/install.rb +4 -0
- data/bundler/lib/bundler/cli/lock.rb +20 -1
- data/bundler/lib/bundler/cli/pristine.rb +1 -1
- data/bundler/lib/bundler/cli/show.rb +2 -2
- data/bundler/lib/bundler/cli.rb +22 -53
- data/bundler/lib/bundler/compact_index_client/cache_file.rb +0 -5
- data/bundler/lib/bundler/compact_index_client/updater.rb +0 -11
- data/bundler/lib/bundler/definition.rb +134 -61
- data/bundler/lib/bundler/dependency.rb +1 -1
- data/bundler/lib/bundler/dsl.rb +2 -13
- data/bundler/lib/bundler/endpoint_specification.rb +10 -1
- data/bundler/lib/bundler/errors.rb +10 -0
- data/bundler/lib/bundler/feature_flag.rb +1 -0
- data/bundler/lib/bundler/fetcher/compact_index.rb +1 -1
- data/bundler/lib/bundler/fetcher.rb +10 -3
- data/bundler/lib/bundler/gem_helpers.rb +21 -5
- data/bundler/lib/bundler/injector.rb +2 -2
- data/bundler/lib/bundler/installer/standalone.rb +2 -2
- data/bundler/lib/bundler/installer.rb +4 -38
- data/bundler/lib/bundler/lazy_specification.rb +65 -24
- data/bundler/lib/bundler/lockfile_parser.rb +9 -1
- data/bundler/lib/bundler/man/bundle-add.1 +13 -10
- data/bundler/lib/bundler/man/bundle-add.1.ronn +12 -9
- data/bundler/lib/bundler/man/bundle-binstubs.1 +7 -4
- data/bundler/lib/bundler/man/bundle-binstubs.1.ronn +6 -3
- data/bundler/lib/bundler/man/bundle-cache.1 +30 -2
- data/bundler/lib/bundler/man/bundle-cache.1.ronn +31 -2
- data/bundler/lib/bundler/man/bundle-check.1 +3 -3
- data/bundler/lib/bundler/man/bundle-check.1.ronn +4 -2
- data/bundler/lib/bundler/man/bundle-clean.1 +1 -1
- data/bundler/lib/bundler/man/bundle-config.1 +3 -1
- data/bundler/lib/bundler/man/bundle-config.1.ronn +2 -0
- data/bundler/lib/bundler/man/bundle-console.1 +2 -4
- data/bundler/lib/bundler/man/bundle-console.1.ronn +2 -7
- data/bundler/lib/bundler/man/bundle-doctor.1 +2 -2
- data/bundler/lib/bundler/man/bundle-doctor.1.ronn +1 -1
- data/bundler/lib/bundler/man/bundle-env.1 +9 -0
- data/bundler/lib/bundler/man/bundle-env.1.ronn +10 -0
- data/bundler/lib/bundler/man/bundle-exec.1 +5 -2
- data/bundler/lib/bundler/man/bundle-exec.1.ronn +4 -1
- data/bundler/lib/bundler/man/bundle-fund.1 +22 -0
- data/bundler/lib/bundler/man/bundle-fund.1.ronn +25 -0
- data/bundler/lib/bundler/man/bundle-gem.1 +17 -5
- data/bundler/lib/bundler/man/bundle-gem.1.ronn +27 -6
- data/bundler/lib/bundler/man/bundle-help.1 +1 -1
- data/bundler/lib/bundler/man/bundle-info.1 +5 -2
- data/bundler/lib/bundler/man/bundle-info.1.ronn +6 -2
- data/bundler/lib/bundler/man/bundle-init.1 +3 -3
- data/bundler/lib/bundler/man/bundle-init.1.ronn +3 -2
- data/bundler/lib/bundler/man/bundle-inject.1 +10 -2
- data/bundler/lib/bundler/man/bundle-inject.1.ronn +9 -1
- data/bundler/lib/bundler/man/bundle-install.1 +14 -11
- data/bundler/lib/bundler/man/bundle-install.1.ronn +21 -16
- data/bundler/lib/bundler/man/bundle-issue.1 +45 -0
- data/bundler/lib/bundler/man/bundle-issue.1.ronn +37 -0
- data/bundler/lib/bundler/man/bundle-licenses.1 +9 -0
- data/bundler/lib/bundler/man/bundle-licenses.1.ronn +10 -0
- data/bundler/lib/bundler/man/bundle-list.1 +1 -1
- data/bundler/lib/bundler/man/bundle-list.1.ronn +4 -1
- data/bundler/lib/bundler/man/bundle-lock.1 +21 -6
- data/bundler/lib/bundler/man/bundle-lock.1.ronn +25 -4
- data/bundler/lib/bundler/man/bundle-open.1 +2 -2
- data/bundler/lib/bundler/man/bundle-open.1.ronn +2 -1
- data/bundler/lib/bundler/man/bundle-outdated.1 +8 -5
- data/bundler/lib/bundler/man/bundle-outdated.1.ronn +8 -4
- data/bundler/lib/bundler/man/bundle-platform.1 +1 -1
- data/bundler/lib/bundler/man/bundle-plugin.1 +1 -1
- data/bundler/lib/bundler/man/bundle-pristine.1 +1 -1
- data/bundler/lib/bundler/man/bundle-pristine.1.ronn +1 -1
- data/bundler/lib/bundler/man/bundle-remove.1 +1 -1
- data/bundler/lib/bundler/man/bundle-remove.1.ronn +1 -1
- data/bundler/lib/bundler/man/bundle-show.1 +5 -2
- data/bundler/lib/bundler/man/bundle-show.1.ronn +4 -0
- data/bundler/lib/bundler/man/bundle-update.1 +13 -7
- data/bundler/lib/bundler/man/bundle-update.1.ronn +14 -6
- data/bundler/lib/bundler/man/bundle-version.1 +1 -1
- data/bundler/lib/bundler/man/bundle-viz.1 +4 -4
- data/bundler/lib/bundler/man/bundle-viz.1.ronn +7 -3
- data/bundler/lib/bundler/man/bundle.1 +1 -1
- data/bundler/lib/bundler/man/gemfile.5 +1 -1
- data/bundler/lib/bundler/man/index.txt +4 -0
- data/bundler/lib/bundler/materialization.rb +59 -0
- data/bundler/lib/bundler/plugin/events.rb +24 -0
- data/bundler/lib/bundler/plugin/installer.rb +1 -1
- data/bundler/lib/bundler/process_lock.rb +1 -1
- data/bundler/lib/bundler/remote_specification.rb +6 -1
- data/bundler/lib/bundler/resolver/base.rb +2 -6
- data/bundler/lib/bundler/resolver/candidate.rb +2 -2
- data/bundler/lib/bundler/resolver/spec_group.rb +4 -3
- data/bundler/lib/bundler/resolver.rb +5 -5
- data/bundler/lib/bundler/rubygems_ext.rb +17 -28
- data/bundler/lib/bundler/rubygems_gem_installer.rb +0 -1
- data/bundler/lib/bundler/rubygems_integration.rb +21 -11
- data/bundler/lib/bundler/runtime.rb +27 -7
- data/bundler/lib/bundler/self_manager.rb +2 -3
- data/bundler/lib/bundler/settings.rb +1 -0
- data/bundler/lib/bundler/shared_helpers.rb +2 -2
- data/bundler/lib/bundler/source/git/git_proxy.rb +0 -6
- data/bundler/lib/bundler/source/git.rb +56 -31
- data/bundler/lib/bundler/source/path.rb +2 -2
- data/bundler/lib/bundler/source_list.rb +1 -1
- data/bundler/lib/bundler/spec_set.rb +81 -56
- data/bundler/lib/bundler/stub_specification.rb +8 -0
- data/bundler/lib/bundler/templates/newgem/README.md.tt +1 -1
- data/bundler/lib/bundler/uri_credentials_filter.rb +1 -1
- data/bundler/lib/bundler/vendor/fileutils/COPYING +56 -0
- data/bundler/lib/bundler/vendor/fileutils/lib/fileutils.rb +15 -13
- data/bundler/lib/bundler/vendor/securerandom/COPYING +56 -0
- data/bundler/lib/bundler/vendor/securerandom/lib/securerandom.rb +5 -5
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +3 -5
- data/bundler/lib/bundler/vendor/thor/lib/thor/group.rb +11 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/parser/argument.rb +1 -4
- data/bundler/lib/bundler/vendor/thor/lib/thor/parser/option.rb +2 -2
- data/bundler/lib/bundler/vendor/thor/lib/thor/parser/options.rb +2 -1
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +9 -9
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell/html.rb +1 -1
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell/table_printer.rb +5 -21
- data/bundler/lib/bundler/vendor/thor/lib/thor/util.rb +1 -1
- data/bundler/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
- data/bundler/lib/bundler/vendor/thor/lib/thor.rb +11 -0
- data/bundler/lib/bundler/vendor/uri/COPYING +56 -0
- data/bundler/lib/bundler/vendor/uri/lib/uri/common.rb +37 -16
- data/bundler/lib/bundler/vendor/uri/lib/uri/file.rb +3 -3
- data/bundler/lib/bundler/vendor/uri/lib/uri/ftp.rb +1 -1
- data/bundler/lib/bundler/vendor/uri/lib/uri/generic.rb +16 -26
- data/bundler/lib/bundler/vendor/uri/lib/uri/http.rb +2 -2
- data/bundler/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +10 -3
- data/bundler/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +26 -3
- data/bundler/lib/bundler/vendor/uri/lib/uri/version.rb +1 -1
- data/bundler/lib/bundler/vendor/uri/lib/uri.rb +9 -9
- data/bundler/lib/bundler/vendored_securerandom.rb +0 -2
- data/bundler/lib/bundler/version.rb +1 -1
- data/bundler/lib/bundler.rb +37 -13
- data/{CONTRIBUTING.md → doc/rubygems/CONTRIBUTING.md} +9 -9
- data/{POLICIES.md → doc/rubygems/POLICIES.md} +11 -11
- data/lib/rubygems/basic_specification.rb +5 -4
- data/lib/rubygems/commands/cleanup_command.rb +2 -2
- data/lib/rubygems/commands/contents_command.rb +4 -4
- data/lib/rubygems/commands/exec_command.rb +3 -0
- data/lib/rubygems/commands/pristine_command.rb +2 -2
- data/lib/rubygems/commands/push_command.rb +29 -5
- data/lib/rubygems/commands/rdoc_command.rb +2 -2
- data/lib/rubygems/commands/rebuild_command.rb +0 -2
- data/lib/rubygems/commands/setup_command.rb +1 -16
- data/lib/rubygems/commands/unpack_command.rb +0 -6
- data/lib/rubygems/commands/update_command.rb +2 -8
- data/lib/rubygems/config_file.rb +12 -0
- data/lib/rubygems/core_ext/kernel_warn.rb +2 -6
- data/lib/rubygems/defaults.rb +1 -1
- data/lib/rubygems/exceptions.rb +0 -6
- data/lib/rubygems/ext/builder.rb +6 -4
- data/lib/rubygems/ext/cargo_builder.rb +7 -4
- data/lib/rubygems/ext/cmake_builder.rb +7 -2
- data/lib/rubygems/ext/configure_builder.rb +7 -2
- data/lib/rubygems/ext/ext_conf_builder.rb +9 -5
- data/lib/rubygems/ext/rake_builder.rb +6 -1
- data/lib/rubygems/install_update_options.rb +5 -0
- data/lib/rubygems/installer.rb +2 -2
- data/lib/rubygems/platform.rb +4 -3
- data/lib/rubygems/psych_tree.rb +4 -0
- data/lib/rubygems/request_set/gem_dependency_api.rb +1 -1
- data/lib/rubygems/requirement.rb +0 -4
- data/lib/rubygems/resolver/composed_set.rb +3 -3
- data/lib/rubygems/resolver/git_set.rb +0 -1
- data/lib/rubygems/resolver/index_set.rb +2 -2
- data/lib/rubygems/resolver.rb +3 -3
- data/lib/rubygems/source/git.rb +13 -10
- data/lib/rubygems/spec_fetcher.rb +16 -5
- data/lib/rubygems/specification.rb +37 -31
- data/lib/rubygems/target_rbconfig.rb +50 -0
- data/lib/rubygems/uri.rb +1 -1
- data/lib/rubygems/util/licenses.rb +10 -1
- data/lib/rubygems/vendor/net-http/COPYING +56 -0
- data/lib/rubygems/vendor/net-http/lib/net/http/header.rb +1 -1
- data/lib/rubygems/vendor/net-http/lib/net/http/requests.rb +5 -0
- data/lib/rubygems/vendor/net-http/lib/net/http.rb +120 -36
- data/lib/rubygems/vendor/optparse/lib/optparse/ac.rb +16 -0
- data/lib/rubygems/vendor/optparse/lib/optparse/kwargs.rb +8 -3
- data/lib/rubygems/vendor/optparse/lib/optparse/version.rb +9 -0
- data/lib/rubygems/vendor/optparse/lib/optparse.rb +147 -51
- data/lib/rubygems/vendor/resolv/COPYING +56 -0
- data/lib/rubygems/vendor/resolv/lib/resolv.rb +50 -37
- data/lib/rubygems/vendor/securerandom/COPYING +56 -0
- data/lib/rubygems/vendor/securerandom/lib/securerandom.rb +5 -5
- data/lib/rubygems/vendor/timeout/COPYING +56 -0
- data/lib/rubygems/vendor/timeout/lib/timeout.rb +5 -8
- data/lib/rubygems/vendor/uri/COPYING +56 -0
- data/lib/rubygems/vendor/uri/lib/uri/common.rb +37 -16
- data/lib/rubygems/vendor/uri/lib/uri/file.rb +3 -3
- data/lib/rubygems/vendor/uri/lib/uri/ftp.rb +1 -1
- data/lib/rubygems/vendor/uri/lib/uri/generic.rb +16 -26
- data/lib/rubygems/vendor/uri/lib/uri/http.rb +2 -2
- data/lib/rubygems/vendor/uri/lib/uri/rfc2396_parser.rb +10 -3
- data/lib/rubygems/vendor/uri/lib/uri/rfc3986_parser.rb +26 -3
- data/lib/rubygems/vendor/uri/lib/uri/version.rb +1 -1
- data/lib/rubygems/vendor/uri/lib/uri.rb +9 -9
- data/lib/rubygems/vendored_securerandom.rb +0 -1
- data/lib/rubygems/version.rb +0 -4
- data/lib/rubygems.rb +29 -20
- data/rubygems-update.gemspec +5 -5
- data/setup.rb +1 -1
- metadata +36 -27
- data/bundler/lib/bundler/vendor/fileutils/LICENSE.txt +0 -22
- data/bundler/lib/bundler/vendor/securerandom/LICENSE.txt +0 -22
- data/bundler/lib/bundler/vendor/securerandom/lib/random/formatter.rb +0 -373
- data/bundler/lib/bundler/vendor/uri/LICENSE.txt +0 -22
- data/lib/rubygems/vendor/net-http/LICENSE.txt +0 -22
- data/lib/rubygems/vendor/net-http/lib/net/http/backward.rb +0 -40
- data/lib/rubygems/vendor/resolv/LICENSE.txt +0 -22
- data/lib/rubygems/vendor/securerandom/LICENSE.txt +0 -22
- data/lib/rubygems/vendor/securerandom/lib/random/formatter.rb +0 -373
- data/lib/rubygems/vendor/timeout/LICENSE.txt +0 -22
- data/lib/rubygems/vendor/uri/LICENSE.txt +0 -22
- /data/{MAINTAINERS.txt → doc/MAINTAINERS.txt} +0 -0
- /data/{bundler → doc/bundler}/UPGRADING.md +0 -0
- /data/{UPGRADING.md → doc/rubygems/UPGRADING.md} +0 -0
data/lib/rubygems/config_file.rb
CHANGED
@@ -47,6 +47,8 @@ class Gem::ConfigFile
|
|
47
47
|
DEFAULT_CONCURRENT_DOWNLOADS = 8
|
48
48
|
DEFAULT_CERT_EXPIRATION_LENGTH_DAYS = 365
|
49
49
|
DEFAULT_IPV4_FALLBACK_ENABLED = false
|
50
|
+
# TODO: Use false as default value for this option in RubyGems 4.0
|
51
|
+
DEFAULT_INSTALL_EXTENSION_IN_LIB = true
|
50
52
|
|
51
53
|
##
|
52
54
|
# For Ruby packagers to set configuration defaults. Set in
|
@@ -142,6 +144,11 @@ class Gem::ConfigFile
|
|
142
144
|
|
143
145
|
attr_accessor :cert_expiration_length_days
|
144
146
|
|
147
|
+
##
|
148
|
+
# Install extensions into lib as well as into the extension directory.
|
149
|
+
|
150
|
+
attr_accessor :install_extension_in_lib
|
151
|
+
|
145
152
|
##
|
146
153
|
# == Experimental ==
|
147
154
|
# Fallback to IPv4 when IPv6 is not reachable or slow (default: false)
|
@@ -183,6 +190,7 @@ class Gem::ConfigFile
|
|
183
190
|
@update_sources = DEFAULT_UPDATE_SOURCES
|
184
191
|
@concurrent_downloads = DEFAULT_CONCURRENT_DOWNLOADS
|
185
192
|
@cert_expiration_length_days = DEFAULT_CERT_EXPIRATION_LENGTH_DAYS
|
193
|
+
@install_extension_in_lib = DEFAULT_INSTALL_EXTENSION_IN_LIB
|
186
194
|
@ipv4_fallback_enabled = ENV["IPV4_FALLBACK_ENABLED"] == "true" || DEFAULT_IPV4_FALLBACK_ENABLED
|
187
195
|
|
188
196
|
operating_system_config = Marshal.load Marshal.dump(OPERATING_SYSTEM_DEFAULTS)
|
@@ -220,6 +228,7 @@ class Gem::ConfigFile
|
|
220
228
|
@update_sources = @hash[:update_sources] if @hash.key? :update_sources
|
221
229
|
# TODO: We should handle concurrent_downloads same as other options
|
222
230
|
@cert_expiration_length_days = @hash[:cert_expiration_length_days] if @hash.key? :cert_expiration_length_days
|
231
|
+
@install_extension_in_lib = @hash[:install_extension_in_lib] if @hash.key? :install_extension_in_lib
|
223
232
|
@ipv4_fallback_enabled = @hash[:ipv4_fallback_enabled] if @hash.key? :ipv4_fallback_enabled
|
224
233
|
|
225
234
|
@home = @hash[:gemhome] if @hash.key? :gemhome
|
@@ -476,6 +485,9 @@ if you believe they were disclosed to a third party.
|
|
476
485
|
yaml_hash[:concurrent_downloads] =
|
477
486
|
@hash.fetch(:concurrent_downloads, DEFAULT_CONCURRENT_DOWNLOADS)
|
478
487
|
|
488
|
+
yaml_hash[:install_extension_in_lib] =
|
489
|
+
@hash.fetch(:install_extension_in_lib, DEFAULT_INSTALL_EXTENSION_IN_LIB)
|
490
|
+
|
479
491
|
yaml_hash[:ssl_verify_mode] =
|
480
492
|
@hash[:ssl_verify_mode] if @hash.key? :ssl_verify_mode
|
481
493
|
|
@@ -13,11 +13,7 @@ module Kernel
|
|
13
13
|
|
14
14
|
module_function define_method(:warn) {|*messages, **kw|
|
15
15
|
unless uplevel = kw[:uplevel]
|
16
|
-
|
17
|
-
return original_warn.bind(self).call(*messages)
|
18
|
-
else
|
19
|
-
return original_warn.bind(self).call(*messages, **kw)
|
20
|
-
end
|
16
|
+
return original_warn.bind_call(self, *messages, **kw)
|
21
17
|
end
|
22
18
|
|
23
19
|
# Ensure `uplevel` fits a `long`
|
@@ -44,6 +40,6 @@ module Kernel
|
|
44
40
|
kw[:uplevel] = start
|
45
41
|
end
|
46
42
|
|
47
|
-
original_warn.
|
43
|
+
original_warn.bind_call(self, *messages, **kw)
|
48
44
|
}
|
49
45
|
end
|
data/lib/rubygems/defaults.rb
CHANGED
data/lib/rubygems/exceptions.rb
CHANGED
@@ -291,9 +291,3 @@ class Gem::UnsatisfiableDependencyError < Gem::DependencyError
|
|
291
291
|
@dependency.requirement
|
292
292
|
end
|
293
293
|
end
|
294
|
-
|
295
|
-
##
|
296
|
-
# Backwards compatible typo'd exception class for early RubyGems 2.0.x
|
297
|
-
|
298
|
-
Gem::UnsatisfiableDepedencyError = Gem::UnsatisfiableDependencyError # :nodoc:
|
299
|
-
Gem.deprecate_constant :UnsatisfiableDepedencyError
|
data/lib/rubygems/ext/builder.rb
CHANGED
@@ -19,13 +19,14 @@ class Gem::Ext::Builder
|
|
19
19
|
$1.downcase
|
20
20
|
end
|
21
21
|
|
22
|
-
def self.make(dest_path, results, make_dir = Dir.pwd, sitedir = nil, targets = ["clean", "", "install"]
|
22
|
+
def self.make(dest_path, results, make_dir = Dir.pwd, sitedir = nil, targets = ["clean", "", "install"],
|
23
|
+
target_rbconfig: Gem.target_rbconfig)
|
23
24
|
unless File.exist? File.join(make_dir, "Makefile")
|
24
25
|
raise Gem::InstallError, "Makefile not found"
|
25
26
|
end
|
26
27
|
|
27
28
|
# try to find make program from Ruby configure arguments first
|
28
|
-
|
29
|
+
target_rbconfig["configure_args"] =~ /with-make-prog\=(\w+)/
|
29
30
|
make_program_name = ENV["MAKE"] || ENV["make"] || $1
|
30
31
|
make_program_name ||= RUBY_PLATFORM.include?("mswin") ? "nmake" : "make"
|
31
32
|
make_program = Shellwords.split(make_program_name)
|
@@ -131,10 +132,11 @@ class Gem::Ext::Builder
|
|
131
132
|
# have build arguments, saved, set +build_args+ which is an ARGV-style
|
132
133
|
# array.
|
133
134
|
|
134
|
-
def initialize(spec, build_args = spec.build_args)
|
135
|
+
def initialize(spec, build_args = spec.build_args, target_rbconfig = Gem.target_rbconfig)
|
135
136
|
@spec = spec
|
136
137
|
@build_args = build_args
|
137
138
|
@gem_dir = spec.full_gem_path
|
139
|
+
@target_rbconfig = target_rbconfig
|
138
140
|
|
139
141
|
@ran_rake = false
|
140
142
|
end
|
@@ -191,7 +193,7 @@ EOF
|
|
191
193
|
FileUtils.mkdir_p dest_path
|
192
194
|
|
193
195
|
results = builder.build(extension, dest_path,
|
194
|
-
results, @build_args, lib_dir, extension_dir)
|
196
|
+
results, @build_args, lib_dir, extension_dir, @target_rbconfig)
|
195
197
|
|
196
198
|
verbose { results.join("\n") }
|
197
199
|
|
@@ -16,10 +16,15 @@ class Gem::Ext::CargoBuilder < Gem::Ext::Builder
|
|
16
16
|
@profile = :release
|
17
17
|
end
|
18
18
|
|
19
|
-
def build(extension, dest_path, results, args = [], lib_dir = nil, cargo_dir = Dir.pwd
|
19
|
+
def build(extension, dest_path, results, args = [], lib_dir = nil, cargo_dir = Dir.pwd,
|
20
|
+
target_rbconfig=Gem.target_rbconfig)
|
20
21
|
require "tempfile"
|
21
22
|
require "fileutils"
|
22
23
|
|
24
|
+
if target_rbconfig.path
|
25
|
+
warn "--target-rbconfig is not yet supported for Rust extensions. Ignoring"
|
26
|
+
end
|
27
|
+
|
23
28
|
# Where's the Cargo.toml of the crate we're building
|
24
29
|
cargo_toml = File.join(cargo_dir, "Cargo.toml")
|
25
30
|
# What's the crate's name
|
@@ -47,7 +52,6 @@ class Gem::Ext::CargoBuilder < Gem::Ext::Builder
|
|
47
52
|
|
48
53
|
nesting = extension_nesting(extension)
|
49
54
|
|
50
|
-
# TODO: remove in RubyGems 4
|
51
55
|
if Gem.install_extension_in_lib && lib_dir
|
52
56
|
nested_lib_dir = File.join(lib_dir, nesting)
|
53
57
|
FileUtils.mkdir_p nested_lib_dir
|
@@ -248,8 +252,7 @@ EOF
|
|
248
252
|
|
249
253
|
def rustc_dynamic_linker_flags(dest_dir, crate_name)
|
250
254
|
split_flags("DLDFLAGS").
|
251
|
-
|
252
|
-
compact.
|
255
|
+
filter_map {|arg| maybe_resolve_ldflag_variable(arg, dest_dir, crate_name) }.
|
253
256
|
flat_map {|arg| ldflag_to_link_modifier(arg) }
|
254
257
|
end
|
255
258
|
|
@@ -1,7 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
class Gem::Ext::CmakeBuilder < Gem::Ext::Builder
|
4
|
-
def self.build(extension, dest_path, results, args=[], lib_dir=nil, cmake_dir=Dir.pwd
|
4
|
+
def self.build(extension, dest_path, results, args=[], lib_dir=nil, cmake_dir=Dir.pwd,
|
5
|
+
target_rbconfig=Gem.target_rbconfig)
|
6
|
+
if target_rbconfig.path
|
7
|
+
warn "--target-rbconfig is not yet supported for CMake extensions. Ignoring"
|
8
|
+
end
|
9
|
+
|
5
10
|
unless File.exist?(File.join(cmake_dir, "Makefile"))
|
6
11
|
require_relative "../command"
|
7
12
|
cmd = ["cmake", ".", "-DCMAKE_INSTALL_PREFIX=#{dest_path}", *Gem::Command.build_args]
|
@@ -9,7 +14,7 @@ class Gem::Ext::CmakeBuilder < Gem::Ext::Builder
|
|
9
14
|
run cmd, results, class_name, cmake_dir
|
10
15
|
end
|
11
16
|
|
12
|
-
make dest_path, results, cmake_dir
|
17
|
+
make dest_path, results, cmake_dir, target_rbconfig: target_rbconfig
|
13
18
|
|
14
19
|
results
|
15
20
|
end
|
@@ -7,14 +7,19 @@
|
|
7
7
|
#++
|
8
8
|
|
9
9
|
class Gem::Ext::ConfigureBuilder < Gem::Ext::Builder
|
10
|
-
def self.build(extension, dest_path, results, args=[], lib_dir=nil, configure_dir=Dir.pwd
|
10
|
+
def self.build(extension, dest_path, results, args=[], lib_dir=nil, configure_dir=Dir.pwd,
|
11
|
+
target_rbconfig=Gem.target_rbconfig)
|
12
|
+
if target_rbconfig.path
|
13
|
+
warn "--target-rbconfig is not yet supported for configure-based extensions. Ignoring"
|
14
|
+
end
|
15
|
+
|
11
16
|
unless File.exist?(File.join(configure_dir, "Makefile"))
|
12
17
|
cmd = ["sh", "./configure", "--prefix=#{dest_path}", *args]
|
13
18
|
|
14
19
|
run cmd, results, class_name, configure_dir
|
15
20
|
end
|
16
21
|
|
17
|
-
make dest_path, results, configure_dir
|
22
|
+
make dest_path, results, configure_dir, target_rbconfig: target_rbconfig
|
18
23
|
|
19
24
|
results
|
20
25
|
end
|
@@ -7,7 +7,8 @@
|
|
7
7
|
#++
|
8
8
|
|
9
9
|
class Gem::Ext::ExtConfBuilder < Gem::Ext::Builder
|
10
|
-
def self.build(extension, dest_path, results, args=[], lib_dir=nil, extension_dir=Dir.pwd
|
10
|
+
def self.build(extension, dest_path, results, args=[], lib_dir=nil, extension_dir=Dir.pwd,
|
11
|
+
target_rbconfig=Gem.target_rbconfig)
|
11
12
|
require "fileutils"
|
12
13
|
require "tempfile"
|
13
14
|
|
@@ -23,6 +24,7 @@ class Gem::Ext::ExtConfBuilder < Gem::Ext::Builder
|
|
23
24
|
|
24
25
|
begin
|
25
26
|
cmd = ruby << File.basename(extension)
|
27
|
+
cmd << "--target-rbconfig=#{target_rbconfig.path}" if target_rbconfig.path
|
26
28
|
cmd.push(*args)
|
27
29
|
|
28
30
|
run(cmd, results, class_name, extension_dir) do |s, r|
|
@@ -39,12 +41,14 @@ class Gem::Ext::ExtConfBuilder < Gem::Ext::Builder
|
|
39
41
|
|
40
42
|
ENV["DESTDIR"] = nil
|
41
43
|
|
42
|
-
make dest_path, results, extension_dir, tmp_dest_relative
|
44
|
+
make dest_path, results, extension_dir, tmp_dest_relative, target_rbconfig: target_rbconfig
|
43
45
|
|
44
46
|
full_tmp_dest = File.join(extension_dir, tmp_dest_relative)
|
45
47
|
|
46
|
-
|
47
|
-
|
48
|
+
is_cross_compiling = target_rbconfig["platform"] != RbConfig::CONFIG["platform"]
|
49
|
+
# Do not copy extension libraries by default when cross-compiling
|
50
|
+
# not to conflict with the one already built for the host platform.
|
51
|
+
if Gem.install_extension_in_lib && lib_dir && !is_cross_compiling
|
48
52
|
FileUtils.mkdir_p lib_dir
|
49
53
|
entries = Dir.entries(full_tmp_dest) - %w[. ..]
|
50
54
|
entries = entries.map {|entry| File.join full_tmp_dest, entry }
|
@@ -56,7 +60,7 @@ class Gem::Ext::ExtConfBuilder < Gem::Ext::Builder
|
|
56
60
|
destent.exist? || FileUtils.mv(ent.path, destent.path)
|
57
61
|
end
|
58
62
|
|
59
|
-
make dest_path, results, extension_dir, tmp_dest_relative, ["clean"]
|
63
|
+
make dest_path, results, extension_dir, tmp_dest_relative, ["clean"], target_rbconfig: target_rbconfig
|
60
64
|
ensure
|
61
65
|
ENV["DESTDIR"] = destdir
|
62
66
|
end
|
@@ -9,7 +9,12 @@ require_relative "../shellwords"
|
|
9
9
|
#++
|
10
10
|
|
11
11
|
class Gem::Ext::RakeBuilder < Gem::Ext::Builder
|
12
|
-
def self.build(extension, dest_path, results, args=[], lib_dir=nil, extension_dir=Dir.pwd
|
12
|
+
def self.build(extension, dest_path, results, args=[], lib_dir=nil, extension_dir=Dir.pwd,
|
13
|
+
target_rbconfig=Gem.target_rbconfig)
|
14
|
+
if target_rbconfig.path
|
15
|
+
warn "--target-rbconfig is not yet supported for Rake extensions. Ignoring"
|
16
|
+
end
|
17
|
+
|
13
18
|
if /mkrf_conf/i.match?(File.basename(extension))
|
14
19
|
run([Gem.ruby, File.basename(extension), *args], results, class_name, extension_dir)
|
15
20
|
end
|
@@ -179,6 +179,11 @@ module Gem::InstallUpdateOptions
|
|
179
179
|
"Suggest alternates when gems are not found") do |v,_o|
|
180
180
|
options[:suggest_alternate] = v
|
181
181
|
end
|
182
|
+
|
183
|
+
add_option(:"Install/Update", "--target-rbconfig [FILE]",
|
184
|
+
"rbconfig.rb for the deployment target platform") do |v, _o|
|
185
|
+
Gem.set_target_rbconfig(v)
|
186
|
+
end
|
182
187
|
end
|
183
188
|
|
184
189
|
##
|
data/lib/rubygems/installer.rb
CHANGED
@@ -839,7 +839,7 @@ TEXT
|
|
839
839
|
# configure scripts and rakefiles or mkrf_conf files.
|
840
840
|
|
841
841
|
def build_extensions
|
842
|
-
builder = Gem::Ext::Builder.new spec, build_args
|
842
|
+
builder = Gem::Ext::Builder.new spec, build_args, Gem.target_rbconfig
|
843
843
|
|
844
844
|
builder.build_extensions
|
845
845
|
end
|
@@ -985,7 +985,7 @@ TEXT
|
|
985
985
|
end
|
986
986
|
|
987
987
|
def rb_config
|
988
|
-
|
988
|
+
Gem.target_rbconfig
|
989
989
|
end
|
990
990
|
|
991
991
|
def ruby_install_name
|
data/lib/rubygems/platform.rb
CHANGED
@@ -12,9 +12,10 @@ class Gem::Platform
|
|
12
12
|
|
13
13
|
attr_accessor :cpu, :os, :version
|
14
14
|
|
15
|
-
def self.local
|
16
|
-
@local
|
17
|
-
|
15
|
+
def self.local(refresh: false)
|
16
|
+
return @local if @local && !refresh
|
17
|
+
@local = begin
|
18
|
+
arch = Gem.target_rbconfig["arch"]
|
18
19
|
arch = "#{arch}_60" if /mswin(?:32|64)$/.match?(arch)
|
19
20
|
new(arch)
|
20
21
|
end
|
data/lib/rubygems/psych_tree.rb
CHANGED
@@ -330,7 +330,7 @@ class Gem::RequestSet::GemDependencyAPI
|
|
330
330
|
# git: ::
|
331
331
|
# Install this dependency from a git repository:
|
332
332
|
#
|
333
|
-
# gem 'private_gem', git: git@my.company.example:private_gem.git'
|
333
|
+
# gem 'private_gem', git: 'git@my.company.example:private_gem.git'
|
334
334
|
#
|
335
335
|
# gist: ::
|
336
336
|
# Install this dependency from the gist ID:
|
data/lib/rubygems/requirement.rb
CHANGED
@@ -44,16 +44,16 @@ class Gem::Resolver::ComposedSet < Gem::Resolver::Set
|
|
44
44
|
end
|
45
45
|
|
46
46
|
def errors
|
47
|
-
@errors + @sets.
|
47
|
+
@errors + @sets.flat_map(&:errors)
|
48
48
|
end
|
49
49
|
|
50
50
|
##
|
51
51
|
# Finds all specs matching +req+ in all sets.
|
52
52
|
|
53
53
|
def find_all(req)
|
54
|
-
@sets.
|
54
|
+
@sets.flat_map do |s|
|
55
55
|
s.find_all req
|
56
|
-
end
|
56
|
+
end
|
57
57
|
end
|
58
58
|
|
59
59
|
##
|
@@ -65,11 +65,11 @@ class Gem::Resolver::IndexSet < Gem::Resolver::Set
|
|
65
65
|
|
66
66
|
q.breakable
|
67
67
|
|
68
|
-
names = @all.values.
|
68
|
+
names = @all.values.flat_map do |tuples|
|
69
69
|
tuples.map do |_, tuple|
|
70
70
|
tuple.full_name
|
71
71
|
end
|
72
|
-
end
|
72
|
+
end
|
73
73
|
|
74
74
|
q.seplist names do |name|
|
75
75
|
q.text name
|
data/lib/rubygems/resolver.rb
CHANGED
@@ -59,7 +59,7 @@ class Gem::Resolver
|
|
59
59
|
def self.compose_sets(*sets)
|
60
60
|
sets.compact!
|
61
61
|
|
62
|
-
sets = sets.
|
62
|
+
sets = sets.flat_map do |set|
|
63
63
|
case set
|
64
64
|
when Gem::Resolver::BestSet then
|
65
65
|
set
|
@@ -68,7 +68,7 @@ class Gem::Resolver
|
|
68
68
|
else
|
69
69
|
set
|
70
70
|
end
|
71
|
-
end
|
71
|
+
end
|
72
72
|
|
73
73
|
case sets.length
|
74
74
|
when 0 then
|
@@ -183,7 +183,7 @@ class Gem::Resolver
|
|
183
183
|
# Proceed with resolution! Returns an array of ActivationRequest objects.
|
184
184
|
|
185
185
|
def resolve
|
186
|
-
Gem::Molinillo::Resolver.new(self, self).resolve(@needed.map {|d| DependencyRequest.new d, nil }).tsort.
|
186
|
+
Gem::Molinillo::Resolver.new(self, self).resolve(@needed.map {|d| DependencyRequest.new d, nil }).tsort.filter_map(&:payload)
|
187
187
|
rescue Gem::Molinillo::VersionConflict => e
|
188
188
|
conflict = e.conflicts.values.first
|
189
189
|
raise Gem::DependencyResolutionError, Conflict.new(conflict.requirement_trees.first.first, conflict.existing, conflict.requirement)
|
data/lib/rubygems/source/git.rb
CHANGED
@@ -58,7 +58,6 @@ class Gem::Source::Git < Gem::Source
|
|
58
58
|
|
59
59
|
@remote = true
|
60
60
|
@root_dir = Gem.dir
|
61
|
-
@git = ENV["git"] || "git"
|
62
61
|
end
|
63
62
|
|
64
63
|
def <=>(other)
|
@@ -81,6 +80,10 @@ class Gem::Source::Git < Gem::Source
|
|
81
80
|
@need_submodules == other.need_submodules
|
82
81
|
end
|
83
82
|
|
83
|
+
def git_command
|
84
|
+
ENV.fetch("git", "git")
|
85
|
+
end
|
86
|
+
|
84
87
|
##
|
85
88
|
# Checks out the files for the repository into the install_dir.
|
86
89
|
|
@@ -90,18 +93,18 @@ class Gem::Source::Git < Gem::Source
|
|
90
93
|
return false unless File.exist? repo_cache_dir
|
91
94
|
|
92
95
|
unless File.exist? install_dir
|
93
|
-
system
|
96
|
+
system git_command, "clone", "--quiet", "--no-checkout",
|
94
97
|
repo_cache_dir, install_dir
|
95
98
|
end
|
96
99
|
|
97
100
|
Dir.chdir install_dir do
|
98
|
-
system
|
101
|
+
system git_command, "fetch", "--quiet", "--force", "--tags", install_dir
|
99
102
|
|
100
|
-
success = system
|
103
|
+
success = system git_command, "reset", "--quiet", "--hard", rev_parse
|
101
104
|
|
102
105
|
if @need_submodules
|
103
106
|
require "open3"
|
104
|
-
_, status = Open3.capture2e(
|
107
|
+
_, status = Open3.capture2e(git_command, "submodule", "update", "--quiet", "--init", "--recursive")
|
105
108
|
|
106
109
|
success &&= status.success?
|
107
110
|
end
|
@@ -118,11 +121,11 @@ class Gem::Source::Git < Gem::Source
|
|
118
121
|
|
119
122
|
if File.exist? repo_cache_dir
|
120
123
|
Dir.chdir repo_cache_dir do
|
121
|
-
system
|
124
|
+
system git_command, "fetch", "--quiet", "--force", "--tags",
|
122
125
|
@repository, "refs/heads/*:refs/heads/*"
|
123
126
|
end
|
124
127
|
else
|
125
|
-
system
|
128
|
+
system git_command, "clone", "--quiet", "--bare", "--no-hardlinks",
|
126
129
|
@repository, repo_cache_dir
|
127
130
|
end
|
128
131
|
end
|
@@ -182,7 +185,7 @@ class Gem::Source::Git < Gem::Source
|
|
182
185
|
hash = nil
|
183
186
|
|
184
187
|
Dir.chdir repo_cache_dir do
|
185
|
-
hash = Gem::Util.popen(
|
188
|
+
hash = Gem::Util.popen(git_command, "rev-parse", @reference).strip
|
186
189
|
end
|
187
190
|
|
188
191
|
raise Gem::Exception,
|
@@ -201,7 +204,7 @@ class Gem::Source::Git < Gem::Source
|
|
201
204
|
return [] unless install_dir
|
202
205
|
|
203
206
|
Dir.chdir install_dir do
|
204
|
-
Dir["{,*,*/*}.gemspec"].
|
207
|
+
Dir["{,*,*/*}.gemspec"].filter_map do |spec_file|
|
205
208
|
directory = File.dirname spec_file
|
206
209
|
file = File.basename spec_file
|
207
210
|
|
@@ -218,7 +221,7 @@ class Gem::Source::Git < Gem::Source
|
|
218
221
|
end
|
219
222
|
spec
|
220
223
|
end
|
221
|
-
end
|
224
|
+
end
|
222
225
|
end
|
223
226
|
end
|
224
227
|
|
@@ -182,20 +182,31 @@ class Gem::SpecFetcher
|
|
182
182
|
min_length = gem_name.length - max
|
183
183
|
max_length = gem_name.length + max
|
184
184
|
|
185
|
+
gem_name_with_postfix = "#{gem_name}ruby"
|
186
|
+
gem_name_with_prefix = "ruby#{gem_name}"
|
187
|
+
|
185
188
|
matches = names.filter_map do |n|
|
186
189
|
len = n.name.length
|
187
|
-
# If the length is min_length or shorter, we've done `max` deletions.
|
188
|
-
# If the length is max_length or longer, we've done `max` insertions.
|
189
|
-
# These would both be rejected later, so we skip early for performance.
|
190
|
-
next if len <= min_length || len >= max_length
|
191
|
-
|
192
190
|
# If the gem doesn't support the current platform, bail early.
|
193
191
|
next unless n.match_platform?
|
194
192
|
|
193
|
+
# If the length is min_length or shorter, we've done `max` deletions.
|
194
|
+
# This would be rejected later, so we skip it for performance.
|
195
|
+
next if len <= min_length
|
196
|
+
|
195
197
|
# The candidate name, normalized the same as gem_name.
|
196
198
|
normalized_name = n.name.downcase
|
197
199
|
normalized_name.tr!("_-", "")
|
198
200
|
|
201
|
+
# If the gem is "{NAME}-ruby" and "ruby-{NAME}", we want to return it.
|
202
|
+
# But we already removed hyphens, so we check "{NAME}ruby" and "ruby{NAME}".
|
203
|
+
next [n.name, 0] if normalized_name == gem_name_with_postfix
|
204
|
+
next [n.name, 0] if normalized_name == gem_name_with_prefix
|
205
|
+
|
206
|
+
# If the length is max_length or longer, we've done `max` insertions.
|
207
|
+
# This would be rejected later, so we skip it for performance.
|
208
|
+
next if len >= max_length
|
209
|
+
|
199
210
|
# If we found an exact match (after stripping underscores and hyphens),
|
200
211
|
# that's our most likely candidate.
|
201
212
|
# Return it immediately, and skip the rest of the loop.
|