Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .github/workflows/compilers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ jobs:
with: { sparse-checkout-cone-mode: false, sparse-checkout: /.github }
# Set fetch-depth: 10 so that Launchable can receive commits information.
- { uses: './.github/actions/setup/directories', with: { srcdir: 'src', builddir: 'build', makeup: true, fetch-depth: 10 } }
- name: 'clang 18 LTO'
- name: 'clang 22 LTO'
uses: './.github/actions/compilers'
with:
tag: clang-18
with_gcc: 'clang-18 -flto=auto'
tag: clang-22
with_gcc: 'clang-22 -flto=auto'
optflags: '-O2'
enable_shared: false
timeout-minutes: 30
Expand Down Expand Up @@ -107,6 +107,7 @@ jobs:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with: { sparse-checkout-cone-mode: false, sparse-checkout: /.github }
- { uses: './.github/actions/setup/directories', with: { srcdir: 'src', builddir: 'build', makeup: true, fetch-depth: 10 } }
- { uses: './.github/actions/compilers', name: 'clang 23', with: { tag: 'clang-23' }, timeout-minutes: 5 }
- { uses: './.github/actions/compilers', name: 'clang 22', with: { tag: 'clang-22' }, timeout-minutes: 5 }
- { uses: './.github/actions/compilers', name: 'clang 21', with: { tag: 'clang-21' }, timeout-minutes: 5 }
- { uses: './.github/actions/compilers', name: 'clang 20', with: { tag: 'clang-20' }, timeout-minutes: 5 }
Expand Down
2 changes: 1 addition & 1 deletion lib/bundler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def auto_switch
self_manager.restart_with_locked_bundler_if_needed
end

# Automatically install dependencies if settings[:auto_install] exists.
# Automatically install dependencies if <tt>settings[:auto_install]</tt> exists.
# This is set through config cmd `bundle config set --global auto_install 1`.
#
# Note that this method `nil`s out the global Definition object, so it
Expand Down
21 changes: 2 additions & 19 deletions lib/rubygems/package.rb
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ def normalize_path(pathname) # :nodoc:
##
# Loads a Gem::Specification from the TarEntry +entry+

def load_spec(entry) # :nodoc:
def load_spec_from_metadata(entry) # :nodoc:
limit = 10 * 1024 * 1024
case entry.full_name
when "metadata" then
Expand Down Expand Up @@ -678,12 +678,7 @@ def verify_entry(entry)
digest entry
end

case file_name
when "metadata", "metadata.gz" then
load_spec entry
when "data.tar.gz" then
verify_gz entry
end
load_spec_from_metadata entry
rescue StandardError
warn "Exception while verifying #{@gem.path}"
raise
Expand Down Expand Up @@ -711,18 +706,6 @@ def verify_files(gem)
end
end

##
# Verifies that +entry+ is a valid gzipped file.

def verify_gz(entry) # :nodoc:
Zlib::GzipReader.wrap entry do |gzio|
# TODO: read into a buffer once zlib supports it
gzio.read 16_384 until gzio.eof? # gzip checksum verification
end
rescue Zlib::GzipFile::Error => e
raise Gem::Package::FormatError.new(e.message, entry.full_name)
end

if RUBY_ENGINE == "truffleruby"
def copy_stream(src, dst, size) # :nodoc:
dst.write src.read(size)
Expand Down
8 changes: 0 additions & 8 deletions spec/bundler/commands/clean_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -913,12 +913,10 @@ def should_not_have_gems(*gems)
# Simulate that the locked bundler version is installed in the bundle path
# by creating the gem directory and gemspec (as would happen after bundle install with that version)
Pathname(vendored_gems("cache/bundler-#{version}.gem")).tap do |path|
path.basename.mkpath
FileUtils.touch(path)
end
FileUtils.touch(vendored_gems("gems/bundler-#{version}"))
Pathname(vendored_gems("specifications/bundler-#{version}.gemspec")).tap do |path|
path.basename.mkpath
path.write(<<~GEMSPEC)
Gem::Specification.new do |s|
s.name = "bundler"
Expand All @@ -934,11 +932,5 @@ def should_not_have_gems(*gems)
bundle :clean

should_have_gems "bundler-#{version}"
ensure
["bundler-#{version}.gem", "bundler-#{version}.gemspec"].each do |filename|
Pathname(vendored_gems(filename)).tap do |path|
FileUtils.rm_rf(path.basename)
end
end
end
end
4 changes: 2 additions & 2 deletions test/rubygems/test_gem_package.rb
Original file line number Diff line number Diff line change
Expand Up @@ -858,15 +858,15 @@ def test_install_location_suffix
"#{@destination} is not allowed", e.message)
end

def test_load_spec
def test_load_spec_from_metadata
entry = StringIO.new Gem::Util.gzip @spec.to_yaml
def entry.full_name
"metadata.gz"
end

package = Gem::Package.new "nonexistent.gem"

spec = package.load_spec entry
spec = package.load_spec_from_metadata entry

assert_equal @spec, spec
end
Expand Down