rubygems-update 4.0.0 → 4.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +25 -0
- data/bundler/CHANGELOG.md +27 -0
- data/bundler/lib/bundler/build_metadata.rb +2 -2
- data/bundler/lib/bundler/cli/install.rb +1 -1
- data/bundler/lib/bundler/cli/pristine.rb +4 -0
- data/bundler/lib/bundler/cli.rb +14 -8
- data/bundler/lib/bundler/endpoint_specification.rb +22 -0
- data/bundler/lib/bundler/fetcher/gem_remote_fetcher.rb +6 -0
- data/bundler/lib/bundler/ruby_dsl.rb +15 -12
- data/bundler/lib/bundler/rubygems_gem_installer.rb +4 -0
- data/bundler/lib/bundler/templates/newgem/lib/newgem.rb.tt +1 -1
- data/bundler/lib/bundler/version.rb +1 -1
- data/doc/rubygems/CONTRIBUTING.md +4 -0
- data/lib/rubygems/commands/setup_command.rb +4 -2
- data/lib/rubygems/dependency_installer.rb +2 -0
- data/lib/rubygems/ext/builder.rb +15 -4
- data/lib/rubygems/ext/cargo_builder.rb +1 -1
- data/lib/rubygems/ext/cmake_builder.rb +1 -1
- data/lib/rubygems/ext/configure_builder.rb +2 -2
- data/lib/rubygems/ext/ext_conf_builder.rb +2 -5
- data/lib/rubygems/ext/rake_builder.rb +1 -1
- data/lib/rubygems/install_update_options.rb +9 -0
- data/lib/rubygems/installer.rb +6 -1
- data/lib/rubygems/remote_fetcher.rb +2 -1
- data/lib/rubygems/request/connection_pools.rb +4 -3
- data/lib/rubygems/request/http_pool.rb +11 -4
- data/lib/rubygems.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c9f59269d6d1048c0621c1a5eebf9a11e4bfb2563437a2321ab7ea7cc88112ae
|
|
4
|
+
data.tar.gz: cc74dcbadef15de4f55949db6c8260b59a2c32217db792305cbc43f8f9475c2c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: dfca31973be9cfacea2aa06e470b47a0c49c4a381c2e5a3fa0cf8ef68bebdb675c62e101cc31bc9c3786fbe3272263792ee77ef13a5869d85fb68e97311d4f91
|
|
7
|
+
data.tar.gz: 3da6e226d22a6328348ea79ea704e0c6acb99a1090579707aeacbe1984f823e0c8c02330c1aeb1281c61c4ffef17801325bd6c0061b79fe8502997093b6f9bf8
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 4.0.2 / 2025-12-17
|
|
4
|
+
|
|
5
|
+
### Enhancements:
|
|
6
|
+
|
|
7
|
+
* Pass down value of `BUNDLE_JOBS` to RubyGems before compiling &
|
|
8
|
+
introduce a new `gem install -j` flag. Pull request
|
|
9
|
+
[#9171](https://github.com/ruby/rubygems/pull/9171) by Edouard-chin
|
|
10
|
+
* Installs bundler 4.0.2 as a default gem.
|
|
11
|
+
|
|
12
|
+
## 4.0.1 / 2025-12-09
|
|
13
|
+
|
|
14
|
+
### Enhancements:
|
|
15
|
+
|
|
16
|
+
* Installs bundler 4.0.1 as a default gem.
|
|
17
|
+
|
|
18
|
+
### Bug fixes:
|
|
19
|
+
|
|
20
|
+
* Fixed unexpected default bundler installation. Pull request
|
|
21
|
+
[#9167](https://github.com/ruby/rubygems/pull/9167) by hsbt
|
|
22
|
+
|
|
23
|
+
### Documentation:
|
|
24
|
+
|
|
25
|
+
* Update contributing docs with `RGV`. Pull request
|
|
26
|
+
[#9155](https://github.com/ruby/rubygems/pull/9155) by eileencodes
|
|
27
|
+
|
|
3
28
|
## 4.0.0 / 2025-12-03
|
|
4
29
|
|
|
5
30
|
### Features:
|
data/bundler/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 4.0.2 (2025-12-17)
|
|
4
|
+
|
|
5
|
+
### Enhancements:
|
|
6
|
+
|
|
7
|
+
- Support single quotes in mise format ruby version [#9183](https://github.com/ruby/rubygems/pull/9183)
|
|
8
|
+
- Tweak the Bundler's "X gems now installed message": [#9194](https://github.com/ruby/rubygems/pull/9194)
|
|
9
|
+
|
|
10
|
+
### Bug fixes:
|
|
11
|
+
|
|
12
|
+
- Allow to show cli_help with `bundler` executable [#9198](https://github.com/ruby/rubygems/pull/9198)
|
|
13
|
+
- Allow bundle pristine to work for git gems in the same repo [#9196](https://github.com/ruby/rubygems/pull/9196)
|
|
14
|
+
|
|
15
|
+
## 4.0.1 (2025-12-09)
|
|
16
|
+
|
|
17
|
+
### Performance:
|
|
18
|
+
|
|
19
|
+
- Increase connection pool to allow for up to 70% speed increase on `bundle install` [#9087](https://github.com/ruby/rubygems/pull/9087)
|
|
20
|
+
|
|
21
|
+
### Enhancements:
|
|
22
|
+
|
|
23
|
+
- Fix the config suggestion in the warning for `$ bundle` [#9164](https://github.com/ruby/rubygems/pull/9164)
|
|
24
|
+
- Fix native extension loading in newgem template for RHEL-based systems [#9156](https://github.com/ruby/rubygems/pull/9156)
|
|
25
|
+
|
|
26
|
+
### Bug fixes:
|
|
27
|
+
|
|
28
|
+
- Fix Bundler removing executables after creating them [#9169](https://github.com/ruby/rubygems/pull/9169)
|
|
29
|
+
|
|
3
30
|
## 4.0.0 (2025-12-03)
|
|
4
31
|
|
|
5
32
|
### Features:
|
|
@@ -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 = "2025-12-
|
|
8
|
-
@git_commit_sha = "
|
|
7
|
+
@built_at = "2025-12-17".freeze
|
|
8
|
+
@git_commit_sha = "03359f8b08".freeze
|
|
9
9
|
# end ivars
|
|
10
10
|
|
|
11
11
|
# A hash representation of the build metadata.
|
|
@@ -11,6 +11,7 @@ module Bundler
|
|
|
11
11
|
definition = Bundler.definition
|
|
12
12
|
definition.validate_runtime!
|
|
13
13
|
installer = Bundler::Installer.new(Bundler.root, definition)
|
|
14
|
+
git_sources = []
|
|
14
15
|
|
|
15
16
|
ProcessLock.lock do
|
|
16
17
|
installed_specs = definition.specs.reject do |spec|
|
|
@@ -41,6 +42,9 @@ module Bundler
|
|
|
41
42
|
end
|
|
42
43
|
FileUtils.rm_rf spec.extension_dir
|
|
43
44
|
FileUtils.rm_rf spec.full_gem_path
|
|
45
|
+
|
|
46
|
+
next if git_sources.include?(source)
|
|
47
|
+
git_sources << source
|
|
44
48
|
else
|
|
45
49
|
Bundler.ui.warn("Cannot pristine #{gem_name}. Gem is sourced from local path.")
|
|
46
50
|
next
|
data/bundler/lib/bundler/cli.rb
CHANGED
|
@@ -104,7 +104,7 @@ module Bundler
|
|
|
104
104
|
primary_commands = ["install", "update", "cache", "exec", "config", "help"]
|
|
105
105
|
|
|
106
106
|
list = self.class.printable_commands(true)
|
|
107
|
-
by_name = list.group_by {|name, _message| name.match(/^
|
|
107
|
+
by_name = list.group_by {|name, _message| name.match(/^bundler? (\w+)/)[1] }
|
|
108
108
|
utilities = by_name.keys.sort - primary_commands
|
|
109
109
|
primary_commands.map! {|name| (by_name[name] || raise("no primary command #{name}")).first }
|
|
110
110
|
utilities.map! {|name| by_name[name].first }
|
|
@@ -120,28 +120,31 @@ module Bundler
|
|
|
120
120
|
self.class.send(:class_options_help, shell)
|
|
121
121
|
end
|
|
122
122
|
|
|
123
|
-
desc "install_or_cli_help", "
|
|
123
|
+
desc "install_or_cli_help", "Deprecated alias of install", hide: true
|
|
124
124
|
def install_or_cli_help
|
|
125
|
+
Bundler.ui.warn <<~MSG
|
|
126
|
+
`bundle install_or_cli_help` is a deprecated alias of `bundle install`.
|
|
127
|
+
It might be called due to the 'default_cli_command' being set to 'install_or_cli_help',
|
|
128
|
+
if so fix that by running `bundle config set default_cli_command install --global`.
|
|
129
|
+
MSG
|
|
125
130
|
invoke_other_command("install")
|
|
126
|
-
rescue GemfileNotFound => error
|
|
127
|
-
Bundler.ui.error error.message, wrap: true
|
|
128
|
-
invoke_other_command("cli_help")
|
|
129
131
|
end
|
|
130
132
|
|
|
131
133
|
def self.default_command(meth = nil)
|
|
132
134
|
return super if meth
|
|
133
135
|
|
|
134
136
|
unless Bundler.settings[:default_cli_command]
|
|
135
|
-
Bundler.ui.info
|
|
137
|
+
Bundler.ui.info <<~MSG
|
|
136
138
|
In a future version of Bundler, running `bundle` without argument will no longer run `bundle install`.
|
|
137
139
|
Instead, the `cli_help` command will be displayed. Please use `bundle install` explicitly for scripts like CI/CD.
|
|
138
140
|
You can use the future behavior now with `bundle config set default_cli_command cli_help --global`,
|
|
139
|
-
or you can continue to use the current behavior with `bundle config set default_cli_command
|
|
141
|
+
or you can continue to use the current behavior with `bundle config set default_cli_command install --global`.
|
|
140
142
|
This message will be removed after a default_cli_command value is set.
|
|
143
|
+
|
|
141
144
|
MSG
|
|
142
145
|
end
|
|
143
146
|
|
|
144
|
-
Bundler.settings[:default_cli_command] || "
|
|
147
|
+
Bundler.settings[:default_cli_command] || "install"
|
|
145
148
|
end
|
|
146
149
|
|
|
147
150
|
class_option "no-color", type: :boolean, desc: "Disable colorization in output"
|
|
@@ -287,6 +290,9 @@ module Bundler
|
|
|
287
290
|
Bundler.settings.temporary(no_install: false) do
|
|
288
291
|
Install.new(options).run
|
|
289
292
|
end
|
|
293
|
+
rescue GemfileNotFound => error
|
|
294
|
+
invoke_other_command("cli_help")
|
|
295
|
+
raise error # re-raise to show the error and get a failing exit status
|
|
290
296
|
end
|
|
291
297
|
|
|
292
298
|
map aliases_for("install")
|
|
@@ -60,6 +60,28 @@ module Bundler
|
|
|
60
60
|
end
|
|
61
61
|
end
|
|
62
62
|
|
|
63
|
+
# needed for binstubs
|
|
64
|
+
def executables
|
|
65
|
+
if @remote_specification
|
|
66
|
+
@remote_specification.executables
|
|
67
|
+
elsif _local_specification
|
|
68
|
+
_local_specification.executables
|
|
69
|
+
else
|
|
70
|
+
super
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
# needed for bundle clean
|
|
75
|
+
def bindir
|
|
76
|
+
if @remote_specification
|
|
77
|
+
@remote_specification.bindir
|
|
78
|
+
elsif _local_specification
|
|
79
|
+
_local_specification.bindir
|
|
80
|
+
else
|
|
81
|
+
super
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
|
|
63
85
|
# needed for post_install_messages during install
|
|
64
86
|
def post_install_message
|
|
65
87
|
if @remote_specification
|
|
@@ -5,6 +5,12 @@ require "rubygems/remote_fetcher"
|
|
|
5
5
|
module Bundler
|
|
6
6
|
class Fetcher
|
|
7
7
|
class GemRemoteFetcher < Gem::RemoteFetcher
|
|
8
|
+
def initialize(*)
|
|
9
|
+
super
|
|
10
|
+
|
|
11
|
+
@pool_size = 5
|
|
12
|
+
end
|
|
13
|
+
|
|
8
14
|
def request(*args)
|
|
9
15
|
super do |req|
|
|
10
16
|
req.delete("User-Agent") if headers["User-Agent"]
|
|
@@ -42,18 +42,21 @@ module Bundler
|
|
|
42
42
|
# Loads the file relative to the dirname of the Gemfile itself.
|
|
43
43
|
def normalize_ruby_file(filename)
|
|
44
44
|
file_content = Bundler.read_file(gemfile.dirname.join(filename))
|
|
45
|
-
# match "ruby-3.2.2", ruby = "3.2.2" or "ruby 3.2.2" capturing version string up to the first space or comment
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
45
|
+
# match "ruby-3.2.2", ruby = "3.2.2", ruby = '3.2.2' or "ruby 3.2.2" capturing version string up to the first space or comment
|
|
46
|
+
version_match = /^ # Start of line
|
|
47
|
+
ruby # Literal "ruby"
|
|
48
|
+
[\s-]* # Optional whitespace or hyphens (for "ruby-3.2.2" format)
|
|
49
|
+
(?:=\s*)? # Optional equals sign with whitespace (for ruby = "3.2.2" format)
|
|
50
|
+
(?:
|
|
51
|
+
"([^"]+)" # Double quoted version
|
|
52
|
+
|
|
|
53
|
+
'([^']+)' # Single quoted version
|
|
54
|
+
|
|
|
55
|
+
([^\s#"']+) # Unquoted version
|
|
56
|
+
)
|
|
57
|
+
/x.match(file_content)
|
|
58
|
+
if version_match
|
|
59
|
+
version_match[1] || version_match[2] || version_match[3]
|
|
57
60
|
else
|
|
58
61
|
file_content.strip
|
|
59
62
|
end
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
require_relative "<%= File.basename(config[:namespaced_path]) %>/version"
|
|
4
4
|
<%- if config[:ext] -%>
|
|
5
|
-
|
|
5
|
+
require "<%= File.basename(config[:namespaced_path]) %>/<%= config[:underscored_name] %>"
|
|
6
6
|
<%- end -%>
|
|
7
7
|
|
|
8
8
|
<%- config[:constant_array].each_with_index do |c, i| -%>
|
|
@@ -82,6 +82,10 @@ To run an individual test file location for example in `spec/install/gems/standa
|
|
|
82
82
|
|
|
83
83
|
bin/rspec spec/install/gems/standalone_spec.rb
|
|
84
84
|
|
|
85
|
+
To test Rubygems changes in bundler, set the path to your local Rubygems copy using the `RGV` environment variable:
|
|
86
|
+
|
|
87
|
+
RGV=.. bin/rspec spec/install/gems/standalone_spec.rb
|
|
88
|
+
|
|
85
89
|
### Checking code style
|
|
86
90
|
|
|
87
91
|
You can check compliance with our code style with
|
|
@@ -402,8 +402,10 @@ By default, this RubyGems will install gem as:
|
|
|
402
402
|
install_dir: default_dir,
|
|
403
403
|
wrappers: true
|
|
404
404
|
)
|
|
405
|
-
|
|
406
|
-
|
|
405
|
+
# We need to install only executable and default spec files.
|
|
406
|
+
# lib/bundler.rb and lib/bundler/* are available under the site_ruby directory.
|
|
407
|
+
installer.extract_bin
|
|
408
|
+
installer.generate_bin
|
|
407
409
|
installer.write_default_spec
|
|
408
410
|
ensure
|
|
409
411
|
FileUtils.rm_f built_gem
|
|
@@ -83,6 +83,7 @@ class Gem::DependencyInstaller
|
|
|
83
83
|
@user_install = options[:user_install]
|
|
84
84
|
@wrappers = options[:wrappers]
|
|
85
85
|
@build_args = options[:build_args]
|
|
86
|
+
@build_jobs = options[:build_jobs]
|
|
86
87
|
@build_docs_in_background = options[:build_docs_in_background]
|
|
87
88
|
@dir_mode = options[:dir_mode]
|
|
88
89
|
@data_mode = options[:data_mode]
|
|
@@ -154,6 +155,7 @@ class Gem::DependencyInstaller
|
|
|
154
155
|
options = {
|
|
155
156
|
bin_dir: @bin_dir,
|
|
156
157
|
build_args: @build_args,
|
|
158
|
+
build_jobs: @build_jobs,
|
|
157
159
|
document: @document,
|
|
158
160
|
env_shebang: @env_shebang,
|
|
159
161
|
force: @force,
|
data/lib/rubygems/ext/builder.rb
CHANGED
|
@@ -22,7 +22,7 @@ class Gem::Ext::Builder
|
|
|
22
22
|
end
|
|
23
23
|
|
|
24
24
|
def self.make(dest_path, results, make_dir = Dir.pwd, sitedir = nil, targets = ["clean", "", "install"],
|
|
25
|
-
target_rbconfig: Gem.target_rbconfig)
|
|
25
|
+
target_rbconfig: Gem.target_rbconfig, n_jobs: nil)
|
|
26
26
|
unless File.exist? File.join(make_dir, "Makefile")
|
|
27
27
|
# No makefile exists, nothing to do.
|
|
28
28
|
raise NoMakefileError, "No Makefile found in #{make_dir}"
|
|
@@ -34,8 +34,18 @@ class Gem::Ext::Builder
|
|
|
34
34
|
make_program_name ||= RUBY_PLATFORM.include?("mswin") ? "nmake" : "make"
|
|
35
35
|
make_program = shellsplit(make_program_name)
|
|
36
36
|
|
|
37
|
+
is_nmake = /\bnmake/i.match?(make_program_name)
|
|
37
38
|
# The installation of the bundled gems is failed when DESTDIR is empty in mswin platform.
|
|
38
|
-
destdir =
|
|
39
|
+
destdir = !is_nmake || ENV["DESTDIR"] && ENV["DESTDIR"] != "" ? format("DESTDIR=%s", ENV["DESTDIR"]) : ""
|
|
40
|
+
|
|
41
|
+
# nmake doesn't support parallel build
|
|
42
|
+
unless is_nmake
|
|
43
|
+
have_make_arguments = make_program.size > 1
|
|
44
|
+
|
|
45
|
+
if !have_make_arguments && !ENV["MAKEFLAGS"] && n_jobs
|
|
46
|
+
make_program << "-j#{n_jobs}"
|
|
47
|
+
end
|
|
48
|
+
end
|
|
39
49
|
|
|
40
50
|
env = [destdir]
|
|
41
51
|
|
|
@@ -147,11 +157,12 @@ class Gem::Ext::Builder
|
|
|
147
157
|
# have build arguments, saved, set +build_args+ which is an ARGV-style
|
|
148
158
|
# array.
|
|
149
159
|
|
|
150
|
-
def initialize(spec, build_args = spec.build_args, target_rbconfig = Gem.target_rbconfig)
|
|
160
|
+
def initialize(spec, build_args = spec.build_args, target_rbconfig = Gem.target_rbconfig, build_jobs = nil)
|
|
151
161
|
@spec = spec
|
|
152
162
|
@build_args = build_args
|
|
153
163
|
@gem_dir = spec.full_gem_path
|
|
154
164
|
@target_rbconfig = target_rbconfig
|
|
165
|
+
@build_jobs = build_jobs
|
|
155
166
|
|
|
156
167
|
@ran_rake = false
|
|
157
168
|
end
|
|
@@ -208,7 +219,7 @@ EOF
|
|
|
208
219
|
FileUtils.mkdir_p dest_path
|
|
209
220
|
|
|
210
221
|
results = builder.build(extension, dest_path,
|
|
211
|
-
results, @build_args, lib_dir, extension_dir, @target_rbconfig)
|
|
222
|
+
results, @build_args, lib_dir, extension_dir, @target_rbconfig, n_jobs: @build_jobs)
|
|
212
223
|
|
|
213
224
|
verbose { results.join("\n") }
|
|
214
225
|
|
|
@@ -15,7 +15,7 @@ class Gem::Ext::CargoBuilder < Gem::Ext::Builder
|
|
|
15
15
|
end
|
|
16
16
|
|
|
17
17
|
def build(extension, dest_path, results, args = [], lib_dir = nil, cargo_dir = Dir.pwd,
|
|
18
|
-
target_rbconfig = Gem.target_rbconfig)
|
|
18
|
+
target_rbconfig = Gem.target_rbconfig, n_jobs: nil)
|
|
19
19
|
require "tempfile"
|
|
20
20
|
require "fileutils"
|
|
21
21
|
|
|
@@ -37,7 +37,7 @@ class Gem::Ext::CmakeBuilder < Gem::Ext::Builder
|
|
|
37
37
|
end
|
|
38
38
|
|
|
39
39
|
def build(extension, dest_path, results, args = [], lib_dir = nil, cmake_dir = Dir.pwd,
|
|
40
|
-
target_rbconfig = Gem.target_rbconfig)
|
|
40
|
+
target_rbconfig = Gem.target_rbconfig, n_jobs: nil)
|
|
41
41
|
if target_rbconfig.path
|
|
42
42
|
warn "--target-rbconfig is not yet supported for CMake extensions. Ignoring"
|
|
43
43
|
end
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
class Gem::Ext::ConfigureBuilder < Gem::Ext::Builder
|
|
10
10
|
def self.build(extension, dest_path, results, args = [], lib_dir = nil, configure_dir = Dir.pwd,
|
|
11
|
-
target_rbconfig = Gem.target_rbconfig)
|
|
11
|
+
target_rbconfig = Gem.target_rbconfig, n_jobs: nil)
|
|
12
12
|
if target_rbconfig.path
|
|
13
13
|
warn "--target-rbconfig is not yet supported for configure-based extensions. Ignoring"
|
|
14
14
|
end
|
|
@@ -19,7 +19,7 @@ class Gem::Ext::ConfigureBuilder < Gem::Ext::Builder
|
|
|
19
19
|
run cmd, results, class_name, configure_dir
|
|
20
20
|
end
|
|
21
21
|
|
|
22
|
-
make dest_path, results, configure_dir, target_rbconfig: target_rbconfig
|
|
22
|
+
make dest_path, results, configure_dir, target_rbconfig: target_rbconfig, n_jobs: n_jobs
|
|
23
23
|
|
|
24
24
|
results
|
|
25
25
|
end
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
class Gem::Ext::ExtConfBuilder < Gem::Ext::Builder
|
|
10
10
|
def self.build(extension, dest_path, results, args = [], lib_dir = nil, extension_dir = Dir.pwd,
|
|
11
|
-
target_rbconfig = Gem.target_rbconfig)
|
|
11
|
+
target_rbconfig = Gem.target_rbconfig, n_jobs: nil)
|
|
12
12
|
require "fileutils"
|
|
13
13
|
require "tempfile"
|
|
14
14
|
|
|
@@ -40,11 +40,8 @@ class Gem::Ext::ExtConfBuilder < Gem::Ext::Builder
|
|
|
40
40
|
end
|
|
41
41
|
|
|
42
42
|
ENV["DESTDIR"] = nil
|
|
43
|
-
unless RUBY_PLATFORM.include?("mswin") && RbConfig::CONFIG["configure_args"]&.include?("nmake")
|
|
44
|
-
ENV["MAKEFLAGS"] ||= "-j#{Etc.nprocessors + 1}"
|
|
45
|
-
end
|
|
46
43
|
|
|
47
|
-
make dest_path, results, extension_dir, tmp_dest_relative, target_rbconfig: target_rbconfig
|
|
44
|
+
make dest_path, results, extension_dir, tmp_dest_relative, target_rbconfig: target_rbconfig, n_jobs: n_jobs
|
|
48
45
|
|
|
49
46
|
full_tmp_dest = File.join(extension_dir, tmp_dest_relative)
|
|
50
47
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
class Gem::Ext::RakeBuilder < Gem::Ext::Builder
|
|
10
10
|
def self.build(extension, dest_path, results, args = [], lib_dir = nil, extension_dir = Dir.pwd,
|
|
11
|
-
target_rbconfig = Gem.target_rbconfig)
|
|
11
|
+
target_rbconfig = Gem.target_rbconfig, n_jobs: nil)
|
|
12
12
|
if target_rbconfig.path
|
|
13
13
|
warn "--target-rbconfig is not yet supported for Rake extensions. Ignoring"
|
|
14
14
|
end
|
|
@@ -31,6 +31,15 @@ module Gem::InstallUpdateOptions
|
|
|
31
31
|
options[:bin_dir] = File.expand_path(value)
|
|
32
32
|
end
|
|
33
33
|
|
|
34
|
+
add_option(:"Install/Update", "-j", "--build-jobs VALUE", Integer,
|
|
35
|
+
"Specify the number of jobs to pass to `make` when installing",
|
|
36
|
+
"gems with native extensions.",
|
|
37
|
+
"Defaults to the number of processors.",
|
|
38
|
+
"This option is ignored on the mswin platform or",
|
|
39
|
+
"if the MAKEFLAGS environment variable is set.") do |value, options|
|
|
40
|
+
options[:build_jobs] = value
|
|
41
|
+
end
|
|
42
|
+
|
|
34
43
|
add_option(:"Install/Update", "--document [TYPES]", Array,
|
|
35
44
|
"Generate documentation for installed gems",
|
|
36
45
|
"List the documentation types you wish to",
|
data/lib/rubygems/installer.rb
CHANGED
|
@@ -635,6 +635,7 @@ class Gem::Installer
|
|
|
635
635
|
@build_root = options[:build_root]
|
|
636
636
|
|
|
637
637
|
@build_args = options[:build_args]
|
|
638
|
+
@build_jobs = options[:build_jobs]
|
|
638
639
|
|
|
639
640
|
@gem_home = @install_dir || user_install_dir || Gem.dir
|
|
640
641
|
|
|
@@ -803,7 +804,7 @@ class Gem::Installer
|
|
|
803
804
|
# configure scripts and rakefiles or mkrf_conf files.
|
|
804
805
|
|
|
805
806
|
def build_extensions
|
|
806
|
-
builder = Gem::Ext::Builder.new spec, build_args, Gem.target_rbconfig
|
|
807
|
+
builder = Gem::Ext::Builder.new spec, build_args, Gem.target_rbconfig, build_jobs
|
|
807
808
|
|
|
808
809
|
builder.build_extensions
|
|
809
810
|
end
|
|
@@ -941,6 +942,10 @@ class Gem::Installer
|
|
|
941
942
|
end
|
|
942
943
|
end
|
|
943
944
|
|
|
945
|
+
def build_jobs
|
|
946
|
+
@build_jobs ||= Etc.nprocessors + 1
|
|
947
|
+
end
|
|
948
|
+
|
|
944
949
|
def rb_config
|
|
945
950
|
Gem.target_rbconfig
|
|
946
951
|
end
|
|
@@ -82,6 +82,7 @@ class Gem::RemoteFetcher
|
|
|
82
82
|
@proxy = proxy
|
|
83
83
|
@pools = {}
|
|
84
84
|
@pool_lock = Thread::Mutex.new
|
|
85
|
+
@pool_size = 1
|
|
85
86
|
@cert_files = Gem::Request.get_cert_files
|
|
86
87
|
|
|
87
88
|
@headers = headers
|
|
@@ -338,7 +339,7 @@ class Gem::RemoteFetcher
|
|
|
338
339
|
|
|
339
340
|
def pools_for(proxy)
|
|
340
341
|
@pool_lock.synchronize do
|
|
341
|
-
@pools[proxy] ||= Gem::Request::ConnectionPools.new proxy, @cert_files
|
|
342
|
+
@pools[proxy] ||= Gem::Request::ConnectionPools.new proxy, @cert_files, @pool_size
|
|
342
343
|
end
|
|
343
344
|
end
|
|
344
345
|
end
|
|
@@ -7,11 +7,12 @@ class Gem::Request::ConnectionPools # :nodoc:
|
|
|
7
7
|
attr_accessor :client
|
|
8
8
|
end
|
|
9
9
|
|
|
10
|
-
def initialize(proxy_uri, cert_files)
|
|
10
|
+
def initialize(proxy_uri, cert_files, pool_size = 1)
|
|
11
11
|
@proxy_uri = proxy_uri
|
|
12
12
|
@cert_files = cert_files
|
|
13
13
|
@pools = {}
|
|
14
14
|
@pool_mutex = Thread::Mutex.new
|
|
15
|
+
@pool_size = pool_size
|
|
15
16
|
end
|
|
16
17
|
|
|
17
18
|
def pool_for(uri)
|
|
@@ -20,9 +21,9 @@ class Gem::Request::ConnectionPools # :nodoc:
|
|
|
20
21
|
@pool_mutex.synchronize do
|
|
21
22
|
@pools[key] ||=
|
|
22
23
|
if https? uri
|
|
23
|
-
Gem::Request::HTTPSPool.new(http_args, @cert_files, @proxy_uri)
|
|
24
|
+
Gem::Request::HTTPSPool.new(http_args, @cert_files, @proxy_uri, @pool_size)
|
|
24
25
|
else
|
|
25
|
-
Gem::Request::HTTPPool.new(http_args, @cert_files, @proxy_uri)
|
|
26
|
+
Gem::Request::HTTPPool.new(http_args, @cert_files, @proxy_uri, @pool_size)
|
|
26
27
|
end
|
|
27
28
|
end
|
|
28
29
|
end
|
|
@@ -9,12 +9,14 @@
|
|
|
9
9
|
class Gem::Request::HTTPPool # :nodoc:
|
|
10
10
|
attr_reader :cert_files, :proxy_uri
|
|
11
11
|
|
|
12
|
-
def initialize(http_args, cert_files, proxy_uri)
|
|
12
|
+
def initialize(http_args, cert_files, proxy_uri, pool_size)
|
|
13
13
|
@http_args = http_args
|
|
14
14
|
@cert_files = cert_files
|
|
15
15
|
@proxy_uri = proxy_uri
|
|
16
|
-
@
|
|
17
|
-
|
|
16
|
+
@pool_size = pool_size
|
|
17
|
+
|
|
18
|
+
@queue = Thread::SizedQueue.new @pool_size
|
|
19
|
+
setup_queue
|
|
18
20
|
end
|
|
19
21
|
|
|
20
22
|
def checkout
|
|
@@ -31,7 +33,8 @@ class Gem::Request::HTTPPool # :nodoc:
|
|
|
31
33
|
connection.finish
|
|
32
34
|
end
|
|
33
35
|
end
|
|
34
|
-
|
|
36
|
+
|
|
37
|
+
setup_queue
|
|
35
38
|
end
|
|
36
39
|
|
|
37
40
|
private
|
|
@@ -44,4 +47,8 @@ class Gem::Request::HTTPPool # :nodoc:
|
|
|
44
47
|
connection.start
|
|
45
48
|
connection
|
|
46
49
|
end
|
|
50
|
+
|
|
51
|
+
def setup_queue
|
|
52
|
+
@pool_size.times { @queue.push(nil) }
|
|
53
|
+
end
|
|
47
54
|
end
|
data/lib/rubygems.rb
CHANGED