bundler 2.2.24 → 2.2.26
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of bundler might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +40 -0
- data/lib/bundler.rb +0 -4
- data/lib/bundler/build_metadata.rb +2 -2
- data/lib/bundler/cli.rb +11 -9
- data/lib/bundler/cli/cache.rb +1 -1
- data/lib/bundler/cli/check.rb +1 -1
- data/lib/bundler/cli/doctor.rb +1 -1
- data/lib/bundler/cli/exec.rb +1 -6
- data/lib/bundler/cli/gem.rb +3 -2
- data/lib/bundler/cli/install.rb +4 -17
- data/lib/bundler/cli/list.rb +7 -1
- data/lib/bundler/cli/open.rb +1 -2
- data/lib/bundler/cli/update.rb +1 -1
- data/lib/bundler/definition.rb +25 -35
- data/lib/bundler/dsl.rb +14 -1
- data/lib/bundler/errors.rb +1 -1
- data/lib/bundler/installer/gem_installer.rb +3 -16
- data/lib/bundler/installer/standalone.rb +13 -8
- data/lib/bundler/lockfile_parser.rb +1 -0
- data/lib/bundler/resolver.rb +10 -17
- data/lib/bundler/rubygems_gem_installer.rb +5 -1
- data/lib/bundler/runtime.rb +15 -6
- data/lib/bundler/settings.rb +4 -0
- data/lib/bundler/setup.rb +2 -2
- data/lib/bundler/shared_helpers.rb +0 -7
- data/lib/bundler/source.rb +4 -2
- data/lib/bundler/source/git/git_proxy.rb +1 -2
- data/lib/bundler/source/rubygems.rb +21 -7
- data/lib/bundler/source/rubygems_aggregate.rb +4 -0
- data/lib/bundler/source_list.rb +16 -7
- data/lib/bundler/spec_set.rb +12 -34
- data/lib/bundler/templates/Executable.bundler +6 -6
- data/lib/bundler/templates/newgem/github/workflows/main.yml.tt +12 -2
- data/lib/bundler/templates/newgem/newgem.gemspec.tt +3 -1
- data/lib/bundler/version.rb +1 -1
- data/lib/bundler/worker.rb +17 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0f6b49cdd4d65c0b945ba09e5a1f49de540a778e19e0157ed2a376a6daf9511c
|
4
|
+
data.tar.gz: 52ade727aa83b8390bb5eeaceda718c1d194d00251ea535013c9da8e58b79094
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2e9f6084d7c8059af49ed11ccc1b0748babe41d40d6a363b7dad9091762c979091ad5388cc913545eb2853867ebe9ee7088c3ffb331e667eb57d04345799ab87
|
7
|
+
data.tar.gz: dab0d503f64a592ec7dcc8e91ff509f149cc65e20b83db73857ea3e750f10bec57301042db96639f3d77707db78fea0a1f29338a4a3c5721dad3b8db906fd71b
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,43 @@
|
|
1
|
+
# 2.2.26 (August 17, 2021)
|
2
|
+
|
3
|
+
## Enhancements:
|
4
|
+
|
5
|
+
- Remove `RUBYGEMS_GEMDEPS` warning [#4827](https://github.com/rubygems/rubygems/pull/4827)
|
6
|
+
- Better defaults for GitHub Actions template generated by `bundle gem` [#4619](https://github.com/rubygems/rubygems/pull/4619)
|
7
|
+
- Make `bundle exec` keep file descriptors by default [#4812](https://github.com/rubygems/rubygems/pull/4812)
|
8
|
+
- Exclude gemspec file itself from file list of gems generated by `bundle gem` [#4650](https://github.com/rubygems/rubygems/pull/4650)
|
9
|
+
- Fix a couple small typos in deprecation / error messages [#4806](https://github.com/rubygems/rubygems/pull/4806)
|
10
|
+
- Make script generated by `bundle install --standalone` resilient to moving the application to a differently nested folder when `path` sources are used [#4792](https://github.com/rubygems/rubygems/pull/4792)
|
11
|
+
- Exclude CI files and issue templates from file list of gems generated by `bundle gem` [#4033](https://github.com/rubygems/rubygems/pull/4033)
|
12
|
+
|
13
|
+
## Bug fixes:
|
14
|
+
|
15
|
+
- Respect `BUNDLE_USER_HOME` env when choosing config location [#4828](https://github.com/rubygems/rubygems/pull/4828)
|
16
|
+
- Fix `bundle gem` on path with spaces [#4816](https://github.com/rubygems/rubygems/pull/4816)
|
17
|
+
- Fix bundler hitting the network in some cases where not allowed [#4805](https://github.com/rubygems/rubygems/pull/4805)
|
18
|
+
|
19
|
+
# 2.2.25 (July 30, 2021)
|
20
|
+
|
21
|
+
## Deprecations:
|
22
|
+
|
23
|
+
- Deprecate Gemfile without an explicit global source [#4779](https://github.com/rubygems/rubygems/pull/4779)
|
24
|
+
- Deprecate `bundle cache --path` [#4496](https://github.com/rubygems/rubygems/pull/4496)
|
25
|
+
|
26
|
+
## Enhancements:
|
27
|
+
|
28
|
+
- Give better errors when materialization fails [#4788](https://github.com/rubygems/rubygems/pull/4788)
|
29
|
+
- Lazily load `shellwords` library [#4786](https://github.com/rubygems/rubygems/pull/4786)
|
30
|
+
- Show original error and backtrace directly on `bundle install` errors instead of a more brittle `gem install` hint [#4778](https://github.com/rubygems/rubygems/pull/4778)
|
31
|
+
- Remove LoadError message in regards to requiring a relative file [#4772](https://github.com/rubygems/rubygems/pull/4772)
|
32
|
+
|
33
|
+
## Bug fixes:
|
34
|
+
|
35
|
+
- Fix `BUNDLE_USER_CONFIG` no longer respected as config location [#4797](https://github.com/rubygems/rubygems/pull/4797)
|
36
|
+
- Fix `--standalone` installation of default gems [#4782](https://github.com/rubygems/rubygems/pull/4782)
|
37
|
+
- Fix `--quiet` flag not printing warnings [#4781](https://github.com/rubygems/rubygems/pull/4781)
|
38
|
+
- Fix bundler binstub version selection [#4775](https://github.com/rubygems/rubygems/pull/4775)
|
39
|
+
- Fix interrupt handling in Bundler workers [#4767](https://github.com/rubygems/rubygems/pull/4767)
|
40
|
+
|
1
41
|
# 2.2.24 (July 15, 2021)
|
2
42
|
|
3
43
|
## Bug fixes:
|
data/lib/bundler.rb
CHANGED
@@ -653,10 +653,6 @@ EOF
|
|
653
653
|
rescue ScriptError, StandardError => e
|
654
654
|
msg = "There was an error while loading `#{path.basename}`: #{e.message}"
|
655
655
|
|
656
|
-
if e.is_a?(LoadError)
|
657
|
-
msg += "\nDoes it try to require a relative path? That's been removed in Ruby 1.9"
|
658
|
-
end
|
659
|
-
|
660
656
|
raise GemspecError, Dsl::DSLError.new(msg, path, e.backtrace, contents)
|
661
657
|
end
|
662
658
|
|
@@ -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 = "2021-
|
8
|
-
@git_commit_sha = "
|
7
|
+
@built_at = "2021-08-17".freeze
|
8
|
+
@git_commit_sha = "21fd333002".freeze
|
9
9
|
@release = true
|
10
10
|
# end ivars
|
11
11
|
|
data/lib/bundler/cli.rb
CHANGED
@@ -73,14 +73,6 @@ module Bundler
|
|
73
73
|
Bundler.ui = UI::Shell.new(options)
|
74
74
|
Bundler.ui.level = "debug" if options["verbose"]
|
75
75
|
unprinted_warnings.each {|w| Bundler.ui.warn(w) }
|
76
|
-
|
77
|
-
if ENV["RUBYGEMS_GEMDEPS"] && !ENV["RUBYGEMS_GEMDEPS"].empty?
|
78
|
-
Bundler.ui.warn(
|
79
|
-
"The RUBYGEMS_GEMDEPS environment variable is set. This enables RubyGems' " \
|
80
|
-
"experimental Gemfile mode, which may conflict with Bundler and cause unexpected errors. " \
|
81
|
-
"To remove this warning, unset RUBYGEMS_GEMDEPS.", :wrap => true
|
82
|
-
)
|
83
|
-
end
|
84
76
|
end
|
85
77
|
|
86
78
|
check_unknown_options!(:except => [:config, :exec])
|
@@ -456,6 +448,12 @@ module Bundler
|
|
456
448
|
"do in future versions. Instead please use `bundle config set cache_all true`, " \
|
457
449
|
"and stop using this flag" if ARGV.include?("--all")
|
458
450
|
|
451
|
+
SharedHelpers.major_deprecation 2,
|
452
|
+
"The `--path` flag is deprecated because its semantics are unclear. " \
|
453
|
+
"Use `bundle config cache_path` to configure the path of your cache of gems, " \
|
454
|
+
"and `bundle config path` to configure the path where your gems are installed, " \
|
455
|
+
"and stop using this flag" if ARGV.include?("--path")
|
456
|
+
|
459
457
|
require_relative "cli/cache"
|
460
458
|
Cache.new(options).run
|
461
459
|
end
|
@@ -463,7 +461,7 @@ module Bundler
|
|
463
461
|
map aliases_for("cache")
|
464
462
|
|
465
463
|
desc "exec [OPTIONS]", "Run the command in context of the bundle"
|
466
|
-
method_option :keep_file_descriptors, :type => :boolean, :default =>
|
464
|
+
method_option :keep_file_descriptors, :type => :boolean, :default => true
|
467
465
|
method_option :gemfile, :type => :string, :required => false
|
468
466
|
long_desc <<-D
|
469
467
|
Exec runs a command, providing it access to the gems in the bundle. While using
|
@@ -471,6 +469,10 @@ module Bundler
|
|
471
469
|
into the system wide RubyGems repository.
|
472
470
|
D
|
473
471
|
def exec(*args)
|
472
|
+
if ARGV.include?("--no-keep-file-descriptors")
|
473
|
+
SharedHelpers.major_deprecation(2, "The `--no-keep-file-descriptors` has been deprecated. `bundle exec` no longer mess with your file descriptors. Close them in the exec'd script if you need to")
|
474
|
+
end
|
475
|
+
|
474
476
|
require_relative "cli/exec"
|
475
477
|
Exec.new(options, args).run
|
476
478
|
end
|
data/lib/bundler/cli/cache.rb
CHANGED
@@ -9,7 +9,7 @@ module Bundler
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def run
|
12
|
-
Bundler.ui.level = "
|
12
|
+
Bundler.ui.level = "warn" if options[:quiet]
|
13
13
|
Bundler.settings.set_command_option_if_given :path, options[:path]
|
14
14
|
Bundler.settings.set_command_option_if_given :cache_path, options["cache-path"]
|
15
15
|
|
data/lib/bundler/cli/check.rb
CHANGED
@@ -15,7 +15,7 @@ module Bundler
|
|
15
15
|
definition.validate_runtime!
|
16
16
|
|
17
17
|
begin
|
18
|
-
definition.
|
18
|
+
definition.resolve_with_cache!
|
19
19
|
not_installed = definition.missing_specs
|
20
20
|
rescue GemNotFound, VersionConflict
|
21
21
|
Bundler.ui.error "Bundler can't satisfy your Gemfile's dependencies."
|
data/lib/bundler/cli/doctor.rb
CHANGED
data/lib/bundler/cli/exec.rb
CHANGED
@@ -12,12 +12,7 @@ module Bundler
|
|
12
12
|
@options = options
|
13
13
|
@cmd = args.shift
|
14
14
|
@args = args
|
15
|
-
|
16
|
-
if !Bundler.current_ruby.jruby?
|
17
|
-
@args << { :close_others => !options.keep_file_descriptors? }
|
18
|
-
elsif options.keep_file_descriptors?
|
19
|
-
Bundler.ui.warn "Ruby version #{RUBY_VERSION} defaults to keeping non-standard file descriptors on Kernel#exec."
|
20
|
-
end
|
15
|
+
@args << { :close_others => !options.keep_file_descriptors? } unless Bundler.current_ruby.jruby?
|
21
16
|
end
|
22
17
|
|
23
18
|
def run
|
data/lib/bundler/cli/gem.rb
CHANGED
@@ -184,14 +184,15 @@ module Bundler
|
|
184
184
|
)
|
185
185
|
end
|
186
186
|
|
187
|
-
if
|
187
|
+
if target.exist? && !target.directory?
|
188
188
|
Bundler.ui.error "Couldn't create a new gem named `#{gem_name}` because there's an existing file named `#{gem_name}`."
|
189
189
|
exit Bundler::BundlerError.all_errors[Bundler::GenericSystemCallError]
|
190
190
|
end
|
191
191
|
|
192
192
|
if use_git
|
193
193
|
Bundler.ui.info "Initializing git repo in #{target}"
|
194
|
-
|
194
|
+
require "shellwords"
|
195
|
+
`git init #{target.to_s.shellescape}`
|
195
196
|
|
196
197
|
config[:git_default_branch] = File.read("#{target}/.git/HEAD").split("/").last.chomp
|
197
198
|
end
|
data/lib/bundler/cli/install.rb
CHANGED
@@ -8,7 +8,7 @@ module Bundler
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def run
|
11
|
-
Bundler.ui.level = "
|
11
|
+
Bundler.ui.level = "warn" if options[:quiet]
|
12
12
|
|
13
13
|
warn_if_root
|
14
14
|
|
@@ -60,7 +60,7 @@ module Bundler
|
|
60
60
|
installer = Installer.install(Bundler.root, definition, options)
|
61
61
|
|
62
62
|
Bundler.settings.temporary(:cache_all_platforms => options[:local] ? false : Bundler.settings[:cache_all_platforms]) do
|
63
|
-
Bundler.load.cache if Bundler.app_cache.exist? && !options["no-cache"] && !Bundler.frozen_bundle?
|
63
|
+
Bundler.load.cache(nil, options[:local]) if Bundler.app_cache.exist? && !options["no-cache"] && !Bundler.frozen_bundle?
|
64
64
|
end
|
65
65
|
|
66
66
|
Bundler.ui.confirm "Bundle complete! #{dependencies_count_for(definition)}, #{gems_installed_for(definition)}."
|
@@ -83,22 +83,9 @@ module Bundler
|
|
83
83
|
end
|
84
84
|
|
85
85
|
Bundler::CLI::Common.output_fund_metadata_summary
|
86
|
-
rescue
|
87
|
-
if options[:local] && Bundler.app_cache.exist?
|
88
|
-
Bundler.ui.warn "Some gems seem to be missing from your #{Bundler.settings.app_cache_path} directory."
|
89
|
-
end
|
90
|
-
|
91
|
-
unless Bundler.definition.has_rubygems_remotes?
|
92
|
-
Bundler.ui.warn <<-WARN, :wrap => true
|
93
|
-
Your Gemfile has no gem server sources. If you need gems that are \
|
94
|
-
not already on your machine, add a line like this to your Gemfile:
|
95
|
-
source 'https://rubygems.org'
|
96
|
-
WARN
|
97
|
-
end
|
98
|
-
raise e
|
99
|
-
rescue Gem::InvalidSpecificationException => e
|
86
|
+
rescue Gem::InvalidSpecificationException
|
100
87
|
Bundler.ui.warn "You have one or more invalid gemspecs that need to be fixed."
|
101
|
-
raise
|
88
|
+
raise
|
102
89
|
end
|
103
90
|
|
104
91
|
private
|
data/lib/bundler/cli/list.rb
CHANGED
@@ -16,7 +16,13 @@ module Bundler
|
|
16
16
|
specs = if @only_group.any? || @without_group.any?
|
17
17
|
filtered_specs_by_groups
|
18
18
|
else
|
19
|
-
|
19
|
+
begin
|
20
|
+
Bundler.load.specs
|
21
|
+
rescue GemNotFound => e
|
22
|
+
Bundler.ui.error e.message
|
23
|
+
Bundler.ui.warn "Install missing gems with `bundle install`."
|
24
|
+
exit 1
|
25
|
+
end
|
20
26
|
end.reject {|s| s.name == "bundler" }.sort_by(&:name)
|
21
27
|
|
22
28
|
return Bundler.ui.info "No gems in the Gemfile" if specs.empty?
|
data/lib/bundler/cli/open.rb
CHANGED
@@ -1,7 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "shellwords"
|
4
|
-
|
5
3
|
module Bundler
|
6
4
|
class CLI::Open
|
7
5
|
attr_reader :options, :name
|
@@ -19,6 +17,7 @@ module Bundler
|
|
19
17
|
else
|
20
18
|
path = spec.full_gem_path
|
21
19
|
Dir.chdir(path) do
|
20
|
+
require "shellwords"
|
22
21
|
command = Shellwords.split(editor) + [path]
|
23
22
|
Bundler.with_original_env do
|
24
23
|
system(*command)
|
data/lib/bundler/cli/update.rb
CHANGED
data/lib/bundler/definition.rb
CHANGED
@@ -133,7 +133,7 @@ module Bundler
|
|
133
133
|
@unlock[:gems] ||= @dependencies.map(&:name)
|
134
134
|
else
|
135
135
|
eager_unlock = expand_dependencies(@unlock[:gems] || [], true)
|
136
|
-
@unlock[:gems] = @locked_specs.for(eager_unlock, false, false
|
136
|
+
@unlock[:gems] = @locked_specs.for(eager_unlock, false, false).map(&:name)
|
137
137
|
end
|
138
138
|
|
139
139
|
@dependency_changes = converge_dependencies
|
@@ -161,12 +161,6 @@ module Bundler
|
|
161
161
|
@multisource_allowed
|
162
162
|
end
|
163
163
|
|
164
|
-
def resolve_only_locally!
|
165
|
-
@remote = false
|
166
|
-
sources.local_only!
|
167
|
-
resolve
|
168
|
-
end
|
169
|
-
|
170
164
|
def resolve_with_cache!
|
171
165
|
sources.cached!
|
172
166
|
resolve
|
@@ -185,15 +179,7 @@ module Bundler
|
|
185
179
|
#
|
186
180
|
# @return [Bundler::SpecSet]
|
187
181
|
def specs
|
188
|
-
@specs ||=
|
189
|
-
rescue GemNotFound => e # Handle yanked gem
|
190
|
-
gem_name, gem_version = extract_gem_info(e)
|
191
|
-
locked_gem = @locked_specs[gem_name].last
|
192
|
-
raise if locked_gem.nil? || locked_gem.version.to_s != gem_version || !@remote
|
193
|
-
raise GemNotFound, "Your bundle is locked to #{locked_gem} from #{locked_gem.source}, but that version can " \
|
194
|
-
"no longer be found in that source. That means the author of #{locked_gem} has removed it. " \
|
195
|
-
"You'll need to update your bundle to a version other than #{locked_gem} that hasn't been " \
|
196
|
-
"removed in order to install."
|
182
|
+
@specs ||= materialize(requested_dependencies)
|
197
183
|
end
|
198
184
|
|
199
185
|
def new_specs
|
@@ -205,9 +191,7 @@ module Bundler
|
|
205
191
|
end
|
206
192
|
|
207
193
|
def missing_specs
|
208
|
-
|
209
|
-
resolve.materialize(requested_dependencies, missing)
|
210
|
-
missing
|
194
|
+
resolve.materialize(requested_dependencies).missing_specs
|
211
195
|
end
|
212
196
|
|
213
197
|
def missing_specs?
|
@@ -241,7 +225,7 @@ module Bundler
|
|
241
225
|
def specs_for(groups)
|
242
226
|
groups = requested_groups if groups.empty?
|
243
227
|
deps = dependencies_for(groups)
|
244
|
-
|
228
|
+
materialize(expand_dependencies(deps))
|
245
229
|
end
|
246
230
|
|
247
231
|
def dependencies_for(groups)
|
@@ -274,10 +258,6 @@ module Bundler
|
|
274
258
|
end
|
275
259
|
end
|
276
260
|
|
277
|
-
def has_rubygems_remotes?
|
278
|
-
sources.rubygems_sources.any? {|s| s.remotes.any? }
|
279
|
-
end
|
280
|
-
|
281
261
|
def spec_git_paths
|
282
262
|
sources.git_sources.map {|s| File.realpath(s.path) if File.exist?(s.path) }.compact
|
283
263
|
end
|
@@ -493,7 +473,23 @@ module Bundler
|
|
493
473
|
|
494
474
|
private
|
495
475
|
|
496
|
-
def
|
476
|
+
def materialize(dependencies)
|
477
|
+
specs = resolve.materialize(dependencies)
|
478
|
+
missing_specs = specs.missing_specs
|
479
|
+
|
480
|
+
if missing_specs.any?
|
481
|
+
missing_specs.each do |s|
|
482
|
+
locked_gem = @locked_specs[s.name].last
|
483
|
+
next if locked_gem.nil? || locked_gem.version != s.version || !@remote
|
484
|
+
raise GemNotFound, "Your bundle is locked to #{locked_gem} from #{locked_gem.source}, but that version can " \
|
485
|
+
"no longer be found in that source. That means the author of #{locked_gem} has removed it. " \
|
486
|
+
"You'll need to update your bundle to a version other than #{locked_gem} that hasn't been " \
|
487
|
+
"removed in order to install."
|
488
|
+
end
|
489
|
+
|
490
|
+
raise GemNotFound, "Could not find #{missing_specs.map(&:full_name).join(", ")} in any of the sources"
|
491
|
+
end
|
492
|
+
|
497
493
|
unless specs["bundler"].any?
|
498
494
|
bundler = sources.metadata_source.specs.search(Gem::Dependency.new("bundler", VERSION)).last
|
499
495
|
specs["bundler"] = bundler
|
@@ -503,7 +499,7 @@ module Bundler
|
|
503
499
|
end
|
504
500
|
|
505
501
|
def precompute_source_requirements_for_indirect_dependencies?
|
506
|
-
sources.non_global_rubygems_sources.all?(&:dependency_api_available?) && !sources.aggregate_global_source?
|
502
|
+
@remote && sources.non_global_rubygems_sources.all?(&:dependency_api_available?) && !sources.aggregate_global_source?
|
507
503
|
end
|
508
504
|
|
509
505
|
def current_ruby_platform_locked?
|
@@ -712,7 +708,7 @@ module Bundler
|
|
712
708
|
@locked_specs.each do |s|
|
713
709
|
# Replace the locked dependency's source with the equivalent source from the Gemfile
|
714
710
|
dep = @dependencies.find {|d| s.satisfies?(d) }
|
715
|
-
s.source = (dep && dep.source) || sources.get(s.source)
|
711
|
+
s.source = (dep && dep.source) || sources.get(s.source) unless multisource_allowed?
|
716
712
|
|
717
713
|
# Don't add a spec to the list if its source is expired. For example,
|
718
714
|
# if you change a Git gem to RubyGems.
|
@@ -730,7 +726,7 @@ module Bundler
|
|
730
726
|
# if we won't need the source (according to the lockfile),
|
731
727
|
# don't error if the path/git source isn't available
|
732
728
|
next if @locked_specs.
|
733
|
-
for(requested_dependencies, false, true
|
729
|
+
for(requested_dependencies, false, true).
|
734
730
|
none? {|locked_spec| locked_spec.source == s.source }
|
735
731
|
|
736
732
|
raise
|
@@ -750,7 +746,7 @@ module Bundler
|
|
750
746
|
|
751
747
|
resolve = SpecSet.new(converged)
|
752
748
|
@locked_specs_incomplete_for_platform = !resolve.for(expand_dependencies(requested_dependencies & deps), true, true)
|
753
|
-
resolve = SpecSet.new(resolve.for(expand_dependencies(deps, true), false, false
|
749
|
+
resolve = SpecSet.new(resolve.for(expand_dependencies(deps, true), false, false).reject{|s| @unlock[:gems].include?(s.name) })
|
754
750
|
diff = nil
|
755
751
|
|
756
752
|
# Now, we unlock any sources that do not have anymore gems pinned to it
|
@@ -854,12 +850,6 @@ module Bundler
|
|
854
850
|
current == proposed
|
855
851
|
end
|
856
852
|
|
857
|
-
def extract_gem_info(error)
|
858
|
-
# This method will extract the error message like "Could not find foo-1.2.3 in any of the sources"
|
859
|
-
# to an array. The first element will be the gem name (e.g. foo), the second will be the version number.
|
860
|
-
error.message.scan(/Could not find (\w+)-(\d+(?:\.\d+)+)/).flatten
|
861
|
-
end
|
862
|
-
|
863
853
|
def compute_requires
|
864
854
|
dependencies.reduce({}) do |requires, dep|
|
865
855
|
next requires unless dep.should_include?
|
data/lib/bundler/dsl.rb
CHANGED
@@ -447,8 +447,21 @@ repo_name ||= user_name
|
|
447
447
|
end
|
448
448
|
|
449
449
|
def check_rubygems_source_safety
|
450
|
-
|
450
|
+
if @sources.implicit_global_source?
|
451
|
+
implicit_global_source_warning
|
452
|
+
elsif @sources.aggregate_global_source?
|
453
|
+
multiple_global_source_warning
|
454
|
+
end
|
455
|
+
end
|
456
|
+
|
457
|
+
def implicit_global_source_warning
|
458
|
+
Bundler::SharedHelpers.major_deprecation 2, "This Gemfile does not include an explicit global source. " \
|
459
|
+
"Not using an explicit global source may result in a different lockfile being generated depending on " \
|
460
|
+
"the gems you have installed locally before bundler is run. " \
|
461
|
+
"Instead, define a global source in your Gemfile like this: source \"https://rubygems.org\"."
|
462
|
+
end
|
451
463
|
|
464
|
+
def multiple_global_source_warning
|
452
465
|
if Bundler.feature_flag.bundler_3_mode?
|
453
466
|
msg = "This Gemfile contains multiple primary sources. " \
|
454
467
|
"Each source after the first must include a block to indicate which gems " \
|
data/lib/bundler/errors.rb
CHANGED
@@ -122,7 +122,7 @@ module Bundler
|
|
122
122
|
|
123
123
|
class VirtualProtocolError < BundlerError
|
124
124
|
def message
|
125
|
-
"There was an error relating to virtualization and file access." \
|
125
|
+
"There was an error relating to virtualization and file access. " \
|
126
126
|
"It is likely that you need to grant access to or mount some file system correctly."
|
127
127
|
end
|
128
128
|
|
@@ -1,7 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "shellwords"
|
4
|
-
|
5
3
|
module Bundler
|
6
4
|
class GemInstaller
|
7
5
|
attr_reader :spec, :standalone, :worker, :force, :installer
|
@@ -31,34 +29,23 @@ module Bundler
|
|
31
29
|
|
32
30
|
def specific_failure_message(e)
|
33
31
|
message = "#{e.class}: #{e.message}\n"
|
34
|
-
message += " " + e.backtrace.join("\n ") + "\n\n"
|
32
|
+
message += " " + e.backtrace.join("\n ") + "\n\n"
|
35
33
|
message = message.lines.first + Bundler.ui.add_color(message.lines.drop(1).join, :clear)
|
36
34
|
message + Bundler.ui.add_color(failure_message, :red)
|
37
35
|
end
|
38
36
|
|
39
37
|
def failure_message
|
40
|
-
|
41
|
-
"#{install_error_message}\n#{gem_install_message}"
|
38
|
+
install_error_message
|
42
39
|
end
|
43
40
|
|
44
41
|
def install_error_message
|
45
42
|
"An error occurred while installing #{spec.name} (#{spec.version}), and Bundler cannot continue."
|
46
43
|
end
|
47
44
|
|
48
|
-
def gem_install_message
|
49
|
-
source = spec.source
|
50
|
-
return unless source.respond_to?(:remotes)
|
51
|
-
|
52
|
-
if source.remotes.size == 1
|
53
|
-
"Make sure that `gem install #{spec.name} -v '#{spec.version}' --source '#{source.remotes.first}'` succeeds before bundling."
|
54
|
-
else
|
55
|
-
"Make sure that `gem install #{spec.name} -v '#{spec.version}'` succeeds before bundling."
|
56
|
-
end
|
57
|
-
end
|
58
|
-
|
59
45
|
def spec_settings
|
60
46
|
# Fetch the build settings, if there are any
|
61
47
|
if settings = Bundler.settings["build.#{spec.name}"]
|
48
|
+
require "shellwords"
|
62
49
|
Shellwords.shellsplit(settings)
|
63
50
|
end
|
64
51
|
end
|
@@ -12,12 +12,13 @@ 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 "ruby_engine = RUBY_ENGINE"
|
16
|
-
file.puts "ruby_version = RbConfig::CONFIG[\"ruby_version\"]"
|
17
|
-
file.puts "path = File.expand_path('..', __FILE__)"
|
18
15
|
file.puts reverse_rubygems_kernel_mixin
|
19
16
|
paths.each do |path|
|
20
|
-
|
17
|
+
if Pathname.new(path).absolute?
|
18
|
+
file.puts %($:.unshift "#{path}")
|
19
|
+
else
|
20
|
+
file.puts %($:.unshift File.expand_path("\#{__dir__}/#{path}"))
|
21
|
+
end
|
21
22
|
end
|
22
23
|
end
|
23
24
|
end
|
@@ -28,14 +29,14 @@ module Bundler
|
|
28
29
|
@specs.map do |spec|
|
29
30
|
next if spec.name == "bundler"
|
30
31
|
Array(spec.require_paths).map do |path|
|
31
|
-
gem_path(path, spec).sub(version_dir, '#{
|
32
|
+
gem_path(path, spec).sub(version_dir, '#{RUBY_ENGINE}/#{RbConfig::CONFIG["ruby_version"]}')
|
32
33
|
# This is a static string intentionally. It's interpolated at a later time.
|
33
34
|
end
|
34
|
-
end.flatten
|
35
|
+
end.flatten.compact
|
35
36
|
end
|
36
37
|
|
37
38
|
def version_dir
|
38
|
-
"#{
|
39
|
+
"#{RUBY_ENGINE}/#{RbConfig::CONFIG["ruby_version"]}"
|
39
40
|
end
|
40
41
|
|
41
42
|
def bundler_path
|
@@ -44,7 +45,11 @@ module Bundler
|
|
44
45
|
|
45
46
|
def gem_path(path, spec)
|
46
47
|
full_path = Pathname.new(path).absolute? ? path : File.join(spec.full_gem_path, path)
|
47
|
-
|
48
|
+
if spec.source.instance_of?(Source::Path)
|
49
|
+
full_path
|
50
|
+
else
|
51
|
+
Pathname.new(full_path).relative_path_from(Bundler.root.join(bundler_path)).to_s
|
52
|
+
end
|
48
53
|
rescue TypeError
|
49
54
|
error_message = "#{spec.name} #{spec.version} has an invalid gemspec"
|
50
55
|
raise Gem::InvalidSpecificationException.new(error_message)
|
@@ -195,6 +195,7 @@ module Bundler
|
|
195
195
|
platform = platform ? Gem::Platform.new(platform) : Gem::Platform::RUBY
|
196
196
|
@current_spec = LazySpecification.new(name, version, platform)
|
197
197
|
@current_spec.source = @current_source
|
198
|
+
@current_source.add_dependency_names(name)
|
198
199
|
|
199
200
|
@specs[@current_spec.identifier] = @current_spec
|
200
201
|
elsif spaces.size == 6
|
data/lib/bundler/resolver.rb
CHANGED
@@ -255,12 +255,6 @@ module Bundler
|
|
255
255
|
next if name == "bundler"
|
256
256
|
next unless search_for(requirement).empty?
|
257
257
|
|
258
|
-
cache_message = begin
|
259
|
-
" or in gems cached in #{Bundler.settings.app_cache_path}" if Bundler.app_cache.exist?
|
260
|
-
rescue GemfileNotFound
|
261
|
-
nil
|
262
|
-
end
|
263
|
-
|
264
258
|
if (base = @base[name]) && !base.empty?
|
265
259
|
version = base.first.version
|
266
260
|
message = "You have requested:\n" \
|
@@ -269,18 +263,17 @@ module Bundler
|
|
269
263
|
"Try running `bundle update #{name}`\n\n" \
|
270
264
|
"If you are updating multiple gems in your Gemfile at once,\n" \
|
271
265
|
"try passing them all to `bundle update`"
|
272
|
-
|
266
|
+
else
|
267
|
+
source = source_for(name)
|
273
268
|
specs = source.specs.search(name)
|
274
269
|
versions_with_platforms = specs.map {|s| [s.version, s.platform] }
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
message = "Could not find gem '#{SharedHelpers.pretty_dependency(requirement)}' in any of the gem sources " \
|
283
|
-
"listed in your Gemfile#{cache_message}."
|
270
|
+
cache_message = begin
|
271
|
+
" or in gems cached in #{Bundler.settings.app_cache_path}" if Bundler.app_cache.exist?
|
272
|
+
rescue GemfileNotFound
|
273
|
+
nil
|
274
|
+
end
|
275
|
+
message = String.new("Could not find gem '#{SharedHelpers.pretty_dependency(requirement)}' in #{source.to_err}#{cache_message}.\n")
|
276
|
+
message << "The source contains the following versions of '#{name}': #{formatted_versions_with_platforms(versions_with_platforms)}" if versions_with_platforms.any?
|
284
277
|
end
|
285
278
|
raise GemNotFound, message
|
286
279
|
end
|
@@ -378,7 +371,7 @@ module Bundler
|
|
378
371
|
o << if metadata_requirement
|
379
372
|
"is not available in #{relevant_source}"
|
380
373
|
else
|
381
|
-
"in #{relevant_source}.\n"
|
374
|
+
"in #{relevant_source.to_err}.\n"
|
382
375
|
end
|
383
376
|
end
|
384
377
|
end,
|
@@ -61,7 +61,10 @@ module Bundler
|
|
61
61
|
|
62
62
|
def build_extensions
|
63
63
|
extension_cache_path = options[:bundler_extension_cache_path]
|
64
|
-
|
64
|
+
unless extension_cache_path && extension_dir = spec.extension_dir
|
65
|
+
require "shellwords" # compensate missing require in rubygems before version 3.2.25
|
66
|
+
return super
|
67
|
+
end
|
65
68
|
|
66
69
|
extension_dir = Pathname.new(extension_dir)
|
67
70
|
build_complete = SharedHelpers.filesystem_access(extension_cache_path.join("gem.build_complete"), :read, &:file?)
|
@@ -71,6 +74,7 @@ module Bundler
|
|
71
74
|
FileUtils.cp_r extension_cache_path, spec.extension_dir
|
72
75
|
end
|
73
76
|
else
|
77
|
+
require "shellwords" # compensate missing require in rubygems before version 3.2.25
|
74
78
|
super
|
75
79
|
if extension_dir.directory? # not made for gems without extensions
|
76
80
|
SharedHelpers.filesystem_access(extension_cache_path.parent, &:mkpath)
|
data/lib/bundler/runtime.rb
CHANGED
@@ -22,10 +22,6 @@ module Bundler
|
|
22
22
|
|
23
23
|
# Activate the specs
|
24
24
|
load_paths = specs.map do |spec|
|
25
|
-
unless spec.loaded_from
|
26
|
-
raise GemNotFound, "#{spec.full_name} is missing. Run `bundle install` to get it."
|
27
|
-
end
|
28
|
-
|
29
25
|
check_for_activated_spec!(spec)
|
30
26
|
|
31
27
|
Bundler.rubygems.mark_loaded(spec)
|
@@ -104,7 +100,7 @@ module Bundler
|
|
104
100
|
|
105
101
|
alias_method :gems, :specs
|
106
102
|
|
107
|
-
def cache(custom_path = nil)
|
103
|
+
def cache(custom_path = nil, local = false)
|
108
104
|
cache_path = Bundler.app_cache(custom_path)
|
109
105
|
SharedHelpers.filesystem_access(cache_path) do |p|
|
110
106
|
FileUtils.mkdir_p(p)
|
@@ -112,7 +108,20 @@ module Bundler
|
|
112
108
|
|
113
109
|
Bundler.ui.info "Updating files in #{Bundler.settings.app_cache_path}"
|
114
110
|
|
115
|
-
specs_to_cache = Bundler.settings[:cache_all_platforms]
|
111
|
+
specs_to_cache = if Bundler.settings[:cache_all_platforms]
|
112
|
+
@definition.resolve.materialized_for_all_platforms
|
113
|
+
else
|
114
|
+
begin
|
115
|
+
specs
|
116
|
+
rescue GemNotFound
|
117
|
+
if local
|
118
|
+
Bundler.ui.warn "Some gems seem to be missing from your #{Bundler.settings.app_cache_path} directory."
|
119
|
+
end
|
120
|
+
|
121
|
+
raise
|
122
|
+
end
|
123
|
+
end
|
124
|
+
|
116
125
|
specs_to_cache.each do |spec|
|
117
126
|
next if spec.name == "bundler"
|
118
127
|
next if spec.source.is_a?(Source::Gemspec)
|
data/lib/bundler/settings.rb
CHANGED
@@ -428,6 +428,10 @@ module Bundler
|
|
428
428
|
def global_config_file
|
429
429
|
if ENV["BUNDLE_CONFIG"] && !ENV["BUNDLE_CONFIG"].empty?
|
430
430
|
Pathname.new(ENV["BUNDLE_CONFIG"])
|
431
|
+
elsif ENV["BUNDLE_USER_CONFIG"] && !ENV["BUNDLE_USER_CONFIG"].empty?
|
432
|
+
Pathname.new(ENV["BUNDLE_USER_CONFIG"])
|
433
|
+
elsif ENV["BUNDLE_USER_HOME"] && !ENV["BUNDLE_USER_HOME"].empty?
|
434
|
+
Pathname.new(ENV["BUNDLE_USER_HOME"]).join("config")
|
431
435
|
elsif Bundler.rubygems.user_home && !Bundler.rubygems.user_home.empty?
|
432
436
|
Pathname.new(Bundler.rubygems.user_home).join(".bundle/config")
|
433
437
|
end
|
data/lib/bundler/setup.rb
CHANGED
@@ -9,10 +9,10 @@ if Bundler::SharedHelpers.in_bundle?
|
|
9
9
|
begin
|
10
10
|
Bundler.ui.silence { Bundler.setup }
|
11
11
|
rescue Bundler::BundlerError => e
|
12
|
-
Bundler.ui.
|
12
|
+
Bundler.ui.error e.message
|
13
13
|
Bundler.ui.warn e.backtrace.join("\n") if ENV["DEBUG"]
|
14
14
|
if e.is_a?(Bundler::GemNotFound)
|
15
|
-
Bundler.ui.warn "
|
15
|
+
Bundler.ui.warn "Run `bundle install` to install missing gems."
|
16
16
|
end
|
17
17
|
exit e.status_code
|
18
18
|
end
|
@@ -152,13 +152,6 @@ module Bundler
|
|
152
152
|
Bundler.ui.warn message
|
153
153
|
end
|
154
154
|
|
155
|
-
def trap(signal, override = false, &block)
|
156
|
-
prior = Signal.trap(signal) do
|
157
|
-
block.call
|
158
|
-
prior.call unless override
|
159
|
-
end
|
160
|
-
end
|
161
|
-
|
162
155
|
def ensure_same_dependencies(spec, old_deps, new_deps)
|
163
156
|
new_deps = new_deps.reject {|d| d.type == :development }
|
164
157
|
old_deps = old_deps.reject {|d| d.type == :development }
|
data/lib/bundler/source.rb
CHANGED
@@ -36,8 +36,6 @@ module Bundler
|
|
36
36
|
|
37
37
|
def local!; end
|
38
38
|
|
39
|
-
def local_only!; end
|
40
|
-
|
41
39
|
def cached!; end
|
42
40
|
|
43
41
|
def remote!; end
|
@@ -67,6 +65,10 @@ module Bundler
|
|
67
65
|
"#<#{self.class}:0x#{object_id} #{self}>"
|
68
66
|
end
|
69
67
|
|
68
|
+
def to_err
|
69
|
+
to_s
|
70
|
+
end
|
71
|
+
|
70
72
|
def path?
|
71
73
|
instance_of?(Bundler::Source::Path)
|
72
74
|
end
|
@@ -1,7 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "shellwords"
|
4
|
-
|
5
3
|
module Bundler
|
6
4
|
class Source
|
7
5
|
class Git
|
@@ -224,6 +222,7 @@ module Bundler
|
|
224
222
|
end
|
225
223
|
|
226
224
|
def check_allowed(command)
|
225
|
+
require "shellwords"
|
227
226
|
command_with_no_credentials = URICredentialsFilter.credential_filtered_string("git #{command.shelljoin}", uri)
|
228
227
|
raise GitNotAllowedError.new(command_with_no_credentials) unless allow?
|
229
228
|
command_with_no_credentials
|
@@ -26,12 +26,6 @@ module Bundler
|
|
26
26
|
Array(options["remotes"]).reverse_each {|r| add_remote(r) }
|
27
27
|
end
|
28
28
|
|
29
|
-
def local_only!
|
30
|
-
@specs = nil
|
31
|
-
@allow_local = true
|
32
|
-
@allow_remote = false
|
33
|
-
end
|
34
|
-
|
35
29
|
def local!
|
36
30
|
return if @allow_local
|
37
31
|
|
@@ -50,6 +44,7 @@ module Bundler
|
|
50
44
|
return if @allow_cached
|
51
45
|
|
52
46
|
@specs = nil
|
47
|
+
@allow_local = true
|
53
48
|
@allow_cached = true
|
54
49
|
end
|
55
50
|
|
@@ -71,6 +66,10 @@ module Bundler
|
|
71
66
|
@remotes.size > 1
|
72
67
|
end
|
73
68
|
|
69
|
+
def no_remotes?
|
70
|
+
@remotes.size == 0
|
71
|
+
end
|
72
|
+
|
74
73
|
def can_lock?(spec)
|
75
74
|
return super unless multiple_remotes?
|
76
75
|
include?(spec.source)
|
@@ -92,11 +91,22 @@ module Bundler
|
|
92
91
|
out << " specs:\n"
|
93
92
|
end
|
94
93
|
|
94
|
+
def to_err
|
95
|
+
if remotes.empty?
|
96
|
+
"locally installed gems"
|
97
|
+
elsif @allow_remote
|
98
|
+
"rubygems repository #{remote_names} or installed locally"
|
99
|
+
elsif @allow_cached
|
100
|
+
"cached gems from rubygems repository #{remote_names} or installed locally"
|
101
|
+
else
|
102
|
+
"locally installed gems"
|
103
|
+
end
|
104
|
+
end
|
105
|
+
|
95
106
|
def to_s
|
96
107
|
if remotes.empty?
|
97
108
|
"locally installed gems"
|
98
109
|
else
|
99
|
-
remote_names = remotes.map(&:to_s).join(", ")
|
100
110
|
"rubygems repository #{remote_names} or installed locally"
|
101
111
|
end
|
102
112
|
end
|
@@ -315,6 +325,10 @@ module Bundler
|
|
315
325
|
|
316
326
|
protected
|
317
327
|
|
328
|
+
def remote_names
|
329
|
+
remotes.map(&:to_s).join(", ")
|
330
|
+
end
|
331
|
+
|
318
332
|
def credless_remotes
|
319
333
|
remotes.map(&method(:suppress_configured_credentials))
|
320
334
|
end
|
data/lib/bundler/source_list.rb
CHANGED
@@ -37,6 +37,10 @@ module Bundler
|
|
37
37
|
global_rubygems_source.multiple_remotes?
|
38
38
|
end
|
39
39
|
|
40
|
+
def implicit_global_source?
|
41
|
+
global_rubygems_source.no_remotes?
|
42
|
+
end
|
43
|
+
|
40
44
|
def add_path_source(options = {})
|
41
45
|
if options["gemspec"]
|
42
46
|
add_source_to_list Source::Gemspec.new(options), path_sources
|
@@ -117,7 +121,8 @@ module Bundler
|
|
117
121
|
def replace_sources!(replacement_sources)
|
118
122
|
return false if replacement_sources.empty?
|
119
123
|
|
120
|
-
@path_sources, @git_sources, @plugin_sources = map_sources(replacement_sources)
|
124
|
+
@rubygems_sources, @path_sources, @git_sources, @plugin_sources = map_sources(replacement_sources)
|
125
|
+
@global_rubygems_source = global_replacement_source(replacement_sources)
|
121
126
|
|
122
127
|
different_sources?(lock_sources, replacement_sources)
|
123
128
|
end
|
@@ -131,10 +136,6 @@ module Bundler
|
|
131
136
|
different_sources?(lock_sources, replacement_sources)
|
132
137
|
end
|
133
138
|
|
134
|
-
def local_only!
|
135
|
-
all_sources.each(&:local_only!)
|
136
|
-
end
|
137
|
-
|
138
139
|
def cached!
|
139
140
|
all_sources.each(&:cached!)
|
140
141
|
end
|
@@ -152,13 +153,21 @@ module Bundler
|
|
152
153
|
end
|
153
154
|
|
154
155
|
def map_sources(replacement_sources)
|
155
|
-
[path_sources, git_sources, plugin_sources].map do |sources|
|
156
|
+
[@rubygems_sources, @path_sources, @git_sources, @plugin_sources].map do |sources|
|
156
157
|
sources.map do |source|
|
157
158
|
replacement_sources.find {|s| s == source } || source
|
158
159
|
end
|
159
160
|
end
|
160
161
|
end
|
161
162
|
|
163
|
+
def global_replacement_source(replacement_sources)
|
164
|
+
replacement_source = replacement_sources.find {|s| s == global_rubygems_source }
|
165
|
+
return global_rubygems_source unless replacement_source
|
166
|
+
|
167
|
+
replacement_source.local!
|
168
|
+
replacement_source
|
169
|
+
end
|
170
|
+
|
162
171
|
def different_sources?(lock_sources, replacement_sources)
|
163
172
|
!equal_sources?(lock_sources, replacement_sources) && !equivalent_sources?(lock_sources, replacement_sources)
|
164
173
|
end
|
@@ -202,7 +211,7 @@ module Bundler
|
|
202
211
|
end
|
203
212
|
|
204
213
|
def equal_source?(source, other_source)
|
205
|
-
return source.include?(other_source) if source.is_a?(Source::Rubygems) && other_source.is_a?(Source::Rubygems)
|
214
|
+
return source.include?(other_source) if source.is_a?(Source::Rubygems) && other_source.is_a?(Source::Rubygems)
|
206
215
|
|
207
216
|
source == other_source
|
208
217
|
end
|
data/lib/bundler/spec_set.rb
CHANGED
@@ -11,7 +11,7 @@ module Bundler
|
|
11
11
|
@specs = specs
|
12
12
|
end
|
13
13
|
|
14
|
-
def for(dependencies, check = false, match_current_platform = false
|
14
|
+
def for(dependencies, check = false, match_current_platform = false)
|
15
15
|
handled = []
|
16
16
|
deps = dependencies.dup
|
17
17
|
specs = []
|
@@ -33,11 +33,6 @@ module Bundler
|
|
33
33
|
end
|
34
34
|
elsif check
|
35
35
|
return false
|
36
|
-
elsif raise_on_missing
|
37
|
-
others = lookup[dep.name] if match_current_platform
|
38
|
-
message = "Unable to find a spec satisfying #{dep} in the set. Perhaps the lockfile is corrupted?"
|
39
|
-
message += " Found #{others.join(", ")} that did not match the current platform." if others && !others.empty?
|
40
|
-
raise GemNotFound, message
|
41
36
|
end
|
42
37
|
end
|
43
38
|
|
@@ -71,52 +66,35 @@ module Bundler
|
|
71
66
|
lookup.dup
|
72
67
|
end
|
73
68
|
|
74
|
-
def materialize(deps
|
75
|
-
materialized = self.for(deps, false, true
|
76
|
-
|
77
|
-
materialized.group_by(&:source).each do |source, specs|
|
78
|
-
next unless specs.any?{|s| s.is_a?(LazySpecification) }
|
79
|
-
|
80
|
-
source.local!
|
81
|
-
names = -> { specs.map(&:name).uniq }
|
82
|
-
source.double_check_for(names)
|
83
|
-
end
|
69
|
+
def materialize(deps)
|
70
|
+
materialized = self.for(deps, false, true)
|
84
71
|
|
85
72
|
materialized.map! do |s|
|
86
73
|
next s unless s.is_a?(LazySpecification)
|
87
|
-
|
88
|
-
|
89
|
-
unless missing_specs
|
90
|
-
raise GemNotFound, "Could not find #{s.full_name} in any of the sources"
|
91
|
-
end
|
92
|
-
missing_specs << s
|
93
|
-
end
|
94
|
-
spec
|
74
|
+
s.source.local!
|
75
|
+
s.__materialize__ || s
|
95
76
|
end
|
96
|
-
SpecSet.new(
|
77
|
+
SpecSet.new(materialized)
|
97
78
|
end
|
98
79
|
|
99
80
|
# Materialize for all the specs in the spec set, regardless of what platform they're for
|
100
81
|
# This is in contrast to how for does platform filtering (and specifically different from how `materialize` calls `for` only for the current platform)
|
101
82
|
# @return [Array<Gem::Specification>]
|
102
83
|
def materialized_for_all_platforms
|
103
|
-
@specs.group_by(&:source).each do |source, specs|
|
104
|
-
next unless specs.any?{|s| s.is_a?(LazySpecification) }
|
105
|
-
|
106
|
-
source.local!
|
107
|
-
source.remote!
|
108
|
-
names = -> { specs.map(&:name).uniq }
|
109
|
-
source.double_check_for(names)
|
110
|
-
end
|
111
|
-
|
112
84
|
@specs.map do |s|
|
113
85
|
next s unless s.is_a?(LazySpecification)
|
86
|
+
s.source.local!
|
87
|
+
s.source.remote!
|
114
88
|
spec = s.__materialize__
|
115
89
|
raise GemNotFound, "Could not find #{s.full_name} in any of the sources" unless spec
|
116
90
|
spec
|
117
91
|
end
|
118
92
|
end
|
119
93
|
|
94
|
+
def missing_specs
|
95
|
+
@specs.select {|s| s.is_a?(LazySpecification) }
|
96
|
+
end
|
97
|
+
|
120
98
|
def merge(set)
|
121
99
|
arr = sorted.dup
|
122
100
|
set.each do |set_spec|
|
@@ -60,16 +60,16 @@ m = Module.new do
|
|
60
60
|
Regexp.last_match(1)
|
61
61
|
end
|
62
62
|
|
63
|
-
def
|
64
|
-
@
|
63
|
+
def bundler_requirement
|
64
|
+
@bundler_requirement ||=
|
65
65
|
env_var_version || cli_arg_version ||
|
66
|
-
lockfile_version
|
66
|
+
bundler_requirement_for(lockfile_version)
|
67
67
|
end
|
68
68
|
|
69
|
-
def
|
70
|
-
return "#{Gem::Requirement.default}.a" unless
|
69
|
+
def bundler_requirement_for(version)
|
70
|
+
return "#{Gem::Requirement.default}.a" unless version
|
71
71
|
|
72
|
-
bundler_gem_version = Gem::Version.new(
|
72
|
+
bundler_gem_version = Gem::Version.new(version)
|
73
73
|
|
74
74
|
requirement = bundler_gem_version.approximate_recommendation
|
75
75
|
|
@@ -1,16 +1,26 @@
|
|
1
1
|
name: Ruby
|
2
2
|
|
3
|
-
on:
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
- <%= config[:git_default_branch] %>
|
6
|
+
|
7
|
+
pull_request:
|
4
8
|
|
5
9
|
jobs:
|
6
10
|
build:
|
7
11
|
runs-on: ubuntu-latest
|
12
|
+
|
13
|
+
strategy:
|
14
|
+
matrix:
|
15
|
+
ruby:
|
16
|
+
- <%= RUBY_VERSION %>
|
17
|
+
|
8
18
|
steps:
|
9
19
|
- uses: actions/checkout@v2
|
10
20
|
- name: Set up Ruby
|
11
21
|
uses: ruby/setup-ruby@v1
|
12
22
|
with:
|
13
|
-
ruby-version:
|
23
|
+
ruby-version: ${{ matrix.ruby }}
|
14
24
|
bundler-cache: true
|
15
25
|
- name: Run the default task
|
16
26
|
run: bundle exec rake
|
@@ -25,7 +25,9 @@ Gem::Specification.new do |spec|
|
|
25
25
|
# Specify which files should be added to the gem when it is released.
|
26
26
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
27
27
|
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
28
|
-
`git ls-files -z`.split("\x0").reject
|
28
|
+
`git ls-files -z`.split("\x0").reject do |f|
|
29
|
+
(f == __FILE__) || f.match(%r{\A(?:(?:test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
|
30
|
+
end
|
29
31
|
end
|
30
32
|
spec.bindir = "exe"
|
31
33
|
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
data/lib/bundler/version.rb
CHANGED
data/lib/bundler/worker.rb
CHANGED
@@ -26,7 +26,7 @@ module Bundler
|
|
26
26
|
@func = func
|
27
27
|
@size = size
|
28
28
|
@threads = nil
|
29
|
-
|
29
|
+
@previous_interrupt_handler = nil
|
30
30
|
end
|
31
31
|
|
32
32
|
# Enqueue a request to be executed in the worker pool
|
@@ -68,13 +68,16 @@ module Bundler
|
|
68
68
|
# so as worker threads after retrieving it, shut themselves down
|
69
69
|
def stop_threads
|
70
70
|
return unless @threads
|
71
|
+
|
71
72
|
@threads.each { @request_queue.enq POISON }
|
72
73
|
@threads.each(&:join)
|
74
|
+
|
75
|
+
remove_interrupt_handler
|
76
|
+
|
73
77
|
@threads = nil
|
74
78
|
end
|
75
79
|
|
76
80
|
def abort_threads
|
77
|
-
return unless @threads
|
78
81
|
Bundler.ui.debug("\n#{caller.join("\n")}")
|
79
82
|
@threads.each(&:exit)
|
80
83
|
exit 1
|
@@ -94,11 +97,23 @@ module Bundler
|
|
94
97
|
end
|
95
98
|
end.compact
|
96
99
|
|
100
|
+
add_interrupt_handler unless @threads.empty?
|
101
|
+
|
97
102
|
return if creation_errors.empty?
|
98
103
|
|
99
104
|
message = "Failed to create threads for the #{name} worker: #{creation_errors.map(&:to_s).uniq.join(", ")}"
|
100
105
|
raise ThreadCreationError, message if @threads.empty?
|
101
106
|
Bundler.ui.info message
|
102
107
|
end
|
108
|
+
|
109
|
+
def add_interrupt_handler
|
110
|
+
@previous_interrupt_handler = trap("INT") { abort_threads }
|
111
|
+
end
|
112
|
+
|
113
|
+
def remove_interrupt_handler
|
114
|
+
return unless @previous_interrupt_handler
|
115
|
+
|
116
|
+
trap "INT", @previous_interrupt_handler
|
117
|
+
end
|
103
118
|
end
|
104
119
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bundler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.26
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- André Arko
|
@@ -22,7 +22,7 @@ authors:
|
|
22
22
|
autorequire:
|
23
23
|
bindir: exe
|
24
24
|
cert_chain: []
|
25
|
-
date: 2021-
|
25
|
+
date: 2021-08-17 00:00:00.000000000 Z
|
26
26
|
dependencies: []
|
27
27
|
description: Bundler manages an application's dependencies through its entire life,
|
28
28
|
across many machines, systematically and repeatably
|
@@ -354,7 +354,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
354
354
|
- !ruby/object:Gem::Version
|
355
355
|
version: 2.5.2
|
356
356
|
requirements: []
|
357
|
-
rubygems_version: 3.2.
|
357
|
+
rubygems_version: 3.2.26
|
358
358
|
signing_key:
|
359
359
|
specification_version: 4
|
360
360
|
summary: The best way to manage your application's dependencies
|