rubygems-update 3.5.23 → 3.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +74 -0
- data/Manifest.txt +23 -16
- data/README.md +15 -10
- data/bundler/CHANGELOG.md +66 -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 +155 -74
- 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 +28 -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 +11 -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/query_utils.rb +1 -1
- 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 +11 -5
- data/lib/rubygems/vendor/timeout/COPYING +56 -0
- data/lib/rubygems/vendor/timeout/lib/timeout.rb +9 -10
- 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 +30 -21
- 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
@@ -30,7 +30,7 @@ The push command will use ~/.gem/credentials to authenticate to a server, but yo
|
|
30
30
|
end
|
31
31
|
|
32
32
|
def initialize
|
33
|
-
super "push", "Push a gem up to the gem server", host: host
|
33
|
+
super "push", "Push a gem up to the gem server", host: host, attestations: []
|
34
34
|
|
35
35
|
@user_defined_host = false
|
36
36
|
|
@@ -45,6 +45,11 @@ The push command will use ~/.gem/credentials to authenticate to a server, but yo
|
|
45
45
|
@user_defined_host = true
|
46
46
|
end
|
47
47
|
|
48
|
+
add_option("--attestation FILE",
|
49
|
+
"Push with sigstore attestations") do |value, options|
|
50
|
+
options[:attestations] << value
|
51
|
+
end
|
52
|
+
|
48
53
|
@host = nil
|
49
54
|
end
|
50
55
|
|
@@ -88,10 +93,18 @@ The push command will use ~/.gem/credentials to authenticate to a server, but yo
|
|
88
93
|
|
89
94
|
def send_push_request(name, args)
|
90
95
|
rubygems_api_request(*args, scope: get_push_scope) do |request|
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
96
|
+
body = Gem.read_binary name
|
97
|
+
if options[:attestations].any?
|
98
|
+
request.set_form([
|
99
|
+
["gem", body, { filename: name, content_type: "application/octet-stream" }],
|
100
|
+
get_attestations_part,
|
101
|
+
], "multipart/form-data")
|
102
|
+
else
|
103
|
+
request.body = body
|
104
|
+
request.add_field "Content-Type", "application/octet-stream"
|
105
|
+
request.add_field "Content-Length", request.body.size
|
106
|
+
end
|
107
|
+
request.add_field "Authorization", api_key
|
95
108
|
end
|
96
109
|
end
|
97
110
|
|
@@ -107,4 +120,15 @@ The push command will use ~/.gem/credentials to authenticate to a server, but yo
|
|
107
120
|
def get_push_scope
|
108
121
|
:push_rubygem
|
109
122
|
end
|
123
|
+
|
124
|
+
def get_attestations_part
|
125
|
+
bundles = "[" + options[:attestations].map do |attestation|
|
126
|
+
Gem.read_binary(attestation)
|
127
|
+
end.join(",") + "]"
|
128
|
+
[
|
129
|
+
"attestations",
|
130
|
+
bundles,
|
131
|
+
{ content_type: "application/json" },
|
132
|
+
]
|
133
|
+
end
|
110
134
|
end
|
@@ -64,9 +64,9 @@ Use --overwrite to force rebuilding of documentation.
|
|
64
64
|
specs = if options[:all]
|
65
65
|
Gem::Specification.to_a
|
66
66
|
else
|
67
|
-
get_all_gem_names.
|
67
|
+
get_all_gem_names.flat_map do |name|
|
68
68
|
Gem::Specification.find_by_name name, options[:version]
|
69
|
-
end.
|
69
|
+
end.uniq
|
70
70
|
end
|
71
71
|
|
72
72
|
if specs.empty?
|
@@ -107,15 +107,6 @@ class Gem::Commands::SetupCommand < Gem::Command
|
|
107
107
|
@verbose = nil
|
108
108
|
end
|
109
109
|
|
110
|
-
def check_ruby_version
|
111
|
-
required_version = Gem::Requirement.new ">= 2.6.0"
|
112
|
-
|
113
|
-
unless required_version.satisfied_by? Gem.ruby_version
|
114
|
-
alert_error "Expected Ruby version #{required_version}, is #{Gem.ruby_version}"
|
115
|
-
terminate_interaction 1
|
116
|
-
end
|
117
|
-
end
|
118
|
-
|
119
110
|
def defaults_str # :nodoc:
|
120
111
|
"--format-executable --document ri --regenerate-binstubs"
|
121
112
|
end
|
@@ -148,8 +139,6 @@ By default, this RubyGems will install gem as:
|
|
148
139
|
def execute
|
149
140
|
@verbose = Gem.configuration.really_verbose
|
150
141
|
|
151
|
-
check_ruby_version
|
152
|
-
|
153
142
|
require "fileutils"
|
154
143
|
if Gem.configuration.really_verbose
|
155
144
|
extend FileUtils::Verbose
|
@@ -279,11 +268,7 @@ By default, this RubyGems will install gem as:
|
|
279
268
|
File.open bin_cmd_file, "w" do |file|
|
280
269
|
file.puts <<-TEXT
|
281
270
|
@ECHO OFF
|
282
|
-
|
283
|
-
@"#{File.basename(Gem.ruby).chomp('"')}" "#{dest_file}" %1 %2 %3 %4 %5 %6 %7 %8 %9
|
284
|
-
GOTO :EOF
|
285
|
-
:WinNT
|
286
|
-
@"#{File.basename(Gem.ruby).chomp('"')}" "%~dpn0" %*
|
271
|
+
@"%~dp0#{File.basename(Gem.ruby).chomp('"')}" "%~dpn0" %*
|
287
272
|
TEXT
|
288
273
|
end
|
289
274
|
|
@@ -143,12 +143,6 @@ command help for an example.
|
|
143
143
|
# get_path 'rake', '< 0.1' # nil
|
144
144
|
# get_path 'rak' # nil (exact name required)
|
145
145
|
#--
|
146
|
-
# TODO: This should be refactored so that it's a general service. I don't
|
147
|
-
# think any of our existing classes are the right place though. Just maybe
|
148
|
-
# 'Cache'?
|
149
|
-
#
|
150
|
-
# TODO: It just uses Gem.dir for now. What's an easy way to get the list of
|
151
|
-
# source directories?
|
152
146
|
|
153
147
|
def get_path(dependency)
|
154
148
|
return dependency.name if /\.gem$/i.match?(dependency.name)
|
@@ -317,16 +317,10 @@ command to remove old versions.
|
|
317
317
|
|
318
318
|
#
|
319
319
|
# Oldest version we support downgrading to. This is the version that
|
320
|
-
# originally ships with the
|
321
|
-
# test each ruby against older rubygems, so we can't really guarantee it
|
322
|
-
# works. Version list can be checked here: https://stdgems.org/rubygems
|
320
|
+
# originally ships with the oldest supported patch version of ruby.
|
323
321
|
#
|
324
322
|
def oldest_supported_version
|
325
323
|
@oldest_supported_version ||=
|
326
|
-
|
327
|
-
Gem::Version.new("3.3.3")
|
328
|
-
else
|
329
|
-
Gem::Version.new("3.2.3")
|
330
|
-
end
|
324
|
+
Gem::Version.new("3.3.3")
|
331
325
|
end
|
332
326
|
end
|
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
data/lib/rubygems/query_utils.rb
CHANGED
@@ -311,7 +311,7 @@ module Gem::QueryUtils
|
|
311
311
|
label = "Installed at"
|
312
312
|
specs.each do |s|
|
313
313
|
version = s.version.to_s
|
314
|
-
default = ", default"
|
314
|
+
default = s.default_gem? ? ", default" : ""
|
315
315
|
entry << "\n" << " #{label} (#{version}#{default}): #{s.base_dir}"
|
316
316
|
label = " " * label.length
|
317
317
|
end
|
@@ -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)
|