diff --git a/bundler/lib/bundler/installer.rb b/bundler/lib/bundler/installer.rb index f9df8e983f3c..023c85bcdc8e 100644 --- a/bundler/lib/bundler/installer.rb +++ b/bundler/lib/bundler/installer.rb @@ -299,7 +299,7 @@ def create_bundle_path # returns whether or not a re-resolve was needed def resolve_if_needed(options) - if !@definition.unlocking? && !options["force"] && !options["all-platforms"] && !Bundler.settings[:inline] && Bundler.default_lockfile.file? + if !@definition.unlocking? && !options["force"] && !Bundler.settings[:inline] && Bundler.default_lockfile.file? return false if @definition.nothing_changed? && !@definition.missing_specs? end diff --git a/bundler/lib/bundler/spec_set.rb b/bundler/lib/bundler/spec_set.rb index 46e023de8754..aef854ce0c24 100644 --- a/bundler/lib/bundler/spec_set.rb +++ b/bundler/lib/bundler/spec_set.rb @@ -100,6 +100,7 @@ def materialized_for_all_platforms @specs.map do |s| next s unless s.is_a?(LazySpecification) s.source.dependency_names = names if s.source.respond_to?(:dependency_names=) + s.source.remote! spec = s.__materialize__ raise GemNotFound, "Could not find #{s.full_name} in any of the sources" unless spec spec diff --git a/bundler/spec/install/gemfile/specific_platform_spec.rb b/bundler/spec/install/gemfile/specific_platform_spec.rb index 44991ef982d2..42127cc9e0ec 100644 --- a/bundler/spec/install/gemfile/specific_platform_spec.rb +++ b/bundler/spec/install/gemfile/specific_platform_spec.rb @@ -25,12 +25,27 @@ ]) end - it "caches both the universal-darwin and ruby gems when --all-platforms is passed" do + it "caches both the universal-darwin and ruby gems when --all-platforms is passed and properly picks them up on further bundler invocations" do setup_multiplatform_gem gemfile(google_protobuf) - bundle "package --all-platforms" + bundle "cache --all-platforms" expect([cached_gem("google-protobuf-3.0.0.alpha.5.0.5.1"), cached_gem("google-protobuf-3.0.0.alpha.5.0.5.1-universal-darwin")]). to all(exist) + + bundle "install --verbose" + expect(err).to be_empty + end + + it "caches both the universal-darwin and ruby gems when cache_all_platforms is configured and properly picks them up on further bundler invocations" do + setup_multiplatform_gem + gemfile(google_protobuf) + bundle "config set --local cache_all_platforms true" + bundle "cache" + expect([cached_gem("google-protobuf-3.0.0.alpha.5.0.5.1"), cached_gem("google-protobuf-3.0.0.alpha.5.0.5.1-universal-darwin")]). + to all(exist) + + bundle "install --verbose" + expect(err).to be_empty end it "caches multiplatform git gems with a single gemspec when --all-platforms is passed" do