bundler 1.13.7 → 1.14.0.pre.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of bundler might be problematic. Click here for more details.

Files changed (112) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -0
  3. data/.rubocop_todo.yml +100 -18
  4. data/.travis.yml +32 -18
  5. data/CHANGELOG.md +64 -2
  6. data/DEVELOPMENT.md +5 -3
  7. data/ISSUES.md +17 -0
  8. data/README.md +7 -0
  9. data/Rakefile +34 -23
  10. data/bin/rubocop +1 -1
  11. data/bundler.gemspec +2 -2
  12. data/exe/bundle +4 -6
  13. data/lib/bundler.rb +57 -5
  14. data/lib/bundler/cli.rb +51 -38
  15. data/lib/bundler/cli/binstubs.rb +1 -1
  16. data/lib/bundler/cli/cache.rb +1 -1
  17. data/lib/bundler/cli/check.rb +1 -1
  18. data/lib/bundler/cli/clean.rb +1 -1
  19. data/lib/bundler/cli/common.rb +30 -0
  20. data/lib/bundler/cli/doctor.rb +17 -19
  21. data/lib/bundler/cli/exec.rb +6 -0
  22. data/lib/bundler/cli/gem.rb +18 -4
  23. data/lib/bundler/cli/install.rb +9 -25
  24. data/lib/bundler/cli/lock.rb +8 -7
  25. data/lib/bundler/cli/outdated.rb +163 -56
  26. data/lib/bundler/cli/platform.rb +1 -1
  27. data/lib/bundler/cli/show.rb +1 -1
  28. data/lib/bundler/cli/update.rb +10 -23
  29. data/lib/bundler/compact_index_client.rb +108 -0
  30. data/lib/bundler/compact_index_client/cache.rb +119 -0
  31. data/lib/bundler/compact_index_client/updater.rb +88 -0
  32. data/lib/bundler/current_ruby.rb +4 -3
  33. data/lib/bundler/definition.rb +107 -17
  34. data/lib/bundler/dependency.rb +6 -0
  35. data/lib/bundler/dsl.rb +3 -2
  36. data/lib/bundler/env.rb +27 -18
  37. data/lib/bundler/errors.rb +22 -0
  38. data/lib/bundler/feature_flag.rb +32 -0
  39. data/lib/bundler/fetcher.rb +2 -2
  40. data/lib/bundler/fetcher/compact_index.rb +17 -5
  41. data/lib/bundler/fetcher/dependency.rb +1 -1
  42. data/lib/bundler/fetcher/downloader.rb +11 -0
  43. data/lib/bundler/friendly_errors.rb +28 -7
  44. data/lib/bundler/gem_helper.rb +1 -1
  45. data/lib/bundler/gem_helpers.rb +69 -1
  46. data/lib/bundler/gemdeps.rb +28 -0
  47. data/lib/bundler/index.rb +9 -4
  48. data/lib/bundler/inline.rb +3 -3
  49. data/lib/bundler/installer.rb +3 -2
  50. data/lib/bundler/installer/gem_installer.rb +2 -2
  51. data/lib/bundler/installer/parallel_installer.rb +40 -9
  52. data/lib/bundler/lazy_specification.rb +16 -1
  53. data/lib/bundler/lockfile_parser.rb +1 -2
  54. data/lib/bundler/match_platform.rb +12 -3
  55. data/lib/bundler/plugin.rb +4 -2
  56. data/lib/bundler/plugin/api.rb +2 -1
  57. data/lib/bundler/plugin/api/source.rb +1 -1
  58. data/lib/bundler/postit_trampoline.rb +12 -7
  59. data/lib/bundler/remote_specification.rb +5 -0
  60. data/lib/bundler/resolver.rb +59 -49
  61. data/lib/bundler/retry.rb +4 -1
  62. data/lib/bundler/ruby_version.rb +5 -0
  63. data/lib/bundler/rubygems_ext.rb +5 -0
  64. data/lib/bundler/rubygems_gem_installer.rb +60 -0
  65. data/lib/bundler/rubygems_integration.rb +28 -2
  66. data/lib/bundler/runtime.rb +2 -1
  67. data/lib/bundler/settings.rb +29 -5
  68. data/lib/bundler/setup.rb +1 -1
  69. data/lib/bundler/shared_helpers.rb +26 -15
  70. data/lib/bundler/source.rb +5 -0
  71. data/lib/bundler/source/git.rb +1 -1
  72. data/lib/bundler/source/git/git_proxy.rb +5 -0
  73. data/lib/bundler/source/path.rb +6 -1
  74. data/lib/bundler/source/rubygems.rb +11 -1
  75. data/lib/bundler/spec_set.rb +32 -13
  76. data/lib/bundler/templates/newgem/README.md.tt +1 -1
  77. data/lib/bundler/templates/newgem/bin/console.tt +1 -1
  78. data/lib/bundler/templates/newgem/gitignore.tt +5 -0
  79. data/lib/bundler/templates/newgem/spec/newgem_spec.rb.tt +1 -1
  80. data/lib/bundler/templates/newgem/spec/spec_helper.rb.tt +10 -1
  81. data/lib/bundler/ui/shell.rb +4 -0
  82. data/lib/bundler/ui/silent.rb +9 -0
  83. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +7 -0
  84. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/action.rb +1 -1
  85. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb +2 -2
  86. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_vertex.rb +2 -2
  87. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/delete_edge.rb +62 -0
  88. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb +1 -1
  89. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/log.rb +12 -1
  90. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb +2 -2
  91. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/tag.rb +2 -2
  92. data/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb +1 -1
  93. data/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +22 -13
  94. data/lib/bundler/vendor/{net → net-http-persistent/lib/net}/http/faster.rb +1 -0
  95. data/lib/bundler/vendor/{net → net-http-persistent/lib/net}/http/persistent.rb +24 -23
  96. data/lib/bundler/vendor/{net → net-http-persistent/lib/net}/http/persistent/ssl_reuse.rb +2 -1
  97. data/lib/bundler/vendored_persistent.rb +9 -4
  98. data/lib/bundler/version.rb +1 -1
  99. data/lib/bundler/worker.rb +27 -5
  100. data/lib/bundler/yaml_serializer.rb +1 -1
  101. data/man/bundle-config.ronn +29 -2
  102. data/man/bundle-install.ronn +1 -1
  103. data/man/bundle-lock.ronn +47 -0
  104. data/man/bundle-outdated.ronn +107 -0
  105. data/man/bundle-update.ronn +152 -3
  106. data/man/bundle.ronn +27 -9
  107. data/man/gemfile.5.ronn +8 -0
  108. metadata +37 -31
  109. data/lib/bundler/vendor/compact_index_client/lib/compact_index_client.rb +0 -79
  110. data/lib/bundler/vendor/compact_index_client/lib/compact_index_client/cache.rb +0 -112
  111. data/lib/bundler/vendor/compact_index_client/lib/compact_index_client/updater.rb +0 -80
  112. data/lib/bundler/vendor/compact_index_client/lib/compact_index_client/version.rb +0 -4
