summaryrefslogtreecommitdiff
path: root/tasks
diff options
context:
space:
mode:
authorMatt Wrock <matt@mattwrock.com>2016-08-22 18:42:00 -0700
committerGitHub <noreply@github.com>2016-08-22 18:42:00 -0700
commitc5e387c5c5e7e3d94986eb7384bc7d8a7058b014 (patch)
treea89d9dbc7bbef1e16c919f4a4a4cf7ca1c3fc518 /tasks
parentd280ec34b974f1683cb0861ced9fbe80ef41c062 (diff)
parent8bdf04d9a52b416e7d39090cf315c05e1bc537cb (diff)
downloadchef-c5e387c5c5e7e3d94986eb7384bc7d8a7058b014.tar.gz
Merge pull request #5225 from chef/bundle_lock_fix
Add monkey patch to fix bundle locks for platforms
Diffstat (limited to 'tasks')
-rwxr-xr-xtasks/bin/bundle-platform1
-rw-r--r--tasks/bin/bundler_patch.rb27
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