bundler 2.2.2 → 2.2.7
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 +67 -2
- data/bundler.gemspec +1 -1
- data/lib/bundler.rb +3 -7
- data/lib/bundler/build_metadata.rb +2 -2
- data/lib/bundler/cli.rb +2 -5
- data/lib/bundler/cli/cache.rb +1 -0
- data/lib/bundler/cli/gem.rb +2 -0
- data/lib/bundler/cli/update.rb +1 -1
- data/lib/bundler/compact_index_client/cache.rb +5 -13
- data/lib/bundler/compact_index_client/gem_parser.rb +28 -0
- data/lib/bundler/compact_index_client/updater.rb +0 -8
- data/lib/bundler/definition.rb +29 -21
- data/lib/bundler/dep_proxy.rb +15 -8
- data/lib/bundler/feature_flag.rb +0 -1
- data/lib/bundler/fetcher.rb +0 -1
- data/lib/bundler/gem_helper.rb +9 -7
- data/lib/bundler/gem_helpers.rb +30 -24
- data/lib/bundler/gem_version_promoter.rb +2 -2
- data/lib/bundler/installer.rb +0 -17
- data/lib/bundler/installer/standalone.rb +14 -0
- data/lib/bundler/lazy_specification.rb +10 -11
- data/{man → lib/bundler/man}/bundle-add.1 +1 -1
- data/{man → lib/bundler/man}/bundle-binstubs.1 +1 -1
- data/{man → lib/bundler/man}/bundle-cache.1 +1 -1
- data/{man → lib/bundler/man}/bundle-check.1 +1 -1
- data/{man → lib/bundler/man}/bundle-clean.1 +1 -1
- data/{man → lib/bundler/man}/bundle-config.1 +4 -4
- data/lib/bundler/man/bundle-config.1.ronn +3 -3
- data/{man → lib/bundler/man}/bundle-doctor.1 +1 -1
- data/{man → lib/bundler/man}/bundle-exec.1 +1 -1
- data/{man → lib/bundler/man}/bundle-gem.1 +1 -1
- data/{man → lib/bundler/man}/bundle-info.1 +1 -1
- data/{man → lib/bundler/man}/bundle-init.1 +1 -1
- data/{man → lib/bundler/man}/bundle-inject.1 +1 -1
- data/{man → lib/bundler/man}/bundle-install.1 +1 -1
- data/{man → lib/bundler/man}/bundle-list.1 +1 -1
- data/{man → lib/bundler/man}/bundle-lock.1 +1 -1
- data/{man → lib/bundler/man}/bundle-open.1 +1 -1
- data/{man → lib/bundler/man}/bundle-outdated.1 +1 -1
- data/{man → lib/bundler/man}/bundle-platform.1 +1 -1
- data/{man → lib/bundler/man}/bundle-pristine.1 +1 -1
- data/{man → lib/bundler/man}/bundle-remove.1 +1 -1
- data/{man → lib/bundler/man}/bundle-show.1 +1 -1
- data/{man → lib/bundler/man}/bundle-update.1 +1 -1
- data/{man → lib/bundler/man}/bundle-viz.1 +1 -1
- data/{man → lib/bundler/man}/bundle.1 +1 -1
- data/{man → lib/bundler/man}/gemfile.5 +1 -1
- data/{man → lib/bundler/man}/index.txt +0 -0
- data/lib/bundler/resolver.rb +36 -16
- data/lib/bundler/resolver/spec_group.rb +18 -23
- data/lib/bundler/rubygems_ext.rb +16 -0
- data/lib/bundler/rubygems_integration.rb +0 -5
- data/lib/bundler/settings.rb +1 -1
- data/lib/bundler/source/git.rb +19 -17
- data/lib/bundler/source/git/git_proxy.rb +54 -49
- data/lib/bundler/source/path/installer.rb +2 -0
- data/lib/bundler/source/rubygems.rb +10 -2
- data/lib/bundler/spec_set.rb +6 -9
- data/lib/bundler/templates/newgem/Gemfile.tt +1 -1
- data/lib/bundler/templates/newgem/newgem.gemspec.tt +1 -1
- data/lib/bundler/templates/newgem/rubocop.yml.tt +3 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/delegates/specification_provider.rb +7 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb +1 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/modules/specification_provider.rb +11 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +11 -7
- data/lib/bundler/version.rb +1 -1
- metadata +30 -29
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5f8e9970b2d4991ebf1dd972107e05ecd32951bdfa797ed6c36d6abf7a703ea1
|
4
|
+
data.tar.gz: 0d0ecd48d724a845003397e3ecb2bd063a2ab666522e3c37806175ecfe6a02f3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 345c9fdec8f29fdc67469a1d8cda01428120c1dc87c5db079449c388d02f3779942403ee719737ec8b95b9cd2fd0d0a06a6f26b2aa2d5c354aacff97a6ba8baa
|
7
|
+
data.tar.gz: 0aad39443512928b799c817eb78641e2bb7e0637937f26894ceda1bb250292fd5be44e0e61e714679bd07cac8ded827f6107934f90511ef00547837fa3292e8a
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,68 @@
|
|
1
|
+
# 2.2.7 (January 26, 2021)
|
2
|
+
|
3
|
+
## Enhancements:
|
4
|
+
|
5
|
+
- Improve error messages when dependency on bundler conflicts with running version [#4308](https://github.com/rubygems/rubygems/pull/4308)
|
6
|
+
- Avoid showing platforms with requirements in error messages [#4310](https://github.com/rubygems/rubygems/pull/4310)
|
7
|
+
- Introduce disable_local_revision_check config [#4237](https://github.com/rubygems/rubygems/pull/4237)
|
8
|
+
- Reverse rubygems require mixin with bundler standalone [#4299](https://github.com/rubygems/rubygems/pull/4299)
|
9
|
+
|
10
|
+
## Bug fixes:
|
11
|
+
|
12
|
+
- Fix releasing from a not yet pushed branch [#4309](https://github.com/rubygems/rubygems/pull/4309)
|
13
|
+
- Install cache only once if it already exists [#4304](https://github.com/rubygems/rubygems/pull/4304)
|
14
|
+
- Fix `force_ruby_platform` no longer being respected [#4302](https://github.com/rubygems/rubygems/pull/4302)
|
15
|
+
|
16
|
+
## Performance:
|
17
|
+
|
18
|
+
- Fix resolver dependency comparison [#4289](https://github.com/rubygems/rubygems/pull/4289)
|
19
|
+
|
20
|
+
# 2.2.6 (January 18, 2021)
|
21
|
+
|
22
|
+
## Enhancements:
|
23
|
+
|
24
|
+
- Improve resolver debugging [#4288](https://github.com/rubygems/rubygems/pull/4288)
|
25
|
+
|
26
|
+
## Bug fixes:
|
27
|
+
|
28
|
+
- Fix dependency locking for path source [#4293](https://github.com/rubygems/rubygems/pull/4293)
|
29
|
+
|
30
|
+
## Performance:
|
31
|
+
|
32
|
+
- Speed up complex dependency resolves by creating DepProxy factory and cache [#4216](https://github.com/rubygems/rubygems/pull/4216)
|
33
|
+
|
34
|
+
# 2.2.5 (January 11, 2021)
|
35
|
+
|
36
|
+
## Enhancements:
|
37
|
+
|
38
|
+
- Improve rubocop setup in the new gem template [#4220](https://github.com/rubygems/rubygems/pull/4220)
|
39
|
+
- Support repositories with default branch not named master [#4224](https://github.com/rubygems/rubygems/pull/4224)
|
40
|
+
|
41
|
+
## Bug fixes:
|
42
|
+
|
43
|
+
- Let Net::HTTP decompress the index instead of doing it manually [#4081](https://github.com/rubygems/rubygems/pull/4081)
|
44
|
+
- Workaround for another jruby crash when autoloading a constant [#4252](https://github.com/rubygems/rubygems/pull/4252)
|
45
|
+
- Fix another performance regression in the resolver [#4243](https://github.com/rubygems/rubygems/pull/4243)
|
46
|
+
- Restore support for old git versions [#4233](https://github.com/rubygems/rubygems/pull/4233)
|
47
|
+
- Give a proper error if cache path does not have write access [#4215](https://github.com/rubygems/rubygems/pull/4215)
|
48
|
+
- Fix running `rake release` from an ambiguous ref [#4219](https://github.com/rubygems/rubygems/pull/4219)
|
49
|
+
|
50
|
+
# 2.2.4 (December 31, 2020)
|
51
|
+
|
52
|
+
## Bug fixes:
|
53
|
+
|
54
|
+
- Fix bundle man pages display on truffleruby [#4209](https://github.com/rubygems/rubygems/pull/4209)
|
55
|
+
- Fix Windows + JRuby no longer being able to install git sources [#4196](https://github.com/rubygems/rubygems/pull/4196)
|
56
|
+
|
57
|
+
# 2.2.3 (December 22, 2020)
|
58
|
+
|
59
|
+
## Bug fixes:
|
60
|
+
|
61
|
+
- Restore full compatibility with previous lockfiles [#4179](https://github.com/rubygems/rubygems/pull/4179)
|
62
|
+
- Add all matching variants with the same platform specificity to the lockfile [#4180](https://github.com/rubygems/rubygems/pull/4180)
|
63
|
+
- Fix bundler installing gems for a different platform when running in frozen mode and current platform not in the lockfile [#4172](https://github.com/rubygems/rubygems/pull/4172)
|
64
|
+
- Fix crash when `bundle exec`'ing to bundler [#4175](https://github.com/rubygems/rubygems/pull/4175)
|
65
|
+
|
1
66
|
# 2.2.2 (December 17, 2020)
|
2
67
|
|
3
68
|
## Bug fixes:
|
@@ -311,7 +376,7 @@
|
|
311
376
|
- Fix `bundle update` message about exclude groups saying "installed" instead of "updated" ([#7150](https://github.com/rubygems/bundler/pull/7150))
|
312
377
|
- Fix `bundle licenses` not showing correct information about bundler itself ([#7147](https://github.com/rubygems/bundler/pull/7147))
|
313
378
|
- Fix installation path not including ruby scope when `BUNDLE_PATH` was set ([#7163](https://github.com/rubygems/bundler/pull/7163))
|
314
|
-
- Fix `bundle clean` incorrectly removing git
|
379
|
+
- Fix `bundle clean` incorrectly removing git dependencies present in the Gemfile when rubygems 3.0+ was used and path involved a symlink ([#7211](https://github.com/rubygems/bundler/pull/7211))
|
315
380
|
- Fix platform specific gems always being re-resolved when bundler was not running under that platform ([#7212](https://github.com/rubygems/bundler/pull/7212))
|
316
381
|
- Fix `bundle package --all-platforms` causing `bundle install` to ignore `--with` and `--without` ([#6113](https://github.com/rubygems/bundler/pull/6113))
|
317
382
|
- Fix `MissingRevision` git errors to include the specific `git` command that failed under the hood ([#7225](https://github.com/rubygems/bundler/pull/7225))
|
@@ -483,7 +548,7 @@ Changes
|
|
483
548
|
## Bug fixes:
|
484
549
|
|
485
550
|
- Fix issue where updating a gem resulted in the gem's version being downgraded when `BUNDLE_ONLY_UPDATE_TO_NEWER_VERSIONS` was set ([#6529](https://github.com/rubygems/bundler/issues/6529), @theflow)
|
486
|
-
- Fix some rescue calls that don't
|
551
|
+
- Fix some rescue calls that don't specify error type (@utilum)
|
487
552
|
- Fix an issue when the Lockfile would contain platform-specific gems that it didn't need ([#6491](https://github.com/rubygems/bundler/issues/6491), @segiddins)
|
488
553
|
- Improve handling of adding new gems with only a single group to the Gemfile in `bundle add` (@agrim123)
|
489
554
|
- Refactor check for OpenSSL in `bundle env` (@voxik)
|
data/bundler.gemspec
CHANGED
@@ -34,7 +34,7 @@ Gem::Specification.new do |s|
|
|
34
34
|
s.required_ruby_version = ">= 2.3.0"
|
35
35
|
s.required_rubygems_version = ">= 2.5.2"
|
36
36
|
|
37
|
-
s.files = Dir.glob("{lib,
|
37
|
+
s.files = Dir.glob("{lib,exe}/**/*", File::FNM_DOTMATCH).reject {|f| File.directory?(f) }
|
38
38
|
|
39
39
|
# Include the CHANGELOG.md, LICENSE.md, README.md manually
|
40
40
|
s.files += %w[CHANGELOG.md LICENSE.md README.md]
|
data/lib/bundler.rb
CHANGED
@@ -63,7 +63,6 @@ module Bundler
|
|
63
63
|
autoload :Resolver, File.expand_path("bundler/resolver", __dir__)
|
64
64
|
autoload :Retry, File.expand_path("bundler/retry", __dir__)
|
65
65
|
autoload :RubyDsl, File.expand_path("bundler/ruby_dsl", __dir__)
|
66
|
-
autoload :RubyGemsGemInstaller, File.expand_path("bundler/rubygems_gem_installer", __dir__)
|
67
66
|
autoload :RubyVersion, File.expand_path("bundler/ruby_version", __dir__)
|
68
67
|
autoload :Runtime, File.expand_path("bundler/runtime", __dir__)
|
69
68
|
autoload :Settings, File.expand_path("bundler/settings", __dir__)
|
@@ -212,13 +211,10 @@ module Bundler
|
|
212
211
|
end
|
213
212
|
end
|
214
213
|
|
215
|
-
def
|
216
|
-
return
|
214
|
+
def most_specific_locked_platform?(platform)
|
215
|
+
return false unless defined?(@definition) && @definition
|
217
216
|
|
218
|
-
|
219
|
-
return nil unless locked_gems
|
220
|
-
|
221
|
-
locked_gems.bundler_version
|
217
|
+
definition.most_specific_locked_platform == platform
|
222
218
|
end
|
223
219
|
|
224
220
|
def ruby_scope
|
@@ -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 = "
|
8
|
-
@git_commit_sha = "
|
7
|
+
@built_at = "2021-01-27".freeze
|
8
|
+
@git_commit_sha = "7bc7ecb660".freeze
|
9
9
|
@release = true
|
10
10
|
# end ivars
|
11
11
|
|
data/lib/bundler/cli.rb
CHANGED
@@ -122,9 +122,7 @@ module Bundler
|
|
122
122
|
else command = "bundle-#{cli}"
|
123
123
|
end
|
124
124
|
|
125
|
-
man_path = File.expand_path("
|
126
|
-
# man files are located under ruby's mandir with the default gems of bundler
|
127
|
-
man_path = RbConfig::CONFIG["mandir"] unless File.directory?(man_path)
|
125
|
+
man_path = File.expand_path("man", __dir__)
|
128
126
|
man_pages = Hash[Dir.glob(File.join(man_path, "**", "*")).grep(/.*\.\d*\Z/).collect do |f|
|
129
127
|
[File.basename(f, ".*"), f]
|
130
128
|
end]
|
@@ -134,8 +132,7 @@ module Bundler
|
|
134
132
|
if Bundler.which("man") && man_path !~ %r{^file:/.+!/META-INF/jruby.home/.+}
|
135
133
|
Kernel.exec "man #{man_page}"
|
136
134
|
else
|
137
|
-
|
138
|
-
puts File.read("#{fallback_man_path}/#{File.basename(man_page)}.ronn")
|
135
|
+
puts File.read("#{man_path}/#{File.basename(man_page)}.ronn")
|
139
136
|
end
|
140
137
|
elsif command_path = Bundler.which("bundler-#{cli}")
|
141
138
|
Kernel.exec(command_path, "--help")
|
data/lib/bundler/cli/cache.rb
CHANGED
data/lib/bundler/cli/gem.rb
CHANGED
@@ -59,6 +59,7 @@ module Bundler
|
|
59
59
|
:exe => options[:exe],
|
60
60
|
:bundler_version => bundler_dependency_version,
|
61
61
|
:github_username => github_username.empty? ? "[USERNAME]" : github_username,
|
62
|
+
:required_ruby_version => Gem.ruby_version < Gem::Version.new("2.4.a") ? "2.3.0" : "2.4.0",
|
62
63
|
}
|
63
64
|
ensure_safe_gem_name(name, constant_array)
|
64
65
|
|
@@ -147,6 +148,7 @@ module Bundler
|
|
147
148
|
"For more information, see the RuboCop docs (https://docs.rubocop.org/en/stable/) " \
|
148
149
|
"and the Ruby Style Guides (https://github.com/rubocop-hq/ruby-style-guide).")
|
149
150
|
config[:rubocop] = true
|
151
|
+
config[:rubocop_version] = Gem.ruby_version < Gem::Version.new("2.4.a") ? "0.81.0" : "1.7"
|
150
152
|
Bundler.ui.info "RuboCop enabled in config"
|
151
153
|
templates.merge!("rubocop.yml.tt" => ".rubocop.yml")
|
152
154
|
end
|
data/lib/bundler/cli/update.rb
CHANGED
@@ -82,7 +82,7 @@ module Bundler
|
|
82
82
|
locked_spec = locked_info[:spec]
|
83
83
|
new_spec = Bundler.definition.specs[name].first
|
84
84
|
unless new_spec
|
85
|
-
|
85
|
+
unless locked_spec.match_platform(Bundler.local_platform)
|
86
86
|
Bundler.ui.warn "Bundler attempted to update #{name} but it was not considered because it is for a different platform from the current one"
|
87
87
|
end
|
88
88
|
|
@@ -1,5 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require_relative "gem_parser"
|
4
|
+
|
3
5
|
module Bundler
|
4
6
|
class CompactIndexClient
|
5
7
|
class Cache
|
@@ -92,19 +94,9 @@ module Bundler
|
|
92
94
|
header ? lines[header + 1..-1] : lines
|
93
95
|
end
|
94
96
|
|
95
|
-
def parse_gem(
|
96
|
-
|
97
|
-
|
98
|
-
dependencies, requirements = rest.split("|", 2).map {|s| s.split(",") } if rest
|
99
|
-
dependencies = dependencies ? dependencies.map {|d| parse_dependency(d) } : []
|
100
|
-
requirements = requirements ? requirements.map {|r| parse_dependency(r) } : []
|
101
|
-
[version, platform, dependencies, requirements]
|
102
|
-
end
|
103
|
-
|
104
|
-
def parse_dependency(string)
|
105
|
-
dependency = string.split(":")
|
106
|
-
dependency[-1] = dependency[-1].split("&") if dependency.size > 1
|
107
|
-
dependency
|
97
|
+
def parse_gem(line)
|
98
|
+
@dependency_parser ||= GemParser.new
|
99
|
+
@dependency_parser.parse(line)
|
108
100
|
end
|
109
101
|
|
110
102
|
def info_roots
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Bundler
|
4
|
+
class CompactIndexClient
|
5
|
+
if defined?(Gem::Resolver::APISet::GemParser)
|
6
|
+
GemParser = Gem::Resolver::APISet::GemParser
|
7
|
+
else
|
8
|
+
class GemParser
|
9
|
+
def parse(line)
|
10
|
+
version_and_platform, rest = line.split(" ", 2)
|
11
|
+
version, platform = version_and_platform.split("-", 2)
|
12
|
+
dependencies, requirements = rest.split("|", 2).map {|s| s.split(",") } if rest
|
13
|
+
dependencies = dependencies ? dependencies.map {|d| parse_dependency(d) } : []
|
14
|
+
requirements = requirements ? requirements.map {|d| parse_dependency(d) } : []
|
15
|
+
[version, platform, dependencies, requirements]
|
16
|
+
end
|
17
|
+
|
18
|
+
private
|
19
|
+
|
20
|
+
def parse_dependency(string)
|
21
|
+
dependency = string.split(":")
|
22
|
+
dependency[-1] = dependency[-1].split("&") if dependency.size > 1
|
23
|
+
dependency
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -1,8 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require_relative "../vendored_fileutils"
|
4
|
-
require "stringio"
|
5
|
-
require "zlib"
|
6
4
|
|
7
5
|
module Bundler
|
8
6
|
class CompactIndexClient
|
@@ -45,18 +43,12 @@ module Bundler
|
|
45
43
|
else
|
46
44
|
"bytes=#{local_temp_path.size}-"
|
47
45
|
end
|
48
|
-
else
|
49
|
-
# Fastly ignores Range when Accept-Encoding: gzip is set
|
50
|
-
headers["Accept-Encoding"] = "gzip"
|
51
46
|
end
|
52
47
|
|
53
48
|
response = @fetcher.call(remote_path, headers)
|
54
49
|
return nil if response.is_a?(Net::HTTPNotModified)
|
55
50
|
|
56
51
|
content = response.body
|
57
|
-
if response["Content-Encoding"] == "gzip"
|
58
|
-
content = Zlib::GzipReader.new(StringIO.new(content)).read
|
59
|
-
end
|
60
52
|
|
61
53
|
SharedHelpers.filesystem_access(local_temp_path) do
|
62
54
|
if response.is_a?(Net::HTTPPartialContent) && local_temp_path.size.nonzero?
|
data/lib/bundler/definition.rb
CHANGED
@@ -118,7 +118,7 @@ module Bundler
|
|
118
118
|
end
|
119
119
|
@unlocking ||= @unlock[:ruby] ||= (!@locked_ruby_version ^ !@ruby_version)
|
120
120
|
|
121
|
-
add_current_platform unless Bundler.frozen_bundle?
|
121
|
+
add_current_platform unless current_ruby_platform_locked? || Bundler.frozen_bundle?
|
122
122
|
|
123
123
|
converge_path_sources_to_gemspec_sources
|
124
124
|
@path_changes = converge_paths
|
@@ -157,7 +157,7 @@ module Bundler
|
|
157
157
|
end
|
158
158
|
|
159
159
|
def resolve_remotely!
|
160
|
-
|
160
|
+
return if @specs
|
161
161
|
@remote = true
|
162
162
|
sources.remote!
|
163
163
|
specs
|
@@ -269,9 +269,8 @@ module Bundler
|
|
269
269
|
else
|
270
270
|
# Run a resolve against the locally available gems
|
271
271
|
Bundler.ui.debug("Found changes from the lockfile, re-resolving dependencies because #{change_reason}")
|
272
|
-
|
273
|
-
|
274
|
-
last_resolve.merge Resolver.resolve(expanded_dependencies, index, source_requirements, last_resolve, gem_version_promoter, additional_base_requirements_for_resolve, platforms_for_resolve)
|
272
|
+
expanded_dependencies = expand_dependencies(dependencies + metadata_dependencies, @remote)
|
273
|
+
last_resolve.merge Resolver.resolve(expanded_dependencies, index, source_requirements, last_resolve, gem_version_promoter, additional_base_requirements_for_resolve, platforms)
|
275
274
|
end
|
276
275
|
|
277
276
|
# filter out gems that _can_ be installed on multiple platforms, but don't need
|
@@ -507,15 +506,11 @@ module Bundler
|
|
507
506
|
end
|
508
507
|
|
509
508
|
def validate_platforms!
|
510
|
-
return if
|
511
|
-
Bundler.rubygems.platforms.any? do |local_platform|
|
512
|
-
MatchPlatform.platforms_match?(bundle_platform, local_platform)
|
513
|
-
end
|
514
|
-
end
|
509
|
+
return if current_platform_locked?
|
515
510
|
|
516
511
|
raise ProductionError, "Your bundle only supports platforms #{@platforms.map(&:to_s)} " \
|
517
|
-
"but your local
|
518
|
-
"
|
512
|
+
"but your local platform is #{Bundler.local_platform}. " \
|
513
|
+
"Add the current platform to the lockfile with `bundle lock --add-platform #{Bundler.local_platform}` and try again."
|
519
514
|
end
|
520
515
|
|
521
516
|
def add_platform(platform)
|
@@ -528,6 +523,12 @@ module Bundler
|
|
528
523
|
raise InvalidOption, "Unable to remove the platform `#{platform}` since the only platforms are #{@platforms.join ", "}"
|
529
524
|
end
|
530
525
|
|
526
|
+
def most_specific_locked_platform
|
527
|
+
@platforms.min_by do |bundle_platform|
|
528
|
+
platform_specificity_match(bundle_platform, local_platform)
|
529
|
+
end
|
530
|
+
end
|
531
|
+
|
531
532
|
def find_resolved_spec(current_spec)
|
532
533
|
specs.find_by_name_and_platform(current_spec.name, current_spec.platform)
|
533
534
|
end
|
@@ -549,6 +550,18 @@ module Bundler
|
|
549
550
|
|
550
551
|
private
|
551
552
|
|
553
|
+
def current_ruby_platform_locked?
|
554
|
+
return false unless generic_local_platform == Gem::Platform::RUBY
|
555
|
+
|
556
|
+
current_platform_locked?
|
557
|
+
end
|
558
|
+
|
559
|
+
def current_platform_locked?
|
560
|
+
@platforms.any? do |bundle_platform|
|
561
|
+
MatchPlatform.platforms_match?(bundle_platform, Bundler.local_platform)
|
562
|
+
end
|
563
|
+
end
|
564
|
+
|
552
565
|
def add_current_platform
|
553
566
|
add_platform(local_platform)
|
554
567
|
end
|
@@ -805,11 +818,6 @@ module Bundler
|
|
805
818
|
# commonly happens if the version changed in the gemspec
|
806
819
|
next unless new_spec
|
807
820
|
|
808
|
-
new_runtime_deps = new_spec.dependencies.select {|d| d.type != :development }
|
809
|
-
old_runtime_deps = s.dependencies.select {|d| d.type != :development }
|
810
|
-
# If the dependencies of the path source have changed and locked spec can't satisfy new dependencies, unlock it
|
811
|
-
next unless new_runtime_deps.sort == old_runtime_deps.sort || new_runtime_deps.all? {|d| satisfies_locked_spec?(d) }
|
812
|
-
|
813
821
|
s.dependencies.replace(new_spec.dependencies)
|
814
822
|
end
|
815
823
|
|
@@ -871,8 +879,7 @@ module Bundler
|
|
871
879
|
end
|
872
880
|
end
|
873
881
|
|
874
|
-
def expand_dependencies(dependencies, remote = false
|
875
|
-
platforms ||= @platforms
|
882
|
+
def expand_dependencies(dependencies, remote = false)
|
876
883
|
deps = []
|
877
884
|
dependencies.each do |dep|
|
878
885
|
dep = Dependency.new(dep, ">= 0") unless dep.respond_to?(:name)
|
@@ -885,7 +892,7 @@ module Bundler
|
|
885
892
|
|
886
893
|
def expand_dependency_with_platforms(dep, platforms)
|
887
894
|
platforms.map do |p|
|
888
|
-
DepProxy.
|
895
|
+
DepProxy.get_proxy(dep, p)
|
889
896
|
end
|
890
897
|
end
|
891
898
|
|
@@ -906,6 +913,7 @@ module Bundler
|
|
906
913
|
metadata_dependencies.each do |dep|
|
907
914
|
source_requirements[dep.name] = sources.metadata_source
|
908
915
|
end
|
916
|
+
source_requirements[:default_bundler] = source_requirements["bundler"] || source_requirements[:default]
|
909
917
|
source_requirements["bundler"] = sources.metadata_source # needs to come last to override
|
910
918
|
source_requirements
|
911
919
|
end
|
@@ -965,7 +973,7 @@ module Bundler
|
|
965
973
|
next requirements if @locked_gems.dependencies[name] != dependency
|
966
974
|
next requirements if dependency.source.is_a?(Source::Path)
|
967
975
|
dep = Gem::Dependency.new(name, ">= #{locked_spec.version}")
|
968
|
-
requirements[name] = DepProxy.
|
976
|
+
requirements[name] = DepProxy.get_proxy(dep, locked_spec.platform)
|
969
977
|
requirements
|
970
978
|
end.values
|
971
979
|
end
|
data/lib/bundler/dep_proxy.rb
CHANGED
@@ -4,19 +4,18 @@ module Bundler
|
|
4
4
|
class DepProxy
|
5
5
|
attr_reader :__platform, :dep
|
6
6
|
|
7
|
+
@proxies = {}
|
8
|
+
|
9
|
+
def self.get_proxy(dep, platform)
|
10
|
+
@proxies[[dep, platform]] ||= new(dep, platform).freeze
|
11
|
+
end
|
12
|
+
|
7
13
|
def initialize(dep, platform)
|
8
14
|
@dep = dep
|
9
15
|
@__platform = platform
|
10
16
|
end
|
11
17
|
|
12
|
-
|
13
|
-
@hash ||= [dep, __platform].hash
|
14
|
-
end
|
15
|
-
|
16
|
-
def ==(other)
|
17
|
-
return false if other.class != self.class
|
18
|
-
dep == other.dep && __platform == other.__platform
|
19
|
-
end
|
18
|
+
private_class_method :new
|
20
19
|
|
21
20
|
alias_method :eql?, :==
|
22
21
|
|
@@ -39,6 +38,14 @@ module Bundler
|
|
39
38
|
s
|
40
39
|
end
|
41
40
|
|
41
|
+
def dup
|
42
|
+
raise NoMethodError.new("DepProxy cannot be duplicated")
|
43
|
+
end
|
44
|
+
|
45
|
+
def clone
|
46
|
+
raise NoMethodError.new("DepProxy cannot be cloned")
|
47
|
+
end
|
48
|
+
|
42
49
|
private
|
43
50
|
|
44
51
|
def method_missing(*args, &blk)
|