Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
balrajs opened this issue May 5, 2014 · 4 comments

Comments

@balrajs
Copy link

balrajs commented May 5, 2014

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
Copy link

rapaul commented May 13, 2014

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 2d5984e 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
Copy link

@yfeldblum Got any input on this?

@rapaul
Copy link

rapaul commented May 13, 2014

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 pushed a commit that referenced this issue May 13, 2014
Skip cygwin for now because that tries to emulate a Posix environment. If someone running on cygwin encounters a problem, we can add it to the bunch.

Should address #171.
@yfeldblum
Copy link
Contributor

Try with b968cd9.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants