From 0ba3824106f7cc14f128427c87674fa9adf7ab4c Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Fri, 10 Feb 2012 00:53:22 -0800 Subject: [PATCH 1/2] Windows subprocess IO works again. [GH-721] --- CHANGELOG.md | 5 +++++ lib/vagrant/util/subprocess.rb | 19 ++++++++++++++----- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 963f5995e..823c07c44 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.9.7 (unreleased) + + - Fix regression where all subprocess IO simply didn't work with + Windows. [GH-721] + ## 0.9.6 (February 7, 2012) - Fix strange issue with inconsistent childprocess reads on JRuby. [GH-711] diff --git a/lib/vagrant/util/subprocess.rb b/lib/vagrant/util/subprocess.rb index 56eee94d0..70d591c12 100644 --- a/lib/vagrant/util/subprocess.rb +++ b/lib/vagrant/util/subprocess.rb @@ -64,6 +64,14 @@ module Vagrant # Make sure the stdin does not buffer process.io.stdin.sync = true + if RUBY_PLATFORM != "java" + # On Java, we have to close after. See down the method... + # Otherwise, we close the writers right here, since we're + # not on the writing side. + stdout_writer.close + stderr_writer.close + end + # Create a dictionary to store all the output we see. io_data = { :stdout => "", :stderr => "" } @@ -136,11 +144,12 @@ module Vagrant yield io_name, extra_data if block_given? end - # Close the writer pipes. Note that we do this so late (after the process - # has quit) to work around an issue with childprocess and JRuby. It is - # bizarre but it works. - stdout_writer.close - stderr_writer.close + if RUBY_PLATFORM == "java" + # On JRuby, we need to close the writers after the process, + # for some reason. See GH-711. + stdout_writer.close + stderr_writer.close + end # Return an exit status container return Result.new(process.exit_code, io_data[:stdout], io_data[:stderr]) From ea19bddb04bc3d6561355a10e3f06356321eadda Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Fri, 10 Feb 2012 00:54:16 -0800 Subject: [PATCH 2/2] v0.9.7 --- CHANGELOG.md | 2 +- lib/vagrant/version.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 823c07c44..b92ef0d42 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## 0.9.7 (unreleased) +## 0.9.7 (February 9, 2012) - Fix regression where all subprocess IO simply didn't work with Windows. [GH-721] diff --git a/lib/vagrant/version.rb b/lib/vagrant/version.rb index 260eb1a18..03e26b9e9 100644 --- a/lib/vagrant/version.rb +++ b/lib/vagrant/version.rb @@ -2,5 +2,5 @@ module Vagrant # This will always be up to date with the current version of Vagrant, # since it is used to generate the gemspec and is also the source of # the version for `vagrant -v` - VERSION = "0.9.6" + VERSION = "0.9.7" end