soeren says

Septuple-C: RubyScript2Exe woes on Cygwin (1 updates)

April 21st, 2006

Alright, so I use RubyScript2Exe in conjunction with Tar2RubyScript in order to create a self-contained binary: the latter archives the script (main.rb, now init.rb) and its additional external classes (e.g., core/ccsettings.rb) into a tar file that, in turn, gets wrapped into a Ruby script which untars into the OS’s temporary directory upon execution. The former, then, “traces” the result and tries to figure out this way which additional libraries are needed that aren’t part of Ruby’s core (in my case, that’s socket, iconv, and so on), then copies those libraries into the tar file, copies Ruby and (in Cygwin’s case) cygwin1.dll (i.e., the runtime environment) and wraps all that into an executable.

Sound good? Well, aside from rather steep space requirements, it is. Distributing Ruby scripts like this is very useful. Hats off to Erik Veenstra’s work.

But, it doesn’t work.

That is, it works perfectly fine on OS X, but it doesn’t on Windows/Cygwin, and I’m primarily using it for Windows, so that’s more than just a bummer.

  1. Tar2RubyScript plus Darwin (OS X): check.
  2. RubyScript2Exe plus Darwin (OS X): check.
  3. Tar2RubyScript on Cygwin (Windows): check (with one caveat, see below).
  4. RubyScript2Exe on Cygwin (Windows): nuh-uh.

It is that very last thing that I need to get working, and I can’t seem to figure out why.

In addition, there’s the slight problem that, inside Cygwin (and regardless of whether you have Cygwin installed or not, this script will run inside its own Cygwin environment), $APPDATA (the path to what’s usually C:\Documents and Settings\[you]\Application Data; it’s localized, so you can’t make assumptions regarding its name: on German Windows, it’s C:\Dokumente und Einstellungen\[you]\Anwendungsdaten, and worse, admins can customize this path, so you must rely on this environment variable) is apparently not always set (yet right now, I tested again and it was), so the script will sometimes assume to be on Unix, and accordingly place the settings file in a completely wrong place. But I’m confident I’ll figure that one out somehow.

I first thought it had something to do with (lack of) keyboard input, because it crashed stating that there was input of nil (i.e. nothing), but no: when I took that out and left it up to socket input entirely, the app would simply hang/stall instead, and it’s not clear where either, as there’s no traceback.

Why must you be so complicated, Windows?

Update: The ‘hang’ was apparently just a lack of patience. Logging in and back out automatically works even with the RubyScript2Exe. The problem is definitely with keyboard input and happens even with something as simple as:

foo = $stdin.gets
puts foo

I have detailed the problem in this ruby-talk post.

Posted in CCCCCCC/Septuple-C, Ruby

Share

Others' Thoughts

# moiety

I think you should start a separate development blog, and move the hard-core technical/programming entries over there.

Just a thought. :)

# chucker

You wanted to go to sleep five minutes ago. >:(

(Here I was, hoping there’d be a comment to help fix my problem.)

I’m not sure yet if I’ll split my blogs again (like the split between Where’s the Button and What You Leave Behind). It’s kind of inconvenient for me.

That said, it’s been suggested before, and ‘proponents’ do have a point.

# moiety

Well, the thing is, after all this time of reading chucker.mystfans.com, I’ve gotten used to what sort of mixture of content to expect… tech links, personal posts, thoughts… And as of late, all this high-tech programming stuff has been flooding the site, and the tone is different, and it doesn’t “feel” like it belongs.

I just think that since it’s so specialized, it would be more appropriate to have it on a specialized blog. Maybe chucker.mystfans.com/devblog/, or something.

That’s not to say that you shouldn’t mention this kind of stuff here — you should, but based on the pattern you’ve established so far, the entries would be more along the lines of “Ten Things I Love About Ruby” or “Thoughts about writing a project from scratch”, rather than a focus on specific, specialized programming issues with a more limited appeal to your readership.

I hope I’m making sense. This is not to discourage you from writing about this new kind of stuff — just some thoughts how it might be organized better.

I’m sure you’ll end up doing what you feel is right. :)

# chucker

Linky.

Your Own Thoughts

I'd love to hear your input. Just try to stick to a few rules:

Before you comment for the first time (or, after you have deleted cookies), you will have to answer a little challenge to prove that you are not a spammer.

Comments are written in Markdown.

Leave the country the same, but correct the continent, and end the sentence with a period instead.