applicationsonline / librarian

Librarian - A Framework for Bundlers. Librarian-Chef is at: https://github.com/applicationsonline/librarian-chef.
http://applicationsonline.com/
MIT License
655 stars 73 forks source link

librarian-puppet in verbose mode fails because of git version check in librarian #171

Open balrajs opened 10 years ago

balrajs commented 10 years ago

Environment: Windows 7, librarian-puppet 1.0.1, librarian 0.1.2, git 1.8.1.msysgit.1

When running librarian-puppet install in --verbose mode, it silently fails as librarian try's to print out my git version which have alphabets in it. This check is happening in 'respository.rb' in function git_version.

 def git_version
       command = %W[#{bin} version --silent]
       Posix.run!(command).strip =~ /\Agit version (\d+(\.\d+)*)/ && $1
end
rapaul commented 10 years ago

I work with @balrajs and did a bit of digging into this. I believe the problem isn't related to letters in the git version, but rather that the Poxis.run! (from posix.rb) call is now calling Process.spawn with IO.pipe being passed in options (opts) which isn't supported on Windows (Not available on all platforms).

Looking at the git history, this changed in 2d5984e1b63ec7d2b42b4993b427192c4bfe1fd7 where support for JRuby, Ruby < 1.9 and Ruby 1.9 or higher was added. In this commit the process handling was switched from Open3.popen3 to Process.spawn.

I'm contemplating putting in a pull request to switch back to Open3, but I'm not sure what the orginal intent of moving away from Open3 was.

andyjansson commented 10 years ago

@yfeldblum Got any input on this?

rapaul commented 10 years ago

I should point out that other (all?) calls to Posix.run! fail. This git version method is just the first one hit when running librarian puppet in debug mode.

yfeldblum commented 10 years ago

Try with b968cd91a3955657bf6ea728b922f2cb74843264.