Update Bundler to 2.4.1 & and RubyGems to 3.4.1
This commit is contained in:
parent
3cbe37bd35
commit
8f05e4f54b
Notes:
git
2022-12-24 20:55:55 +00:00
@ -311,7 +311,16 @@ module Bundler
|
|||||||
def prepare_dependencies(requirements, packages)
|
def prepare_dependencies(requirements, packages)
|
||||||
to_dependency_hash(requirements, packages).map do |dep_package, dep_constraint|
|
to_dependency_hash(requirements, packages).map do |dep_package, dep_constraint|
|
||||||
name = dep_package.name
|
name = dep_package.name
|
||||||
next if dep_package.platforms.empty?
|
|
||||||
|
# If a dependency is scoped to a platform different from the current
|
||||||
|
# one, we ignore it. However, it may reappear during resolution as a
|
||||||
|
# transitive dependency of another package, so we need to reset the
|
||||||
|
# package so the proper versions are considered if reintroduced later.
|
||||||
|
if dep_package.platforms.empty?
|
||||||
|
@packages.delete(name)
|
||||||
|
next
|
||||||
|
end
|
||||||
|
|
||||||
next [dep_package, dep_constraint] if name == "bundler"
|
next [dep_package, dep_constraint] if name == "bundler"
|
||||||
next [dep_package, dep_constraint] unless versions_for(dep_package, dep_constraint.range).empty?
|
next [dep_package, dep_constraint] unless versions_for(dep_package, dep_constraint.range).empty?
|
||||||
next unless dep_package.current_platform?
|
next unless dep_package.current_platform?
|
||||||
|
@ -58,6 +58,7 @@ module Bundler
|
|||||||
@explicit_ref = branch || tag || ref
|
@explicit_ref = branch || tag || ref
|
||||||
@revision = revision
|
@revision = revision
|
||||||
@git = git
|
@git = git
|
||||||
|
@commit_ref = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
def revision
|
def revision
|
||||||
@ -116,7 +117,7 @@ module Bundler
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
git "fetch", "--force", "--quiet", *extra_fetch_args, :dir => destination
|
git "fetch", "--force", "--quiet", *extra_fetch_args, :dir => destination if @commit_ref
|
||||||
|
|
||||||
git "reset", "--hard", @revision, :dir => destination
|
git "reset", "--hard", @revision, :dir => destination
|
||||||
|
|
||||||
@ -185,11 +186,16 @@ module Bundler
|
|||||||
end
|
end
|
||||||
|
|
||||||
def refspec
|
def refspec
|
||||||
return ref if pinned_to_full_sha?
|
commit = pinned_to_full_sha? ? ref : @revision
|
||||||
|
|
||||||
ref_to_fetch = @revision || fully_qualified_ref
|
if commit
|
||||||
|
@commit_ref = "refs/#{commit}-sha"
|
||||||
|
return "#{commit}:#{@commit_ref}"
|
||||||
|
end
|
||||||
|
|
||||||
ref_to_fetch ||= if ref.include?("~")
|
reference = fully_qualified_ref
|
||||||
|
|
||||||
|
reference ||= if ref.include?("~")
|
||||||
ref.split("~").first
|
ref.split("~").first
|
||||||
elsif ref.start_with?("refs/")
|
elsif ref.start_with?("refs/")
|
||||||
ref
|
ref
|
||||||
@ -197,7 +203,7 @@ module Bundler
|
|||||||
"refs/*"
|
"refs/*"
|
||||||
end
|
end
|
||||||
|
|
||||||
"#{ref_to_fetch}:#{ref_to_fetch}"
|
"#{reference}:#{reference}"
|
||||||
end
|
end
|
||||||
|
|
||||||
def fully_qualified_ref
|
def fully_qualified_ref
|
||||||
@ -218,10 +224,6 @@ module Bundler
|
|||||||
ref =~ /\A\h{40}\z/
|
ref =~ /\A\h{40}\z/
|
||||||
end
|
end
|
||||||
|
|
||||||
def legacy_locked_revision?
|
|
||||||
!@revision.nil? && @revision =~ /\A\h{7}\z/
|
|
||||||
end
|
|
||||||
|
|
||||||
def git_null(*command, dir: nil)
|
def git_null(*command, dir: nil)
|
||||||
check_allowed(command)
|
check_allowed(command)
|
||||||
|
|
||||||
@ -241,9 +243,9 @@ module Bundler
|
|||||||
|
|
||||||
out, err, status = capture(command, dir)
|
out, err, status = capture(command, dir)
|
||||||
|
|
||||||
Bundler.ui.warn err unless err.empty?
|
raise GitCommandError.new(command_with_no_credentials, dir || SharedHelpers.pwd, err) unless status.success?
|
||||||
|
|
||||||
raise GitCommandError.new(command_with_no_credentials, dir || SharedHelpers.pwd, out) unless status.success?
|
Bundler.ui.warn err unless err.empty?
|
||||||
|
|
||||||
out
|
out
|
||||||
end
|
end
|
||||||
@ -344,9 +346,10 @@ module Bundler
|
|||||||
end
|
end
|
||||||
|
|
||||||
def extra_clone_args
|
def extra_clone_args
|
||||||
return [] if full_clone?
|
args = depth_args
|
||||||
|
return [] if args.empty?
|
||||||
|
|
||||||
args = ["--depth", depth.to_s, "--single-branch"]
|
args += ["--single-branch"]
|
||||||
args.unshift("--no-tags") if supports_cloning_with_no_tags?
|
args.unshift("--no-tags") if supports_cloning_with_no_tags?
|
||||||
|
|
||||||
args += ["--branch", branch || tag] if branch || tag
|
args += ["--branch", branch || tag] if branch || tag
|
||||||
@ -361,7 +364,7 @@ module Bundler
|
|||||||
|
|
||||||
def extra_fetch_args
|
def extra_fetch_args
|
||||||
extra_args = [path.to_s, *depth_args]
|
extra_args = [path.to_s, *depth_args]
|
||||||
extra_args.push(revision) unless legacy_locked_revision?
|
extra_args.push(@commit_ref)
|
||||||
extra_args
|
extra_args
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
# frozen_string_literal: false
|
# frozen_string_literal: false
|
||||||
|
|
||||||
module Bundler
|
module Bundler
|
||||||
VERSION = "2.4.0".freeze
|
VERSION = "2.4.1".freeze
|
||||||
|
|
||||||
def self.bundler_major_version
|
def self.bundler_major_version
|
||||||
@bundler_major_version ||= VERSION.split(".").first.to_i
|
@bundler_major_version ||= VERSION.split(".").first.to_i
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
require "rbconfig"
|
require "rbconfig"
|
||||||
|
|
||||||
module Gem
|
module Gem
|
||||||
VERSION = "3.4.0".freeze
|
VERSION = "3.4.1".freeze
|
||||||
end
|
end
|
||||||
|
|
||||||
# Must be first since it unloads the prelude from 1.9.2
|
# Must be first since it unloads the prelude from 1.9.2
|
||||||
|
@ -15,7 +15,7 @@ else
|
|||||||
require "bundler"
|
require "bundler"
|
||||||
end
|
end
|
||||||
|
|
||||||
if Gem.rubygems_version < Gem::Version.new("3.2.3") && Gem.ruby_version < Gem::Version.new("3.0.a") && !ENV["BUNDLER_NO_OLD_RUBYGEMS_WARNING"]
|
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"]
|
||||||
Bundler.ui.warn \
|
Bundler.ui.warn \
|
||||||
"Your RubyGems version (#{Gem::VERSION}) has a bug that prevents " \
|
"Your RubyGems version (#{Gem::VERSION}) has a bug that prevents " \
|
||||||
"`required_ruby_version` from working for Bundler. Any scripts that use " \
|
"`required_ruby_version` from working for Bundler. Any scripts that use " \
|
||||||
|
@ -193,6 +193,7 @@ RSpec.describe "bundle install with git sources" do
|
|||||||
gem "foo"
|
gem "foo"
|
||||||
end
|
end
|
||||||
G
|
G
|
||||||
|
expect(err).to be_empty
|
||||||
|
|
||||||
run <<-RUBY
|
run <<-RUBY
|
||||||
require 'foo'
|
require 'foo'
|
||||||
|
@ -572,6 +572,26 @@ RSpec.describe "bundle install with platform conditionals" do
|
|||||||
#{Bundler::VERSION}
|
#{Bundler::VERSION}
|
||||||
L
|
L
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it "resolves fine when a dependency is unused on a platform different from the current one, but reintroduced transitively" do
|
||||||
|
bundle "config set --local force_ruby_platform true"
|
||||||
|
|
||||||
|
build_repo4 do
|
||||||
|
build_gem "listen", "3.7.1" do |s|
|
||||||
|
s.add_dependency "ffi"
|
||||||
|
end
|
||||||
|
|
||||||
|
build_gem "ffi", "1.15.5"
|
||||||
|
end
|
||||||
|
|
||||||
|
install_gemfile <<~G
|
||||||
|
source "#{file_uri_for(gem_repo4)}"
|
||||||
|
|
||||||
|
gem "listen"
|
||||||
|
gem "ffi", :platform => :windows
|
||||||
|
G
|
||||||
|
expect(err).to be_empty
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
RSpec.describe "when a gem has no architecture" do
|
RSpec.describe "when a gem has no architecture" do
|
||||||
|
@ -90,6 +90,42 @@ RSpec.describe "bundle lock with git gems" do
|
|||||||
expect(err).to be_empty
|
expect(err).to be_empty
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it "properly fetches a git source locked to an annotated tag" do
|
||||||
|
# Create an annotated tag
|
||||||
|
git("tag -a v1.0 -m 'Annotated v1.0'", lib_path("foo-1.0"))
|
||||||
|
annotated_tag = git("rev-parse v1.0", lib_path("foo-1.0"))
|
||||||
|
|
||||||
|
gemfile <<-G
|
||||||
|
source "#{file_uri_for(gem_repo1)}"
|
||||||
|
gem 'foo', :git => "#{lib_path("foo-1.0")}"
|
||||||
|
G
|
||||||
|
|
||||||
|
lockfile <<-L
|
||||||
|
GIT
|
||||||
|
remote: #{lib_path("foo-1.0")}
|
||||||
|
revision: #{annotated_tag}
|
||||||
|
specs:
|
||||||
|
foo (1.0)
|
||||||
|
|
||||||
|
GEM
|
||||||
|
remote: #{file_uri_for(gem_repo1)}/
|
||||||
|
specs:
|
||||||
|
|
||||||
|
PLATFORMS
|
||||||
|
#{lockfile_platforms}
|
||||||
|
|
||||||
|
DEPENDENCIES
|
||||||
|
foo!
|
||||||
|
|
||||||
|
BUNDLED WITH
|
||||||
|
#{Bundler::VERSION}
|
||||||
|
L
|
||||||
|
|
||||||
|
bundle "install"
|
||||||
|
|
||||||
|
expect(err).to be_empty
|
||||||
|
end
|
||||||
|
|
||||||
it "provides correct #full_gem_path" do
|
it "provides correct #full_gem_path" do
|
||||||
run <<-RUBY
|
run <<-RUBY
|
||||||
puts Bundler.rubygems.find_name('foo').first.full_gem_path
|
puts Bundler.rubygems.find_name('foo').first.full_gem_path
|
||||||
|
@ -54,4 +54,4 @@ DEPENDENCIES
|
|||||||
webrick (~> 1.6)
|
webrick (~> 1.6)
|
||||||
|
|
||||||
BUNDLED WITH
|
BUNDLED WITH
|
||||||
2.4.0
|
2.4.1
|
||||||
|
@ -70,4 +70,4 @@ DEPENDENCIES
|
|||||||
test-unit
|
test-unit
|
||||||
|
|
||||||
BUNDLED WITH
|
BUNDLED WITH
|
||||||
2.4.0
|
2.4.1
|
||||||
|
@ -78,4 +78,4 @@ DEPENDENCIES
|
|||||||
test-unit
|
test-unit
|
||||||
|
|
||||||
BUNDLED WITH
|
BUNDLED WITH
|
||||||
2.4.0
|
2.4.1
|
||||||
|
@ -42,4 +42,4 @@ DEPENDENCIES
|
|||||||
webrick (= 1.7.0)
|
webrick (= 1.7.0)
|
||||||
|
|
||||||
BUNDLED WITH
|
BUNDLED WITH
|
||||||
2.4.0
|
2.4.1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user