@@ -43,7 +43,10 @@ module Bundler
43
43
 
44
44
  def fail_attempt(e)
45
45
  @failed = true
46
- raise e if last_attempt? || @exceptions.any? {|k| e.is_a?(k) }
46
+ if last_attempt? || @exceptions.any? {|k| e.is_a?(k) }
47
+ Bundler.ui.info "" unless Bundler.ui.debug?
48
+ raise e
49
+ end
47
50
  return true unless name
48
51
  Bundler.ui.info "" unless Bundler.ui.debug? # Add new line incase dots preceded this
49
52
  Bundler.ui.warn "Retrying #{name} due to error (#{current_run.next}/#{total_runs}): #{e.class} #{e.message}", Bundler.ui.debug?
@@ -128,6 +128,11 @@ module Bundler
128
128
  end
129
129
  end
130
130
 
131
+ def exact?
132
+ return @exact if defined?(@exact)
133
+ @exact = versions.all? {|v| Gem::Requirement.create(v).exact? }
134
+ end
135
+
131
136
  private
132
137
 
133
138
  def matches?(requirements, version)
@@ -169,6 +169,11 @@ module Gem
169
169
  def none?
170
170
  @none ||= (to_s == ">= 0")
171
171
  end unless allocate.respond_to?(:none?)
172
+
173
+ def exact?
174
+ return false unless @requirements.size == 1
175
+ @requirements[0][0] == "="
176
+ end unless allocate.respond_to?(:exact?)
172
177
  end
173
178
 
174
179
  class Platform
@@ -12,5 +12,65 @@ module Bundler
12
12
  def check_executable_overwrite(filename)
13
13
  # Bundler needs to install gems regardless of binstub overwriting
14
14
  end
15
+
16
+ def pre_install_checks
17
+ super && validate_bundler_checksum(options[:bundler_expected_checksum])
18
+ end
19
+
20
+ private
21
+
22
+ def validate_bundler_checksum(checksum)
23
+ return true if Bundler.settings[:disable_checksum_validation]
24
+ return true unless checksum
25
+ return true unless source = @package.instance_variable_get(:@gem)
26
+ return true unless source.respond_to?(:with_read_io)
27
+ digest = source.with_read_io do |io|
28
+ digest = Digest::SHA256.new
29
+ digest << io.read(16_384) until io.eof?
30
+ io.rewind
31
+ send(checksum_type(checksum), digest)
32
+ end
33
+ unless digest == checksum
34
+ raise SecurityError, <<-MESSAGE
35
+ Bundler cannot continue installing #{spec.name} (#{spec.version}).
36
+ The checksum for the downloaded `#{spec.full_name}.gem` does not match \
37
+ the checksum given by the server. This means the contents of the downloaded \
38
+ gem is different from what was uploaded to the server, and could be a potential security issue.
39
+
40
+ To resolve this issue:
41
+ 1. delete the downloaded gem located at: `#{spec.gem_dir}/#{spec.full_name}.gem`
42
+ 2. run `bundle install`
43
+
44
+ If you wish to continue installing the downloaded gem, and are certain it does not pose a \
45
+ security issue despite the mismatching checksum, do the following:
46
+ 1. run `bundle config disable.checksum_validation true` to turn off checksum verification
47
+ 2. run `bundle install`
48
+
49
+ (More info: The expected SHA256 checksum was #{checksum.inspect}, but the \
50
+ checksum for the downloaded gem was #{digest.inspect}.)
51
+ MESSAGE
52
+ end
53
+ true
54
+ end
55
+
56
+ def checksum_type(checksum)
57
+ case checksum.length
58
+ when 64 then :hexdigest!
59
+ when 44 then :base64digest!
60
+ else raise InstallError, "The given checksum for #{spec.full_name} (#{checksum.inspect}) is not a valid SHA256 hexdigest nor base64digest"
61
+ end
62
+ end
63
+
64
+ def hexdigest!(digest)
65
+ digest.hexdigest!
66
+ end
67
+
68
+ def base64digest!(digest)
69
+ if digest.respond_to?(:base64digest!)
70
+ digest.base64digest!
71
+ else
72
+ [digest.digest!].pack("m0")
73
+ end
74
+ end
15
75
  end
16
76
  end
@@ -71,8 +71,13 @@ module Bundler
71
71
  spec.installed_by_version = Gem::Version.create(installed_by_version)
72
72
  end
73
73
 
74
- def spec_missing_extensions?(spec)
75
- !spec.respond_to?(:missing_extensions?) || spec.missing_extensions?
74
+ def spec_missing_extensions?(spec, default = true)
75
+ return spec.missing_extensions? if spec.respond_to?(:missing_extensions?)
76
+
77
+ return false if spec.respond_to?(:default_gem?) && spec.default_gem?
78
+ return false if spec.extensions.empty?
79
+
80
+ default
76
81
  end
77
82
 
78
83
  def path(obj)
@@ -80,6 +85,7 @@ module Bundler
80
85
  end
81
86
 
82
87
  def platforms
88
+ return [Gem::Platform::RUBY] if Bundler.settings[:force_ruby_platform]
83
89
  Gem.platforms
84
90
  end
85
91
 
@@ -194,6 +200,10 @@ module Bundler
194
200
  end
195
201
  end
196
202
 
203
+ def load_plugins
204
+ Gem.load_plugins if Gem.respond_to?(:load_plugins)
205
+ end
206
+
197
207
  def ui=(obj)
198
208
  Gem::DefaultUserInteraction.ui = obj
199
209
  end
@@ -243,6 +253,10 @@ module Bundler
243
253
  end
244
254
  end
245
255
 
256
+ def install_with_build_args(args)
257
+ with_build_args(args) { yield }
258
+ end
259
+
246
260
  def gem_from_path(path, policy = nil)
247
261
  require "rubygems/format"
248
262
  Gem::Format.from_file_by_path(path, policy)
@@ -710,6 +724,10 @@ module Bundler
710
724
  def repository_subdirectories
711
725
  Gem::REPOSITORY_SUBDIRECTORIES
712
726
  end
727
+
728
+ def install_with_build_args(args)
729
+ yield
730
+ end
713
731
  end
714
732
 
715
733
  # RubyGems 2.1.0
@@ -750,6 +768,14 @@ module Bundler
750
768
  end.map(&:to_spec)
751
769
  end
752
770
  end
771
+
772
+ def use_gemdeps(gemfile)
773
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path(gemfile)
774
+ runtime = Bundler.setup
775
+ Bundler.ui = nil
776
+ activated_spec_names = runtime.requested_specs.map(&:to_spec).sort_by(&:name)
777
+ [Gemdeps.new(runtime), activated_spec_names]
778
+ end
753
779
  end
754
780
  end
755
781
 
@@ -140,7 +140,8 @@ module Bundler
140
140
 
141
141
  Bundler.ui.info "Updating files in #{Bundler.settings.app_cache_path}"
142
142
 
143
- specs.each do |spec|
143
+ specs_to_cache = Bundler.settings[:cache_all_platforms] ? @definition.resolve.materialized_for_all_platforms : specs
144
+ specs_to_cache.each do |spec|
144
145
  next if spec.name == "bundler"
145
146
  next if spec.source.is_a?(Source::Gemspec)
146
147
  spec.source.send(:fetch_gem, spec) if Bundler.settings[:cache_all_platforms] && spec.source.respond_to?(:fetch_gem, true)
@@ -7,6 +7,7 @@ module Bundler
7
7
  allow_offline_install
8
8
  auto_install
9
9
  cache_all
10
+ disable_checksum_validation
10
11
  disable_exec_load
11
12
  disable_local_branch_check
12
13
  disable_shared_gems
@@ -17,6 +18,7 @@ module Bundler
17
18
  major_deprecations
18
19
  no_install
19
20
  no_prune
21
+ force_ruby_platform
20
22
  only_update_to_newer_versions
21
23
  plugins
22
24
  silence_root_warning
@@ -42,11 +44,18 @@ module Bundler
42
44
  @local_config = load_config(local_config_file)
43
45
  @global_config = load_config(global_config_file)
44
46
  @cli_flags_given = false
47
+ @temporary = {}
45
48
  end
46
49
 
47
50
  def [](name)
48
51
  key = key_for(name)
49
- value = (@local_config[key] || ENV[key] || @global_config[key] || DEFAULT_CONFIG[name])
52
+ value = @temporary.fetch(name) do
53
+ @local_config.fetch(key) do
54
+ ENV.fetch(key) do
55
+ @global_config.fetch(key) do
56
+ DEFAULT_CONFIG.fetch(name) do
57
+ nil
58
+ end end end end end
50
59
 
51
60
  if value.nil?
52
61
  nil
@@ -76,9 +85,19 @@ module Bundler
76
85
  local_config_file || raise(GemfileNotFound, "Could not locate Gemfile")
77
86
  set_key(key, value, @local_config, local_config_file)
78
87
  end
79
-
80
88
  alias_method :set_local, :[]=
81
89
 
90
+ def temporary(update)
91
+ existing = Hash[update.map {|k, _| [k, @temporary[k]] }]
92
+ @temporary.update(update)
93
+ return unless block_given?
94
+ begin
95
+ yield
96
+ ensure
97
+ existing.each {|k, v| v.nil? ? @temporary.delete(k) : @temporary[k] = v }
98
+ end
99
+ end
100
+
82
101
  def delete(key)
83
102
  @local_config.delete(key_for(key))
84
103
  end
@@ -221,7 +240,12 @@ module Bundler
221
240
  end
222
241
 
223
242
  def to_bool(value)
224
- !(value.nil? || value == "" || value =~ /^(false|f|no|n|0)$/i || value == false)
243
+ case value
244
+ when nil, /\A(false|f|no|n|0|)\z/i, false
245
+ false
246
+ else
247
+ true
248
+ end
225
249
  end
226
250
 
227
251
  def is_num(value)
@@ -279,10 +303,10 @@ module Bundler
279
303
  }xo
280
304
 
281
305
  def load_config(config_file)
282
- return {} unless config_file
306
+ return {} if !config_file || ignore_config?
283
307
  SharedHelpers.filesystem_access(config_file, :read) do |file|
284
308
  valid_file = file.exist? && !file.size.zero?
285
- return {} if ignore_config? || !valid_file
309
+ return {} unless valid_file
286
310
  require "bundler/yaml_serializer"
287
311
  YAMLSerializer.load file.read
288
312
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
- require "bundler/postit_trampoline" unless ENV["BUNDLE_DISABLE_POSTIT"]
2
+ require "bundler/postit_trampoline"
3
3
  require "bundler/shared_helpers"
4
4
 
5
5
  if Bundler::SharedHelpers.in_bundle?
@@ -8,6 +8,7 @@ require "bundler/current_ruby"
8
8
 
9
9
  module Gem
10
10
  class Dependency
11
+ # This is only needed for RubyGems < 1.4
11
12
  unless method_defined? :requirement
12
13
  def requirement
13
14
  version_requirements
@@ -18,8 +19,6 @@ end
18
19
 
19
20
  module Bundler
20
21
  module SharedHelpers
21
- attr_accessor :gem_loaded
22
-
23
22
  def default_gemfile
24
23
  gemfile = find_gemfile
