bundler 2.4.22 → 2.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +53 -0
- data/bundler.gemspec +4 -2
- data/exe/bundle +1 -10
- data/lib/bundler/build_metadata.rb +3 -3
- data/lib/bundler/capistrano.rb +1 -1
- data/lib/bundler/checksum.rb +245 -0
- data/lib/bundler/ci_detector.rb +75 -0
- data/lib/bundler/cli/add.rb +3 -3
- data/lib/bundler/cli/binstubs.rb +4 -4
- data/lib/bundler/cli/cache.rb +1 -1
- data/lib/bundler/cli/check.rb +1 -1
- data/lib/bundler/cli/common.rb +9 -1
- data/lib/bundler/cli/config.rb +8 -7
- data/lib/bundler/cli/console.rb +3 -2
- data/lib/bundler/cli/doctor.rb +2 -2
- data/lib/bundler/cli/exec.rb +1 -1
- data/lib/bundler/cli/gem.rb +28 -23
- data/lib/bundler/cli/info.rb +2 -13
- data/lib/bundler/cli/install.rb +5 -4
- data/lib/bundler/cli/issue.rb +1 -1
- data/lib/bundler/cli/lock.rb +4 -4
- data/lib/bundler/cli/open.rb +1 -1
- data/lib/bundler/cli/outdated.rb +6 -6
- data/lib/bundler/cli/plugin.rb +7 -14
- data/lib/bundler/cli/pristine.rb +38 -30
- data/lib/bundler/cli/show.rb +2 -2
- data/lib/bundler/cli/update.rb +5 -5
- data/lib/bundler/cli.rb +215 -263
- data/lib/bundler/compact_index_client/cache.rb +29 -9
- data/lib/bundler/compact_index_client/cache_file.rb +153 -0
- data/lib/bundler/compact_index_client/gem_parser.rb +7 -3
- data/lib/bundler/compact_index_client/updater.rb +79 -81
- data/lib/bundler/compact_index_client.rb +14 -7
- data/lib/bundler/constants.rb +1 -1
- data/lib/bundler/current_ruby.rb +5 -21
- data/lib/bundler/definition.rb +42 -15
- data/lib/bundler/dependency.rb +16 -12
- data/lib/bundler/digest.rb +2 -2
- data/lib/bundler/dsl.rb +43 -25
- data/lib/bundler/endpoint_specification.rb +5 -1
- data/lib/bundler/env.rb +1 -3
- data/lib/bundler/errors.rb +43 -0
- data/lib/bundler/fetcher/base.rb +3 -1
- data/lib/bundler/fetcher/compact_index.rb +4 -4
- data/lib/bundler/fetcher/downloader.rb +13 -11
- data/lib/bundler/fetcher/gem_remote_fetcher.rb +16 -0
- data/lib/bundler/fetcher/index.rb +1 -1
- data/lib/bundler/fetcher.rb +28 -25
- data/lib/bundler/friendly_errors.rb +5 -5
- data/lib/bundler/gem_helper.rb +1 -1
- data/lib/bundler/gem_helpers.rb +5 -2
- data/lib/bundler/graph.rb +9 -9
- data/lib/bundler/index.rb +1 -2
- data/lib/bundler/injector.rb +1 -1
- data/lib/bundler/inline.rb +3 -3
- data/lib/bundler/installer/gem_installer.rb +5 -5
- data/lib/bundler/installer/parallel_installer.rb +16 -8
- data/lib/bundler/installer/standalone.rb +2 -3
- data/lib/bundler/installer.rb +9 -9
- data/lib/bundler/lazy_specification.rb +24 -17
- data/lib/bundler/lockfile_generator.rb +9 -0
- data/lib/bundler/lockfile_parser.rb +81 -10
- data/lib/bundler/man/bundle-add.1 +3 -26
- data/lib/bundler/man/bundle-binstubs.1 +4 -16
- data/lib/bundler/man/bundle-cache.1 +3 -24
- data/lib/bundler/man/bundle-check.1 +3 -12
- data/lib/bundler/man/bundle-clean.1 +3 -10
- data/lib/bundler/man/bundle-config.1 +20 -211
- data/lib/bundler/man/bundle-config.1.ronn +6 -0
- data/lib/bundler/man/bundle-console.1 +4 -22
- data/lib/bundler/man/bundle-doctor.1 +4 -18
- data/lib/bundler/man/bundle-exec.1 +12 -73
- data/lib/bundler/man/bundle-gem.1 +13 -49
- data/lib/bundler/man/bundle-help.1 +3 -7
- data/lib/bundler/man/bundle-info.1 +3 -9
- data/lib/bundler/man/bundle-init.1 +3 -12
- data/lib/bundler/man/bundle-inject.1 +6 -19
- data/lib/bundler/man/bundle-install.1 +27 -125
- data/lib/bundler/man/bundle-install.1.ronn +1 -0
- data/lib/bundler/man/bundle-list.1 +4 -19
- data/lib/bundler/man/bundle-lock.1 +5 -29
- data/lib/bundler/man/bundle-open.1 +7 -27
- data/lib/bundler/man/bundle-outdated.1 +3 -55
- data/lib/bundler/man/bundle-outdated.1.ronn +1 -0
- data/lib/bundler/man/bundle-platform.1 +5 -27
- data/lib/bundler/man/bundle-plugin.1 +3 -29
- data/lib/bundler/man/bundle-pristine.1 +5 -16
- data/lib/bundler/man/bundle-remove.1 +4 -14
- data/lib/bundler/man/bundle-show.1 +3 -10
- data/lib/bundler/man/bundle-update.1 +18 -137
- data/lib/bundler/man/bundle-version.1 +3 -16
- data/lib/bundler/man/bundle-viz.1 +4 -16
- data/lib/bundler/man/bundle.1 +5 -44
- data/lib/bundler/man/gemfile.5 +24 -301
- data/lib/bundler/man/gemfile.5.ronn +4 -0
- data/lib/bundler/match_metadata.rb +4 -0
- data/lib/bundler/match_platform.rb +1 -1
- data/lib/bundler/plugin/api/source.rb +3 -2
- data/lib/bundler/plugin/installer.rb +1 -1
- data/lib/bundler/plugin.rb +3 -3
- data/lib/bundler/resolver/base.rb +1 -1
- data/lib/bundler/resolver/incompatibility.rb +1 -1
- data/lib/bundler/resolver/spec_group.rb +1 -4
- data/lib/bundler/resolver.rb +16 -16
- data/lib/bundler/ruby_dsl.rb +20 -12
- data/lib/bundler/ruby_version.rb +1 -1
- data/lib/bundler/rubygems_ext.rb +24 -50
- data/lib/bundler/rubygems_gem_installer.rb +6 -56
- data/lib/bundler/rubygems_integration.rb +25 -94
- data/lib/bundler/runtime.rb +2 -2
- data/lib/bundler/self_manager.rb +23 -7
- data/lib/bundler/settings.rb +27 -7
- data/lib/bundler/setup.rb +4 -1
- data/lib/bundler/shared_helpers.rb +35 -13
- data/lib/bundler/source/git/git_proxy.rb +15 -15
- data/lib/bundler/source/git.rb +4 -3
- data/lib/bundler/source/metadata.rb +15 -15
- data/lib/bundler/source/path.rb +7 -6
- data/lib/bundler/source/rubygems.rb +21 -14
- data/lib/bundler/source.rb +2 -0
- data/lib/bundler/spec_set.rb +38 -10
- data/lib/bundler/stub_specification.rb +1 -0
- data/lib/bundler/templates/Executable.bundler +1 -1
- data/lib/bundler/templates/newgem/README.md.tt +3 -3
- data/lib/bundler/templates/newgem/Rakefile.tt +2 -6
- data/lib/bundler/templates/newgem/ext/newgem/Cargo.toml.tt +1 -1
- data/lib/bundler/templates/newgem/standard.yml.tt +1 -1
- data/lib/bundler/ui/shell.rb +1 -1
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/version.rb +1 -1
- data/lib/bundler/vendor/connection_pool/lib/connection_pool.rb +53 -6
- data/lib/bundler/vendor/fileutils/lib/fileutils.rb +8 -20
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/connection.rb +3 -3
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/pool.rb +2 -2
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/timed_stack_multi.rb +1 -1
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +35 -35
- data/lib/bundler/vendor/tsort/lib/tsort.rb +3 -0
- data/lib/bundler/vendor/uri/lib/uri/common.rb +256 -132
- data/lib/bundler/vendor/uri/lib/uri/generic.rb +1 -0
- data/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +95 -31
- data/lib/bundler/vendor/uri/lib/uri/version.rb +1 -1
- data/lib/bundler/vendored_net_http.rb +8 -0
- data/lib/bundler/vendored_persistent.rb +0 -4
- data/lib/bundler/vendored_timeout.rb +8 -0
- data/lib/bundler/version.rb +1 -1
- data/lib/bundler/vlad.rb +1 -1
- data/lib/bundler/yaml_serializer.rb +3 -3
- data/lib/bundler.rb +38 -27
- metadata +11 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 96c3a9a5a42642d473042853b90ec2e07a4be74e6e1b5aba5bfdc3bcc0ed8776
|
4
|
+
data.tar.gz: 5ccfc33ca9f1b86f30d896fc89db5e556b1dab1ec84361b1f2aa9bb65ff39769
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f9822abc2d327f47a25c580b932e4cf3108ab8ecc41d8c206db8840c27779ec4943daa0a28c05e36503c1a04f5b3cb82f2b93a5f32538cf52e2a62c8fee5c11c
|
7
|
+
data.tar.gz: f6f4e921e4c606352f0b2d1e54b2674f999690dda1a8d932b3c78bb0f6561f4527e4bf88fbfadb1061bbeb097014225fae9609262f415d1c3e08d61581e7f387
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,55 @@
|
|
1
|
+
# 2.5.0 (December 15, 2023)
|
2
|
+
|
3
|
+
## Breaking changes:
|
4
|
+
|
5
|
+
- Drop ruby 2.6 and 2.7 support [#7116](https://github.com/rubygems/rubygems/pull/7116)
|
6
|
+
- The `:mswin`, `:mswin64`, `:mingw`, and `:x64_mingw` Gemfile `platform` values are soft-deprecated and aliased to `:windows` [#6391](https://github.com/rubygems/rubygems/pull/6391)
|
7
|
+
|
8
|
+
## Features:
|
9
|
+
|
10
|
+
- Leverage ruby feature to warn when requiring default gems not included in the bundle that will be turned into bundled gems in the future [#6831](https://github.com/rubygems/rubygems/pull/6831)
|
11
|
+
- Introduce `bundle config set version` feature to choose the version of Bundler that should be used and potentially disable using the `lockfile` version by setting it to `system` [#6817](https://github.com/rubygems/rubygems/pull/6817)
|
12
|
+
|
13
|
+
## Performance:
|
14
|
+
|
15
|
+
- Use match? when regexp match data is unused [#7263](https://github.com/rubygems/rubygems/pull/7263)
|
16
|
+
- Avoid some allocations when evaluating `ruby` Gemfile DSL [#7251](https://github.com/rubygems/rubygems/pull/7251)
|
17
|
+
- Reduce array allocations when loading definition [#7199](https://github.com/rubygems/rubygems/pull/7199)
|
18
|
+
- Avoid re-compiling static regexp in a loop [#7198](https://github.com/rubygems/rubygems/pull/7198)
|
19
|
+
- Reduce allocations when installing gems with bundler [#6977](https://github.com/rubygems/rubygems/pull/6977)
|
20
|
+
- Use a shared connection pool for fetching gems [#7079](https://github.com/rubygems/rubygems/pull/7079)
|
21
|
+
- Reduce allocations when parsing compact index [#6971](https://github.com/rubygems/rubygems/pull/6971)
|
22
|
+
|
23
|
+
## Enhancements:
|
24
|
+
|
25
|
+
- Add 3.4 as a supported ruby version in Gemfile DSL [#7264](https://github.com/rubygems/rubygems/pull/7264)
|
26
|
+
- Improve install advice when some gems are not found [#7265](https://github.com/rubygems/rubygems/pull/7265)
|
27
|
+
- Vendor `net-http`, `net-protocol`, `resolv`, and `timeout` to reduce conflicts between Gemfile gems and internal dependencies [#6793](https://github.com/rubygems/rubygems/pull/6793)
|
28
|
+
- Allow `bundle pristine` to run in parallel [#6927](https://github.com/rubygems/rubygems/pull/6927)
|
29
|
+
- Make `bundle lock` always touch the lockfile in non-frozen mode [#7220](https://github.com/rubygems/rubygems/pull/7220)
|
30
|
+
- Use `Minitest::TestTask` in a template file for `minitest` [#7234](https://github.com/rubygems/rubygems/pull/7234)
|
31
|
+
- Add missing services to CI detection and make it consistent between RubyGems and Bundler [#7205](https://github.com/rubygems/rubygems/pull/7205)
|
32
|
+
- Allow auto-install to install missing git gems [#7197](https://github.com/rubygems/rubygems/pull/7197)
|
33
|
+
- Stop remembering cli flags like `--jobs` or `--retry` in configuration [#7191](https://github.com/rubygems/rubygems/pull/7191)
|
34
|
+
- Simplify remembered flags deprecation message [#7189](https://github.com/rubygems/rubygems/pull/7189)
|
35
|
+
- Make sure to `require "rubygems"` explicitly [#7139](https://github.com/rubygems/rubygems/pull/7139)
|
36
|
+
- Handle development dependencies duplicated in gemspec vs Gemfile [#6014](https://github.com/rubygems/rubygems/pull/6014)
|
37
|
+
- Make lockfiles generated on macOS include a lock for Linux by default [#5700](https://github.com/rubygems/rubygems/pull/5700)
|
38
|
+
- Only add a dummy bundler spec to the metadata source when necessary [#4443](https://github.com/rubygems/rubygems/pull/4443)
|
39
|
+
|
40
|
+
## Bug fixes:
|
41
|
+
|
42
|
+
- Resolve `ruby file: ".ruby-version"` relative to containing Gemfile [#7250](https://github.com/rubygems/rubygems/pull/7250)
|
43
|
+
- Implement opaque ETag in Compact Index to avoid falling back to old index in servers with different etag implementations [#7122](https://github.com/rubygems/rubygems/pull/7122)
|
44
|
+
- Fix `bundle install --system` deprecation advice [#7190](https://github.com/rubygems/rubygems/pull/7190)
|
45
|
+
- Fix invalid platform removal missing adjacent platforms [#7170](https://github.com/rubygems/rubygems/pull/7170)
|
46
|
+
|
47
|
+
## Documentation:
|
48
|
+
|
49
|
+
- Add missing --prefer-local to Synopsis in bundle-install.1.ronn [#7194](https://github.com/rubygems/rubygems/pull/7194)
|
50
|
+
- Update GitHub organization of Standard Ruby in `bundle gem` output and generated configuration [#6818](https://github.com/rubygems/rubygems/pull/6818)
|
51
|
+
- Replace "prior to" with "immediately after" in `bundle gem` generated README file [#6338](https://github.com/rubygems/rubygems/pull/6338)
|
52
|
+
|
1
53
|
# 2.4.22 (November 9, 2023)
|
2
54
|
|
3
55
|
## Enhancements:
|
@@ -757,6 +809,7 @@
|
|
757
809
|
|
758
810
|
## Enhancements:
|
759
811
|
|
812
|
+
- Cancel deprecation of custom git sources [#5147](https://github.com/rubygems/rubygems/pull/5147)
|
760
813
|
- Print warning when running Bundler on potentially problematic RubyGems & Ruby combinations [#5177](https://github.com/rubygems/rubygems/pull/5177)
|
761
814
|
- Error tracing should be printed to stderr [#5179](https://github.com/rubygems/rubygems/pull/5179)
|
762
815
|
- Add `github` and `ref` options to `bundle add` [#5159](https://github.com/rubygems/rubygems/pull/5159)
|
data/bundler.gemspec
CHANGED
@@ -29,8 +29,10 @@ Gem::Specification.new do |s|
|
|
29
29
|
"source_code_uri" => "https://github.com/rubygems/rubygems/tree/master/bundler",
|
30
30
|
}
|
31
31
|
|
32
|
-
s.required_ruby_version = ">=
|
33
|
-
|
32
|
+
s.required_ruby_version = ">= 3.0.0"
|
33
|
+
|
34
|
+
# It should match the RubyGems version shipped with `required_ruby_version` above
|
35
|
+
s.required_rubygems_version = ">= 3.2.3"
|
34
36
|
|
35
37
|
s.files = Dir.glob("lib/bundler{.rb,/**/*}", File::FNM_DOTMATCH).reject {|f| File.directory?(f) }
|
36
38
|
|
data/exe/bundle
CHANGED
@@ -15,15 +15,6 @@ end
|
|
15
15
|
|
16
16
|
require "bundler"
|
17
17
|
|
18
|
-
if Gem.rubygems_version < Gem::Version.new("3.2.3") && Gem.ruby_version < Gem::Version.new("2.7.a") && !ENV["BUNDLER_NO_OLD_RUBYGEMS_WARNING"]
|
19
|
-
Bundler.ui.warn \
|
20
|
-
"Your RubyGems version (#{Gem::VERSION}) has a bug that prevents " \
|
21
|
-
"`required_ruby_version` from working for Bundler. Any scripts that use " \
|
22
|
-
"`gem install bundler` will break as soon as Bundler drops support for " \
|
23
|
-
"your Ruby version. Please upgrade RubyGems to avoid future breakage " \
|
24
|
-
"and silence this warning by running `gem update --system 3.2.3`"
|
25
|
-
end
|
26
|
-
|
27
18
|
require "bundler/friendly_errors"
|
28
19
|
|
29
20
|
Bundler.with_friendly_errors do
|
@@ -34,5 +25,5 @@ Bundler.with_friendly_errors do
|
|
34
25
|
help_flag_used = ARGV.any? {|a| help_flags.include? a }
|
35
26
|
args = help_flag_used ? Bundler::CLI.reformatted_help_args(ARGV) : ARGV
|
36
27
|
|
37
|
-
Bundler::CLI.start(args, :
|
28
|
+
Bundler::CLI.start(args, debug: true)
|
38
29
|
end
|
@@ -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 = "2023-
|
8
|
-
@git_commit_sha = "
|
7
|
+
@built_at = "2023-12-15".freeze
|
8
|
+
@git_commit_sha = "58fdbff35a".freeze
|
9
9
|
@release = true
|
10
10
|
# end ivars
|
11
11
|
|
@@ -31,7 +31,7 @@ module Bundler
|
|
31
31
|
# commit instance variable then we can't determine its commits SHA.
|
32
32
|
git_dir = File.expand_path("../../../.git", __dir__)
|
33
33
|
if File.directory?(git_dir)
|
34
|
-
return @git_commit_sha = IO.popen(%w[git rev-parse --short HEAD], { :
|
34
|
+
return @git_commit_sha = IO.popen(%w[git rev-parse --short HEAD], { chdir: git_dir }, &:read).strip.freeze
|
35
35
|
end
|
36
36
|
|
37
37
|
@git_commit_sha ||= "unknown"
|
data/lib/bundler/capistrano.rb
CHANGED
@@ -17,6 +17,6 @@ end
|
|
17
17
|
|
18
18
|
Capistrano::Configuration.instance(:must_exist).load do
|
19
19
|
before "deploy:finalize_update", "bundle:install"
|
20
|
-
Bundler::Deployment.define_task(self, :task, :
|
20
|
+
Bundler::Deployment.define_task(self, :task, except: { no_release: true })
|
21
21
|
set :rake, lambda { "#{fetch(:bundle_cmd, "bundle")} exec rake" }
|
22
22
|
end
|
@@ -0,0 +1,245 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Bundler
|
4
|
+
class Checksum
|
5
|
+
ALGO_SEPARATOR = "="
|
6
|
+
DEFAULT_ALGORITHM = "sha256"
|
7
|
+
private_constant :DEFAULT_ALGORITHM
|
8
|
+
DEFAULT_BLOCK_SIZE = 16_384
|
9
|
+
private_constant :DEFAULT_BLOCK_SIZE
|
10
|
+
|
11
|
+
class << self
|
12
|
+
def from_gem_package(gem_package, algo = DEFAULT_ALGORITHM)
|
13
|
+
return if Bundler.settings[:disable_checksum_validation]
|
14
|
+
return unless source = gem_package.instance_variable_get(:@gem)
|
15
|
+
return unless source.respond_to?(:with_read_io)
|
16
|
+
|
17
|
+
source.with_read_io do |io|
|
18
|
+
from_gem(io, source.path)
|
19
|
+
ensure
|
20
|
+
io.rewind
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
def from_gem(io, pathname, algo = DEFAULT_ALGORITHM)
|
25
|
+
digest = Bundler::SharedHelpers.digest(algo.upcase).new
|
26
|
+
buf = String.new(capacity: DEFAULT_BLOCK_SIZE)
|
27
|
+
digest << io.readpartial(DEFAULT_BLOCK_SIZE, buf) until io.eof?
|
28
|
+
Checksum.new(algo, digest.hexdigest!, Source.new(:gem, pathname))
|
29
|
+
end
|
30
|
+
|
31
|
+
def from_api(digest, source_uri, algo = DEFAULT_ALGORITHM)
|
32
|
+
return if Bundler.settings[:disable_checksum_validation]
|
33
|
+
Checksum.new(algo, to_hexdigest(digest, algo), Source.new(:api, source_uri))
|
34
|
+
end
|
35
|
+
|
36
|
+
def from_lock(lock_checksum, lockfile_location)
|
37
|
+
algo, digest = lock_checksum.strip.split(ALGO_SEPARATOR, 2)
|
38
|
+
Checksum.new(algo, to_hexdigest(digest, algo), Source.new(:lock, lockfile_location))
|
39
|
+
end
|
40
|
+
|
41
|
+
def to_hexdigest(digest, algo = DEFAULT_ALGORITHM)
|
42
|
+
return digest unless algo == DEFAULT_ALGORITHM
|
43
|
+
return digest if digest.match?(/\A[0-9a-f]{64}\z/i)
|
44
|
+
if digest.match?(%r{\A[-0-9a-z_+/]{43}={0,2}\z}i)
|
45
|
+
digest = digest.tr("-_", "+/") # fix urlsafe base64
|
46
|
+
return digest.unpack1("m0").unpack1("H*")
|
47
|
+
end
|
48
|
+
raise ArgumentError, "#{digest.inspect} is not a valid SHA256 hex or base64 digest"
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
attr_reader :algo, :digest, :sources
|
53
|
+
|
54
|
+
def initialize(algo, digest, source)
|
55
|
+
@algo = algo
|
56
|
+
@digest = digest
|
57
|
+
@sources = [source]
|
58
|
+
end
|
59
|
+
|
60
|
+
def ==(other)
|
61
|
+
match?(other) && other.sources == sources
|
62
|
+
end
|
63
|
+
|
64
|
+
alias_method :eql?, :==
|
65
|
+
|
66
|
+
def match?(other)
|
67
|
+
other.is_a?(self.class) && other.digest == digest && other.algo == algo
|
68
|
+
end
|
69
|
+
|
70
|
+
def hash
|
71
|
+
digest.hash
|
72
|
+
end
|
73
|
+
|
74
|
+
def to_s
|
75
|
+
"#{to_lock} (from #{sources.first}#{", ..." if sources.size > 1})"
|
76
|
+
end
|
77
|
+
|
78
|
+
def to_lock
|
79
|
+
"#{algo}#{ALGO_SEPARATOR}#{digest}"
|
80
|
+
end
|
81
|
+
|
82
|
+
def merge!(other)
|
83
|
+
return nil unless match?(other)
|
84
|
+
@sources.concat(other.sources).uniq!
|
85
|
+
self
|
86
|
+
end
|
87
|
+
|
88
|
+
def formatted_sources
|
89
|
+
sources.join("\n and ").concat("\n")
|
90
|
+
end
|
91
|
+
|
92
|
+
def removable?
|
93
|
+
sources.all?(&:removable?)
|
94
|
+
end
|
95
|
+
|
96
|
+
def removal_instructions
|
97
|
+
msg = +""
|
98
|
+
i = 1
|
99
|
+
sources.each do |source|
|
100
|
+
msg << " #{i}. #{source.removal}\n"
|
101
|
+
i += 1
|
102
|
+
end
|
103
|
+
msg << " #{i}. run `bundle install`\n"
|
104
|
+
end
|
105
|
+
|
106
|
+
def inspect
|
107
|
+
abbr = "#{algo}#{ALGO_SEPARATOR}#{digest[0, 8]}"
|
108
|
+
from = "from #{sources.join(" and ")}"
|
109
|
+
"#<#{self.class}:#{object_id} #{abbr} #{from}>"
|
110
|
+
end
|
111
|
+
|
112
|
+
class Source
|
113
|
+
attr_reader :type, :location
|
114
|
+
|
115
|
+
def initialize(type, location)
|
116
|
+
@type = type
|
117
|
+
@location = location
|
118
|
+
end
|
119
|
+
|
120
|
+
def removable?
|
121
|
+
type == :lock || type == :gem
|
122
|
+
end
|
123
|
+
|
124
|
+
def ==(other)
|
125
|
+
other.is_a?(self.class) && other.type == type && other.location == location
|
126
|
+
end
|
127
|
+
|
128
|
+
# phrased so that the usual string format is grammatically correct
|
129
|
+
# rake (10.3.2) sha256=abc123 from #{to_s}
|
130
|
+
def to_s
|
131
|
+
case type
|
132
|
+
when :lock
|
133
|
+
"the lockfile CHECKSUMS at #{location}"
|
134
|
+
when :gem
|
135
|
+
"the gem at #{location}"
|
136
|
+
when :api
|
137
|
+
"the API at #{location}"
|
138
|
+
else
|
139
|
+
"#{location} (#{type})"
|
140
|
+
end
|
141
|
+
end
|
142
|
+
|
143
|
+
# A full sentence describing how to remove the checksum
|
144
|
+
def removal
|
145
|
+
case type
|
146
|
+
when :lock
|
147
|
+
"remove the matching checksum in #{location}"
|
148
|
+
when :gem
|
149
|
+
"remove the gem at #{location}"
|
150
|
+
when :api
|
151
|
+
"checksums from #{location} cannot be locally modified, you may need to update your sources"
|
152
|
+
else
|
153
|
+
"remove #{location} (#{type})"
|
154
|
+
end
|
155
|
+
end
|
156
|
+
end
|
157
|
+
|
158
|
+
class Store
|
159
|
+
attr_reader :store
|
160
|
+
protected :store
|
161
|
+
|
162
|
+
def initialize
|
163
|
+
@store = {}
|
164
|
+
end
|
165
|
+
|
166
|
+
def initialize_copy(other)
|
167
|
+
@store = {}
|
168
|
+
other.store.each do |lock_name, checksums|
|
169
|
+
store[lock_name] = checksums.dup
|
170
|
+
end
|
171
|
+
end
|
172
|
+
|
173
|
+
def inspect
|
174
|
+
"#<#{self.class}:#{object_id} size=#{store.size}>"
|
175
|
+
end
|
176
|
+
|
177
|
+
def fetch(spec, algo = DEFAULT_ALGORITHM)
|
178
|
+
store[spec.name_tuple.lock_name]&.fetch(algo, nil)
|
179
|
+
end
|
180
|
+
|
181
|
+
# Replace when the new checksum is from the same source.
|
182
|
+
# The primary purpose of this registering checksums from gems where there are
|
183
|
+
# duplicates of the same gem (according to full_name) in the index.
|
184
|
+
# In particular, this is when 2 gems have two similar platforms, e.g.
|
185
|
+
# "darwin20" and "darwin-20", both of which resolve to darwin-20.
|
186
|
+
# In the Index, the later gem replaces the former, so we do that here.
|
187
|
+
#
|
188
|
+
# However, if the new checksum is from a different source, we register like normal.
|
189
|
+
# This ensures a mismatch error where there are multiple top level sources
|
190
|
+
# that contain the same gem with different checksums.
|
191
|
+
def replace(spec, checksum)
|
192
|
+
return unless checksum
|
193
|
+
|
194
|
+
lock_name = spec.name_tuple.lock_name
|
195
|
+
checksums = (store[lock_name] ||= {})
|
196
|
+
existing = checksums[checksum.algo]
|
197
|
+
|
198
|
+
# we assume only one source because this is used while building the index
|
199
|
+
if !existing || existing.sources.first == checksum.sources.first
|
200
|
+
checksums[checksum.algo] = checksum
|
201
|
+
else
|
202
|
+
register_checksum(lock_name, checksum)
|
203
|
+
end
|
204
|
+
end
|
205
|
+
|
206
|
+
def register(spec, checksum)
|
207
|
+
return unless checksum
|
208
|
+
register_checksum(spec.name_tuple.lock_name, checksum)
|
209
|
+
end
|
210
|
+
|
211
|
+
def merge!(other)
|
212
|
+
other.store.each do |lock_name, checksums|
|
213
|
+
checksums.each do |_algo, checksum|
|
214
|
+
register_checksum(lock_name, checksum)
|
215
|
+
end
|
216
|
+
end
|
217
|
+
end
|
218
|
+
|
219
|
+
def to_lock(spec)
|
220
|
+
lock_name = spec.name_tuple.lock_name
|
221
|
+
if checksums = store[lock_name]
|
222
|
+
"#{lock_name} #{checksums.values.map(&:to_lock).sort.join(",")}"
|
223
|
+
else
|
224
|
+
lock_name
|
225
|
+
end
|
226
|
+
end
|
227
|
+
|
228
|
+
private
|
229
|
+
|
230
|
+
def register_checksum(lock_name, checksum)
|
231
|
+
return unless checksum
|
232
|
+
checksums = (store[lock_name] ||= {})
|
233
|
+
existing = checksums[checksum.algo]
|
234
|
+
|
235
|
+
if !existing
|
236
|
+
checksums[checksum.algo] = checksum
|
237
|
+
elsif existing.merge!(checksum)
|
238
|
+
checksum
|
239
|
+
else
|
240
|
+
raise ChecksumMismatchError.new(lock_name, existing, checksum)
|
241
|
+
end
|
242
|
+
end
|
243
|
+
end
|
244
|
+
end
|
245
|
+
end
|
@@ -0,0 +1,75 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Bundler
|
4
|
+
module CIDetector
|
5
|
+
# NOTE: Any changes made here will need to be made to both lib/rubygems/ci_detector.rb and
|
6
|
+
# bundler/lib/bundler/ci_detector.rb (which are enforced duplicates).
|
7
|
+
# TODO: Drop that duplication once bundler drops support for RubyGems 3.4
|
8
|
+
#
|
9
|
+
# ## Recognized CI providers, their signifiers, and the relevant docs ##
|
10
|
+
#
|
11
|
+
# Travis CI - CI, TRAVIS https://docs.travis-ci.com/user/environment-variables/#default-environment-variables
|
12
|
+
# Cirrus CI - CI, CIRRUS_CI https://cirrus-ci.org/guide/writing-tasks/#environment-variables
|
13
|
+
# Circle CI - CI, CIRCLECI https://circleci.com/docs/variables/#built-in-environment-variables
|
14
|
+
# Gitlab CI - CI, GITLAB_CI https://docs.gitlab.com/ee/ci/variables/
|
15
|
+
# AppVeyor - CI, APPVEYOR https://www.appveyor.com/docs/environment-variables/
|
16
|
+
# CodeShip - CI_NAME https://docs.cloudbees.com/docs/cloudbees-codeship/latest/pro-builds-and-configuration/environment-variables#_default_environment_variables
|
17
|
+
# dsari - CI, DSARI https://github.com/rfinnie/dsari#running
|
18
|
+
# Jenkins - BUILD_NUMBER https://www.jenkins.io/doc/book/pipeline/jenkinsfile/#using-environment-variables
|
19
|
+
# TeamCity - TEAMCITY_VERSION https://www.jetbrains.com/help/teamcity/predefined-build-parameters.html#Predefined+Server+Build+Parameters
|
20
|
+
# Appflow - CI_BUILD_ID https://ionic.io/docs/appflow/automation/environments#predefined-environments
|
21
|
+
# TaskCluster - TASKCLUSTER_ROOT_URL https://docs.taskcluster.net/docs/manual/design/env-vars
|
22
|
+
# Semaphore - CI, SEMAPHORE https://docs.semaphoreci.com/ci-cd-environment/environment-variables/
|
23
|
+
# BuildKite - CI, BUILDKITE https://buildkite.com/docs/pipelines/environment-variables
|
24
|
+
# GoCD - GO_SERVER_URL https://docs.gocd.org/current/faq/dev_use_current_revision_in_build.html
|
25
|
+
# GH Actions - CI, GITHUB_ACTIONS https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables
|
26
|
+
#
|
27
|
+
# ### Some "standard" ENVs that multiple providers may set ###
|
28
|
+
#
|
29
|
+
# * CI - this is set by _most_ (but not all) CI providers now; it's approaching a standard.
|
30
|
+
# * CI_NAME - Not as frequently used, but some providers set this to specify their own name
|
31
|
+
|
32
|
+
# Any of these being set is a reasonably reliable indicator that we are
|
33
|
+
# executing in a CI environment.
|
34
|
+
ENV_INDICATORS = [
|
35
|
+
"CI",
|
36
|
+
"CI_NAME",
|
37
|
+
"CONTINUOUS_INTEGRATION",
|
38
|
+
"BUILD_NUMBER",
|
39
|
+
"CI_APP_ID",
|
40
|
+
"CI_BUILD_ID",
|
41
|
+
"CI_BUILD_NUMBER",
|
42
|
+
"RUN_ID",
|
43
|
+
"TASKCLUSTER_ROOT_URL",
|
44
|
+
].freeze
|
45
|
+
|
46
|
+
# For each CI, this env suffices to indicate that we're on _that_ CI's
|
47
|
+
# containers. (A few of them only supply a CI_NAME variable, which is also
|
48
|
+
# nice). And if they set "CI" but we can't tell which one they are, we also
|
49
|
+
# want to know that - a bare "ci" without another token tells us as much.
|
50
|
+
ENV_DESCRIPTORS = {
|
51
|
+
"TRAVIS" => "travis",
|
52
|
+
"CIRCLECI" => "circle",
|
53
|
+
"CIRRUS_CI" => "cirrus",
|
54
|
+
"DSARI" => "dsari",
|
55
|
+
"SEMAPHORE" => "semaphore",
|
56
|
+
"JENKINS_URL" => "jenkins",
|
57
|
+
"BUILDKITE" => "buildkite",
|
58
|
+
"GO_SERVER_URL" => "go",
|
59
|
+
"GITLAB_CI" => "gitlab",
|
60
|
+
"GITHUB_ACTIONS" => "github",
|
61
|
+
"TASKCLUSTER_ROOT_URL" => "taskcluster",
|
62
|
+
"CI" => "ci",
|
63
|
+
}.freeze
|
64
|
+
|
65
|
+
def self.ci?
|
66
|
+
ENV_INDICATORS.any? {|var| ENV.include?(var) }
|
67
|
+
end
|
68
|
+
|
69
|
+
def self.ci_strings
|
70
|
+
matching_names = ENV_DESCRIPTORS.select {|env, _| ENV[env] }.values
|
71
|
+
matching_names << ENV["CI_NAME"].downcase if ENV["CI_NAME"]
|
72
|
+
matching_names.reject(&:empty?).sort.uniq
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
data/lib/bundler/cli/add.rb
CHANGED
@@ -28,9 +28,9 @@ module Bundler
|
|
28
28
|
dependencies = gems.map {|g| Bundler::Dependency.new(g, version, options) }
|
29
29
|
|
30
30
|
Injector.inject(dependencies,
|
31
|
-
:
|
32
|
-
:
|
33
|
-
:
|
31
|
+
conservative_versioning: options[:version].nil?, # Perform conservative versioning only when version is not specified
|
32
|
+
optimistic: options[:optimistic],
|
33
|
+
strict: options[:strict])
|
34
34
|
end
|
35
35
|
|
36
36
|
def validate_options!
|
data/lib/bundler/cli/binstubs.rb
CHANGED
@@ -17,9 +17,9 @@ module Bundler
|
|
17
17
|
installer = Installer.new(Bundler.root, Bundler.definition)
|
18
18
|
|
19
19
|
installer_opts = {
|
20
|
-
:
|
21
|
-
:
|
22
|
-
:
|
20
|
+
force: options[:force],
|
21
|
+
binstubs_cmd: true,
|
22
|
+
all_platforms: options["all-platforms"],
|
23
23
|
}
|
24
24
|
|
25
25
|
if options[:all]
|
@@ -45,7 +45,7 @@ module Bundler
|
|
45
45
|
next
|
46
46
|
end
|
47
47
|
|
48
|
-
Bundler.settings.temporary(:
|
48
|
+
Bundler.settings.temporary(path: (Bundler.settings[:path] || Bundler.root)) do
|
49
49
|
installer.generate_standalone_bundler_executable_stubs(spec, installer_opts)
|
50
50
|
end
|
51
51
|
else
|
data/lib/bundler/cli/cache.rb
CHANGED
@@ -19,7 +19,7 @@ module Bundler
|
|
19
19
|
# TODO: move cache contents here now that all bundles are locked
|
20
20
|
custom_path = Bundler.settings[:path] if options[:path]
|
21
21
|
|
22
|
-
Bundler.settings.temporary(:
|
22
|
+
Bundler.settings.temporary(cache_all_platforms: options["all-platforms"]) do
|
23
23
|
Bundler.load.cache(custom_path)
|
24
24
|
end
|
25
25
|
end
|
data/lib/bundler/cli/check.rb
CHANGED
@@ -32,7 +32,7 @@ module Bundler
|
|
32
32
|
Bundler.ui.error "This bundle has been frozen, but there is no #{SharedHelpers.relative_lockfile_path} present"
|
33
33
|
exit 1
|
34
34
|
else
|
35
|
-
Bundler.load.lock(:
|
35
|
+
Bundler.load.lock(preserve_unknown_sections: true) unless options[:"dry-run"]
|
36
36
|
Bundler.ui.info "The Gemfile's dependencies are satisfied"
|
37
37
|
end
|
38
38
|
end
|
data/lib/bundler/cli/common.rb
CHANGED
@@ -54,9 +54,12 @@ module Bundler
|
|
54
54
|
|
55
55
|
Bundler.definition.specs.each do |spec|
|
56
56
|
return spec if spec.name == name
|
57
|
-
specs << spec if regexp && spec.name
|
57
|
+
specs << spec if regexp && spec.name.match?(regexp)
|
58
58
|
end
|
59
59
|
|
60
|
+
default_spec = default_gem_spec(name)
|
61
|
+
specs << default_spec if default_spec
|
62
|
+
|
60
63
|
case specs.count
|
61
64
|
when 0
|
62
65
|
dep_in_other_group = Bundler.definition.current_dependencies.find {|dep|dep.name == name }
|
@@ -75,6 +78,11 @@ module Bundler
|
|
75
78
|
raise GemNotFound, gem_not_found_message(name, Bundler.definition.dependencies)
|
76
79
|
end
|
77
80
|
|
81
|
+
def self.default_gem_spec(name)
|
82
|
+
gem_spec = Gem::Specification.find_all_by_name(name).last
|
83
|
+
gem_spec if gem_spec&.default_gem?
|
84
|
+
end
|
85
|
+
|
78
86
|
def self.ask_for_spec_from(specs)
|
79
87
|
specs.each_with_index do |spec, index|
|
80
88
|
Bundler.ui.info "#{index.succ} : #{spec.name}", true
|
data/lib/bundler/cli/config.rb
CHANGED
@@ -2,17 +2,17 @@
|
|
2
2
|
|
3
3
|
module Bundler
|
4
4
|
class CLI::Config < Thor
|
5
|
-
class_option :parseable, :
|
5
|
+
class_option :parseable, type: :boolean, banner: "Use minimal formatting for more parseable output"
|
6
6
|
|
7
7
|
def self.scope_options
|
8
|
-
method_option :global, :
|
9
|
-
method_option :local, :
|
8
|
+
method_option :global, type: :boolean, banner: "Only change the global config"
|
9
|
+
method_option :local, type: :boolean, banner: "Only change the local config"
|
10
10
|
end
|
11
11
|
private_class_method :scope_options
|
12
12
|
|
13
|
-
desc "base NAME [VALUE]", "The Bundler 1 config interface", :
|
13
|
+
desc "base NAME [VALUE]", "The Bundler 1 config interface", hide: true
|
14
14
|
scope_options
|
15
|
-
method_option :delete, :
|
15
|
+
method_option :delete, type: :boolean, banner: "delete"
|
16
16
|
def base(name = nil, *value)
|
17
17
|
new_args =
|
18
18
|
if ARGV.size == 1
|
@@ -25,8 +25,9 @@ module Bundler
|
|
25
25
|
["config", "get", ARGV[1]]
|
26
26
|
end
|
27
27
|
|
28
|
-
|
29
|
-
|
28
|
+
message = "Using the `config` command without a subcommand [list, get, set, unset] is deprecated and will be removed in the future. Use `bundle #{new_args.join(" ")}` instead."
|
29
|
+
removed_message = "Using the `config` command without a subcommand [list, get, set, unset] is has been removed. Use `bundle #{new_args.join(" ")}` instead."
|
30
|
+
SharedHelpers.major_deprecation 3, message, removed_message: removed_message
|
30
31
|
|
31
32
|
Base.new(options, name, value, self).run
|
32
33
|
end
|
data/lib/bundler/cli/console.rb
CHANGED
@@ -9,8 +9,9 @@ module Bundler
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def run
|
12
|
-
|
13
|
-
|
12
|
+
message = "bundle console will be replaced by `bin/console` generated by `bundle gem <name>`"
|
13
|
+
removed_message = "bundle console has been replaced by `bin/console` generated by `bundle gem <name>`"
|
14
|
+
Bundler::SharedHelpers.major_deprecation 2, message, removed_message: removed_message
|
14
15
|
|
15
16
|
group ? Bundler.require(:default, *group.split(" ").map!(&:to_sym)) : Bundler.require
|
16
17
|
ARGV.clear
|
data/lib/bundler/cli/doctor.rb
CHANGED
@@ -6,8 +6,8 @@ require "fiddle"
|
|
6
6
|
|
7
7
|
module Bundler
|
8
8
|
class CLI::Doctor
|
9
|
-
DARWIN_REGEX = /\s+(.+) \(compatibility
|
10
|
-
LDD_REGEX = /\t\S+ => (\S+) \(\S+\)
|
9
|
+
DARWIN_REGEX = /\s+(.+) \(compatibility /
|
10
|
+
LDD_REGEX = /\t\S+ => (\S+) \(\S+\)/
|
11
11
|
|
12
12
|
attr_reader :options
|
13
13
|
|
data/lib/bundler/cli/exec.rb
CHANGED
@@ -12,7 +12,7 @@ module Bundler
|
|
12
12
|
@options = options
|
13
13
|
@cmd = args.shift
|
14
14
|
@args = args
|
15
|
-
@args << { :
|
15
|
+
@args << { close_others: !options.keep_file_descriptors? } unless Bundler.current_ruby.jruby?
|
16
16
|
end
|
17
17
|
|
18
18
|
def run
|