From c5fd94073ff2e22b6eea29c242c7e4a12ed7c865 Mon Sep 17 00:00:00 2001 From: Samuel Giddins Date: Wed, 9 Aug 2023 13:45:56 -0700 Subject: [rubygems/rubygems] Refactor to checksums stored via source This gets the specs passing, and handles the fact that we expect checkums to be pinned only to a particular source This also avoids reading in .gem files during lockfile generation, instead allowing us to query the source for each resolved gem to grab the checksum Finally, this opens up a route to having user-stored checksum databases, similar to how other package managers do this! Add checksums to dev lockfiles Handle full name conflicts from different original_platforms when adding checksums to store from compact index Specs passing on Bundler 3 https://github.com/rubygems/rubygems/commit/86c7084e1c --- lib/bundler/source/path.rb | 1 + lib/bundler/source/rubygems.rb | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/bundler/source') diff --git a/lib/bundler/source/path.rb b/lib/bundler/source/path.rb index bdfcf8274a..cdf871250a 100644 --- a/lib/bundler/source/path.rb +++ b/lib/bundler/source/path.rb @@ -14,6 +14,7 @@ module Bundler DEFAULT_GLOB = "{,*,*/*}.gemspec" def initialize(options) + @checksum_store = Checksum::Store.new @options = options.dup @glob = options["glob"] || DEFAULT_GLOB diff --git a/lib/bundler/source/rubygems.rb b/lib/bundler/source/rubygems.rb index 3d4d2eeec1..9ea8367006 100644 --- a/lib/bundler/source/rubygems.rb +++ b/lib/bundler/source/rubygems.rb @@ -19,6 +19,7 @@ module Bundler @allow_remote = false @allow_cached = false @allow_local = options["allow_local"] || false + @checksum_store = Checksum::Store.new Array(options["remotes"]).reverse_each {|r| add_remote(r) } end @@ -177,7 +178,7 @@ module Bundler :wrappers => true, :env_shebang => true, :build_args => options[:build_args], - :bundler_expected_checksum => spec.respond_to?(:checksum) && spec.checksum, + :bundler_checksum_store => spec.source.checksum_store, :bundler_extension_cache_path => extension_cache_path(spec) ) -- cgit v1.2.3