25
24
  raise GemfileNotFound, "Could not locate Gemfile" unless gemfile
@@ -39,10 +38,12 @@ module Bundler
39
38
  bundle_dir = find_directory(".bundle")
40
39
  return nil unless bundle_dir
41
40
 
42
- global_bundle_dir = File.join(Bundler.rubygems.user_home, ".bundle")
41
+ bundle_dir = Pathname.new(bundle_dir)
42
+
43
+ global_bundle_dir = Bundler.user_home.join(".bundle")
43
44
  return nil if bundle_dir == global_bundle_dir
44
45
 
45
- Pathname.new(bundle_dir)
46
+ bundle_dir
46
47
  end
47
48
 
48
49
  def in_bundle?
@@ -109,8 +110,14 @@ module Bundler
109
110
  raise TemporaryResourceError.new(path, action)
110
111
  rescue Errno::EPROTO
111
112
  raise VirtualProtocolError.new
113
+ rescue Errno::ENOSPC
114
+ raise NoSpaceOnDeviceError.new(path, action)
112
115
  rescue *[const_get_safely(:ENOTSUP, Errno)].compact
113
116
  raise OperationNotSupportedError.new(path, action)
117
+ rescue Errno::EEXIST, Errno::ENOENT
118
+ raise
119
+ rescue SystemCallError => e
120
+ raise GenericSystemCallError.new(e, "There was an error accessing `#{path}`.")
114
121
  end
115
122
 
116
123
  def const_get_safely(constant_name, namespace)
@@ -202,29 +209,33 @@ module Bundler
202
209
 
203
210
  def set_rubylib
204
211
  rubylib = (ENV["RUBYLIB"] || "").split(File::PATH_SEPARATOR)
205
- rubylib.unshift File.expand_path("../..", __FILE__)
212
+ rubylib.unshift bundler_ruby_lib
206
213
  ENV["RUBYLIB"] = rubylib.uniq.join(File::PATH_SEPARATOR)
207
214
  end
208
215
 
216
+ def bundler_ruby_lib
217
+ File.expand_path("../..", __FILE__)
218
+ end
219
+
209
220
  def clean_load_path
210
221
  # handle 1.9 where system gems are always on the load path
211
- if defined?(::Gem)
212
- me = File.expand_path("../../", __FILE__)
213
- me = /^#{Regexp.escape(me)}/
222
+ return unless defined?(::Gem)
214
223
 
215
- loaded_gem_paths = Bundler.rubygems.loaded_gem_paths
224
+ bundler_lib = bundler_ruby_lib
216
225
 
217
- $LOAD_PATH.reject! do |p|
218
- next if File.expand_path(p) =~ me
219
- loaded_gem_paths.delete(p)
220
- end
221
- $LOAD_PATH.uniq!
226
+ loaded_gem_paths = Bundler.rubygems.loaded_gem_paths
227
+
228
+ $LOAD_PATH.reject! do |p|
229
+ next if File.expand_path(p).start_with?(bundler_lib)
230
+ loaded_gem_paths.delete(p)
222
231
  end
232
+ $LOAD_PATH.uniq!
223
233
  end
224
234
 
225
235
  def prints_major_deprecations?
226
236
  require "bundler"
227
- return false unless Bundler.settings[:major_deprecations]
237
+ deprecation_release = Bundler::VERSION.split(".").drop(1).include?("99")
238
+ return false if !deprecation_release && !Bundler.settings[:major_deprecations]
228
239
  require "bundler/deprecate"
