Anyone else working on Windows?

79 views
Skip to first unread message

Larry Gilbert

unread,
Sep 20, 2012, 1:48:44 PM9/20/12
to babush...@googlegroups.com
I just discovered Babushka and really like what I see so far.

I have an employer that absolutely requires Ruby scripts to be able to run on Windows, so I thought I would try hacking on Babushka to make it compatible with (or at least usable on) Windows. Is anyone else already working on this or tried to do it?

--Larry

Ben Hoskings

unread,
Sep 20, 2012, 7:17:40 PM9/20/12
to babush...@googlegroups.com
Hi Larry, thanks :)

As far as I know, babushka already runs on cygwin. I've never used it so I don't know the ins and outs, but one of our interns at work was babushkaing on cygwin last week and everything apparently worked.

Is that the environment you're running on?

- Ben
> --
> To post, email babush...@googlegroups.com
> To unsubscribe, email babushka_app...@googlegroups.com
> ~
> http://babushka.me
> http://github.com/benhoskings/babushka
> http://groups.google.com/group/babushka_app

Larry Gilbert

unread,
Sep 21, 2012, 12:30:17 PM9/21/12
to babush...@googlegroups.com
On Thursday, September 20, 2012 4:17:46 PM UTC-7, Ben Hoskings wrote:
As far as I know, babushka already runs on cygwin. I've never used it so I don't know the ins and outs, but one of our interns at work was babushkaing on cygwin last week and everything apparently worked.

Is that the environment you're running on?

What I'm trying to do is make it run on "pure" Windows. Now, Git for Windows already ships with its own MinGW environment, but my aim is to avoid taking advantage of MinGW any more than what Git needs for its own operation. In other words, I want people to be able to run Babushka right from a Windows C: prompt.

I know that may sound perverse. :-) But it seems like an interesting challenge to me. I just didn't want to be stepping on someone else's toes if they were already on this track.

-LG

Ben Hoskings

unread,
Sep 25, 2012, 2:05:28 AM9/25/12
to babush...@googlegroups.com
(Sorry, your message was stuck in a queue; the google group UI is tricky.)

It does sound like a challenge indeed :)

One of the main places that would pose problems is Babushka::Shell, which does a fork/exec combo to hook up pipes to the subprocess. I don't know how that would be done on Windows, or if it's possible.

Also, I should be upfront and say that I'm against merging significant patches for Windows support. Fixes are of course welcomed, and if Windows-specific stuff can be contained, then it might work. But I'm concerned about the maintenance overhead of code that I don't understand, and my inability to fix bugs reported against it.

Cheers,
Ben

Larry Gilbert

unread,
Nov 27, 2012, 12:27:59 PM11/27/12
to babush...@googlegroups.com
Gee whiz, I forgot I started this thread. :")

I understand the reluctance to add significant patches, and I can accept that. I just like Babushka as a lightweight alternative to Chef (which already works on Windows but is a big deal to set up).

The lack of proper forking in Windows does indeed pose a challenge here. It's like trying to draw a perfect diagonal line on an Etch-a-Sketch. Maybe this will all have to be relegated to being a Windows port of Babushka. I don't know.

Well, if anyone finding this message is curious, I'm putting up code on GitHub in a branch named "vindy-rebase".  As the name implies, I rebase it occasionally, so be forewarned. No, it is nowhere near ready for prime time.

-LG

Ben Hoskings

unread,
Dec 22, 2012, 5:38:54 AM12/22/12
to babush...@googlegroups.com
Hi Larry, I just went to check out your branch and found a 404 :)

Did you end up making any more progress on this? I'm curious to see what sort of workarounds are required.

- Ben

Frank Behrens

unread,
Jan 10, 2013, 6:59:59 PM1/10/13
to babush...@googlegroups.com
Hi Larry, 
I would love to have or make it running on  windows too. 
Is your work still available ?
Frank


Larry Gilbert

unread,
Jan 10, 2013, 7:49:40 PM1/10/13
to babush...@googlegroups.com
I will check, but I really wasn't able to get very far with it. The open3 implementation was a roadblock for me. There is a Win32 gem that provides a working open3 (and open4 and open2e) for Windows, and I was trying to make Babushka use that, but I gave up. I did get some shell-related stuff changed, though. I will look and see if I have a copy of that code still. 

--
Larry Gilbert
Geek

Larry Gilbert

unread,
Jan 10, 2013, 8:39:03 PM1/10/13
to babush...@googlegroups.com
Okay, so I found my old patches, reapplied/rebased them to the current master, and pushed a new fork: https://github.com/L2G/babushka/tree/vindy-rebase

I make no guarantee or warranty of anything, anywhere. :-)

--
Larry Gilbert
Computer geekery since 1976

Ben Hoskings

unread,
Jan 30, 2013, 7:08:34 AM1/30/13
to babush...@googlegroups.com
Thanks for posting this Larry, great work. There's less code required than I thought there would be.

I'd probably avoid the conditionals by instead having separate modules, e.g. Babushka::Windows::ShellHelpers, which have unconditional methods, e.g.

def login_shell cmd, opts = {}, &block
  shell "cmd /c \"#{cmd}\""
end

And then including those modules when running on a Windows box, and the regular Unix ones otherwise. That separation makes testing and maintenance easier.

Have you found that babushka is useful on Windows with these patches, or would there be more work required to get it into a useful state?

- Ben



--



--
Cheers
Ben

Larry Gilbert

unread,
Jan 30, 2013, 1:50:21 PM1/30/13
to babush...@googlegroups.com
On Wed, Jan 30, 2013 at 4:08 AM, Ben Hoskings <b...@hoskings.net> wrote:
I'd probably avoid the conditionals by instead having separate modules, e.g. Babushka::Windows::ShellHelpers, which have unconditional methods,

Absolutely. Love that idea. I guess I was thinking in the back of my head that you were avoiding breaking things up--silly thought in retrospect.
 
Have you found that babushka is useful on Windows with these patches, or would there be more work required to get it into a useful state?

There would be more work to do. I don't remember off the top of my head how much work I thought it would be. I was really hung up on getting popen4 to work. Surely it's possible because Opscode's Chef (similar but heavier app) has some kind of popen3/popen4 that works in Windows. Hmm, it's open-source, too... ;-) (But I don't know how well the Apache license meshes with Babushka's BSD-ish license.)

Ben Hoskings

unread,
Jan 30, 2013, 7:34:59 PM1/30/13
to babush...@googlegroups.com
On 31 January 2013 05:50, Larry Gilbert <la...@l2g.to> wrote:
Surely it's possible because Opscode's Chef (similar but heavier app) has some kind of popen3/popen4 that works in Windows. Hmm, it's open-source, too... ;-) (But I don't know how well the Apache license meshes with Babushka's BSD-ish license.)

That won't be a problem --  both the Apache and BSD licenses allow linking and changes under a different license.

If you find the time to look into Chef's implementation of popen, let me know what you find :)

Cheers
Ben

Reply all
Reply to author
Forward
0 new messages