@@ -33,7 +33,7 @@ def self.from_spec(s)
3333 lazy_spec
3434 end
3535
36- def initialize ( name , version , platform , source = nil )
36+ def initialize ( name , version , platform , source = nil , ** materialization_options )
3737 @name = name
3838 @version = version
3939 @dependencies = [ ]
@@ -43,6 +43,7 @@ def initialize(name, version, platform, source = nil)
4343
4444 @original_source = source
4545 @source = source
46+ @materialization_options = materialization_options
4647
4748 @force_ruby_platform = default_force_ruby_platform
4849 @most_specific_locked_platform = nil
@@ -226,12 +227,13 @@ def choose_compatible(candidates, fallback_to_non_installable: Bundler.frozen_bu
226227 # Validate dependencies of this locked spec are consistent with dependencies
227228 # of the actual spec that was materialized.
228229 #
229- # Note that we don't validate dependencies of locally installed gems but
230+ # Note that unless we are in strict mode (which we set during installation)
231+ # we don't validate dependencies of locally installed gems but
230232 # accept what's in the lockfile instead for performance, since loading
231233 # dependencies of locally installed gems would mean evaluating all gemspecs,
232234 # which would affect `bundler/setup` performance.
233235 def validate_dependencies ( spec )
234- if spec . is_a? ( StubSpecification )
236+ if ! @materialization_options [ :strict ] && spec . is_a? ( StubSpecification )
235237 spec . dependencies = dependencies
236238 else
237239 if !source . is_a? ( Source ::Path ) && spec . runtime_dependencies . sort != dependencies . sort
0 commit comments