229
240
  return false if Bundler::Deprecate.skip
230
241
  true
@@ -14,6 +14,7 @@ module Bundler
14
14
 
15
15
  def version_message(spec)
16
16
  message = "#{spec.name} #{spec.version}"
17
+ message += " (#{spec.platform})" if spec.platform != Gem::Platform::RUBY && !spec.platform.nil?
17
18
 
18
19
  if Bundler.locked_gems
19
20
  locked_spec = Bundler.locked_gems.specs.find {|s| s.name == spec.name }
@@ -33,5 +34,9 @@ module Bundler
33
34
  def include?(other)
34
35
  other == self
35
36
  end
37
+
38
+ def inspect
39
+ "#<#{self.class}:0x#{object_id} #{self}>"
40
+ end
36
41
  end
37
42
  end
@@ -292,7 +292,7 @@ module Bundler
292
292
  def fetch
293
293
  git_proxy.checkout
294
294
  rescue GitError
295
- raise unless Bundler.settings[:allow_offline_install]
295
+ raise unless Bundler.feature_flag.allow_offline_install?
296
296
  Bundler.ui.warn "Using cached git data because of network errors"
297
297
  end
298
298
  end
@@ -224,6 +224,11 @@ module Bundler
224
224
  raise GitError, "The git source #{uri} is not yet checked out. Please run `bundle install` before trying to start your application"
225
225
  end
226
226
 
227
+ # TODO: Replace this with Open3 when upgrading to bundler 2
228
+ # Similar to #git_null, as Open3 is not cross-platform,
229
+ # a temporary way is to use Tempfile to capture the stderr.
230
+ # When replacing this using Open3, make sure git_null is
231
+ # also replaced by Open3, so stdout and stderr all got handled properly.
227
232
  def capture_and_filter_stderr(uri)
228
233
  return_value, captured_err = ""
229
234
  backup_stderr = STDERR.dup
@@ -46,7 +46,7 @@ module Bundler
46
46
 
47
47
  def to_lock
48
48
  out = String.new("PATH\n")
49
- out << " remote: #{relative_path}\n"
49
+ out << " remote: #{lockfile_path}\n"
50
50
  out << " glob: #{@glob}\n" unless @glob == DEFAULT_GLOB
51
51
  out << " specs:\n"
52
52
  end
@@ -129,6 +129,11 @@ module Bundler
129
129
  "`#{somepath}`.\nThe error message was: #{e.message}."
130
130
  end
131
131
 
132
+ def lockfile_path
133
+ return relative_path if path.absolute?
134
+ expand(path).relative_path_from(Bundler.root)
135
+ end
136
+
132
137
  def app_cache_path(custom_path = nil)
133
138
  @app_cache_path ||= Bundler.app_cache(custom_path).join(app_cache_dirname)
134
139
  end
@@ -140,7 +140,9 @@ module Bundler
140
140
  :bin_dir => bin_path.to_s,
141
141
  :ignore_dependencies => true,
142
142
  :wrappers => true,
143
- :env_shebang => true
143
+ :env_shebang => true,
144
+ :build_args => opts[:build_args],
145
+ :bundler_expected_checksum => spec.respond_to?(:checksum) && spec.checksum
144
146
  ).install
145
147
  end
146
148
  spec.full_gem_path = installed_spec.full_gem_path
@@ -291,6 +293,10 @@ module Bundler
291
293
  next if spec.name == "bundler" && spec.version.to_s != VERSION
292
294
  have_bundler = true if spec.name == "bundler"
293
295
  spec.source = self
296
+ if Bundler.rubygems.spec_missing_extensions?(spec, false)
297
+ Bundler.ui.debug "Source #{self} is ignoring #{spec} because it is missing extensions"
298
+ next
299
+ end
294
300
  idx << spec
295
301
  end
296
302
 
@@ -321,6 +327,10 @@ module Bundler
321
327
  next if gemfile =~ /^bundler\-[\d\.]+?\.gem/
322
328
  s ||= Bundler.rubygems.spec_from_gem(gemfile)
323
329
  s.source = self
330
+ if Bundler.rubygems.spec_missing_extensions?(s, false)
331
+ Bundler.ui.debug "Source #{self} is ignoring #{s} because it is missing extensions"
332
+ next
333
+ end
324
334
  idx << s
325
335
  end
326
336
  end