summaryrefslogtreecommitdiff
path: root/lib/bundler/lazy_specification.rb
diff options
context:
space:
mode:
authorThong Kuah <tkuah@gitlab.com>2022-08-01 11:42:18 +1200
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2023-10-23 13:59:01 +0900
commitad08674d8dc17c4ca031ce20760c4a4779c83e27 (patch)
treebf4958d6f06c36051f9c65e53c9e615ea1d978b2 /lib/bundler/lazy_specification.rb
parent2d468358a516f575d013f07801079e0906c61f0c (diff)
[rubygems/rubygems] Add CHECKSUMS for each gem in lockfile
We lock the checksum for each resolved spec under a new CHECKSUMS section in the lockfile. If the locked spec does not resolve for the local platform, we preserve the locked checksum, similar to how we preserve specs. Checksum locking only makes sense on install. The compact index information is only available then. https://github.com/rubygems/rubygems/commit/bde37ca6bf
Diffstat (limited to 'lib/bundler/lazy_specification.rb')
-rw-r--r--lib/bundler/lazy_specification.rb26
1 files changed, 26 insertions, 0 deletions
diff --git a/lib/bundler/lazy_specification.rb b/lib/bundler/lazy_specification.rb
index c9b161dc0e..b4aadb0b5c 100644
--- a/lib/bundler/lazy_specification.rb
+++ b/lib/bundler/lazy_specification.rb
@@ -76,6 +76,18 @@ module Bundler
out
end
+ #def materialize_for_checksum
+ #if @specification
+ #yield
+ #else
+ #materialize_for_installation
+
+ #yield
+
+ #@specification = nil
+ #end
+ #end
+
def materialize_for_installation
source.local!
@@ -134,6 +146,20 @@ module Bundler
" #{source.revision[0..6]}"
end
+ def to_checksum
+ return nil unless @specification
+
+ #
+ # See comment about #ruby_platform_materializes_to_ruby_platform?
+ # If the old lockfile format is present where there is no specific
+ # platform, then we should skip locking checksums as it is not
+ # deterministic which platform variant is locked.
+ #
+ return nil unless ruby_platform_materializes_to_ruby_platform?
+
+ @specification.to_checksum
+ end
+
private
def use_exact_resolved_specifications?