diff options
author | Matt Wrock <matt@mattwrock.com> | 2016-08-18 21:17:38 -0700 |
---|---|---|
committer | Matt Wrock <matt@mattwrock.com> | 2016-08-18 21:17:38 -0700 |
commit | 8bdf04d9a52b416e7d39090cf315c05e1bc537cb (patch) | |
tree | 275ab1bdefc4b183e6070190ef95bb81c289c601 /tasks | |
parent | 51581a0d11ddfac8db97712c6c3c680910db706c (diff) | |
download | chef-8bdf04d9a52b416e7d39090cf315c05e1bc537cb.tar.gz |
add monkey patch to fix bundle locks for platformsbundle_lock_fix
Diffstat (limited to 'tasks')
-rwxr-xr-x | tasks/bin/bundle-platform | 1 | ||||
-rw-r--r-- | tasks/bin/bundler_patch.rb | 27 |
2 files changed, 28 insertions, 0 deletions
diff --git a/tasks/bin/bundle-platform b/tasks/bin/bundle-platform index 4bd659d307..aa8443e74c 100755 --- a/tasks/bin/bundle-platform +++ b/tasks/bin/bundle-platform @@ -1,4 +1,5 @@ #!/usr/bin/env ruby +require_relative "bundler_patch" platforms = ARGV.shift platforms = platforms.split(" ").map { |p| Gem::Platform.new(p) } diff --git a/tasks/bin/bundler_patch.rb b/tasks/bin/bundler_patch.rb new file mode 100644 index 0000000000..5665e44eca --- /dev/null +++ b/tasks/bin/bundler_patch.rb @@ -0,0 +1,27 @@ +# This is a temporary monkey patch to address https://github.com/bundler/bundler/issues/4896 +# the heart of the fix is line #18 with the addition of: +# && (possibility.activated - existing_node.payload.activated).empty? +# This ensures we do not mis linux platform gems in some scenarios like ffi in kitchen-test. +# There is a permanent fix to bundler (See https://github.com/bundler/bundler/pull/4836) which +# is due to ship in v1.14. Once we adopt that version, we can remove this file + +require "bundler" +require "bundler/vendor/molinillo/lib/molinillo/resolution" + +module Bundler::Molinillo + class Resolver + # A specific resolution from a given {Resolver} + class Resolution + def attempt_to_activate + debug(depth) { "Attempting to activate " + possibility.to_s } + existing_node = activated.vertex_named(name) + if existing_node.payload && (possibility.activated - existing_node.payload.activated).empty? + debug(depth) { "Found existing spec (#{existing_node.payload})" } + attempt_to_activate_existing_spec(existing_node) + else + attempt_to_activate_new_spec + end + end + end + end +end |