summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2010-06-09 16:32:34 -0700
committerEric Wong <normalperson@yhbt.net>2010-06-10 02:54:25 +0000
commitddb56ce824ea3686fb9a43685ddae6473e5c91c2 (patch)
treee722ecdc131a63dd526c6a4acdc65a3a18c67b78
parent4c5faa3c001d695330f49fbed162d97e31f60357 (diff)
~/.gems is still shared, and we don't isolate
*that* often enough to matter
-rw-r--r--Rakefile14
1 files changed, 9 insertions, 5 deletions
diff --git a/Rakefile b/Rakefile
index a9a872e..25c6620 100644
--- a/Rakefile
+++ b/Rakefile
@@ -197,16 +197,20 @@ task :isolate do
     :path => "tmp/isolate/ruby-#{RUBY_VERSION}",
     :multiruby => false, # we want "1.8.7" instead of "1.8"
   }
+  fp = File.open(__FILE__, "rb")
+  fp.flock(File::LOCK_EX)
 
   # C extensions aren't binary-compatible across Ruby versions
-  fork { Isolate.now!(opts) { gem 'sqlite3-ruby', '1.2.5' } }
+  pid = fork { Isolate.now!(opts) { gem 'sqlite3-ruby', '1.2.5' } }
+  _, status = Process.waitpid2(pid)
+  status.success? or abort status.inspect
 
   # pure Ruby gems can be shared across all Rubies
   %w(3.0.0.beta3).each do |rails_ver|
     opts[:path] = "tmp/isolate/rails-#{rails_ver}"
-    fork { Isolate.now!(opts) { gem 'rails', rails_ver } }
+    pid = fork { Isolate.now!(opts) { gem 'rails', rails_ver } }
+    _, status = Process.waitpid2(pid)
+    status.success? or abort status.inspect
   end
-
-  failed = Process.waitall.delete_if { |(_,status)| status.success? }
-  abort failed.inspect unless failed.empty?
+  fp.flock(File::LOCK_UN)
 end