win32console 1.3.0 prerelease

I mentioned in previous post that I was working in a updated version of win32console.

So, just pushed to Gemcutter the prerelease version (_beta1_) so you guys can test with your current Cucumber/RSpec scenarios.

How to install prerelease versions?

All the RubyGems 1.3.x series sport the feature to prerelease gem installations. I recommend update to RubyGems 1.3.5 first in case you haven’t already, and proceed to install the gem:

gem install win32console --prerelease

The process will install version 1.3.0.beta1, which will be automatically available to any require done by Cucumber or RSpec.

What changed on this release?

As I mentioned before, there are a couple of changes required to support 1.9. On this release, I got rid of hardcoded translation tables used to convert codepages from input/output consoles.

How this affects me?

It will only affect you if you use accented characters in the output. If you do, then you should verify that your console codepage supports them. There is more information in the Cucumber wiki troubleshooting page

Now that text is sent transparently to the output, you have the control to feed the stream with different encodings and ensuring the output matches the console codepage.

A working example of this is located here

Please test it out so a formal 1.3.0 release can be done the upcoming days.

Cheers!

win32console upcoming changes and feedback

For the ones not aware of, win32console (originally here, gemified here) is a project that provides ANSI coloring for Windows.

Yeah, Windows doesn’t do ANSI coloring like any POSIX terminal, and it has it’s own API with extended control of the console functionality.

Read More »

rake-compiler: safe list of Ruby versions that can be cross-compiled

Seems that I’m going to suffer a series of bug reports in the upcoming weeks due continious changes between patchlevels of Ruby.

To give some background, for the fresh ones just arriving to the blog. rake-compiler provides, besides C/Java extension standardization structure, the ability to cross-compile versions of Ruby to allow developers on Linux/OSX build and release gems for users running Windows.

Seems that latest patchlevels of Ruby 1.8.7 (172) and 1.9.1 (376) cannot be cross compiled.

I’ve reported that to Ruby’s bug tracker under issues #2464 and #2484

From what you can read there, there is a clear change in the rules about what is the minimum Ruby version that can be used to cross compile (known as BASERUBY)

Now, being pointed to the Developer’s Howto page, and checking the history and time, it is clear the note about the limitation is really fresh

The funny thing is that I still can cross compile 1.9.2dev using 1.8.6! Which is contrary to what the recently edited howto states!

Don’t get me wrong, I have no personal issue besides being annoyed, and that will require put some lock in cross-ruby compilation to avoid bug reports about something that is beyond my control.

So, with the goal of making this public and have a link to include in my canned response to people reporting bugs about it, the following is the list of versions and patchlevels of Ruby that I know works and aim to support in relation to bug fixes of rake-compiler itself:

Version Patchlevel supported? Command
1.8.6 287 Yes rake-compiler cross-ruby
1.8.6 383 Yes rake-compiler cross-ruby VERSION=1.8.6-p383
1.8.7 72 NO
1.8.7 173 NO
1.9.1 243 Yes rake-compiler cross-ruby VERSION=1.9.1-p243
1.9.1 376 NO
1.9.2 trunk Yes (that is true up to revision 26108)

Tricky list, even switching the version of Ruby to match the one desired to be installed, it doesn’t work (reported as #2485, I’m very persistent).

So, apologies to anyone having issues with this: I’m having the same ones here.

What’s new in rake-compiler 0.7.0

An hour ago I released version 0.7.0 of rake-compiler. See the announcement at RubyInstaller mailing list (CC to Ruby-Talk too, just in case)

JRuby

This new version includes an amazing contribution by Alex Coles that allow compilation and packaging of JRuby extensions and gems!

Yes, it is now possible, under JRuby, to compile JRuby gems that bundle jar files with the extensions.

Even more, with proper tools and a valid JRuby installation, you can even compile extensions from your current 1.8 or 1.9 MRI installation!

Please take a look in the README.rdoc file for more details

Rubinius?

I couldn’t test it myself, but seems that rake-compiler got bundled in latest RC1 of Rubinius. See it for yourself here

Thanks to Rubinius support for Ruby C API and huge reverse engineered mkmf, rake-compiler should work for most of the extensions. Will check that statement later.

So, resistance is futile… the next implementations to be assimilated are MacRuby and MagLev, wanna help me out on that? ;)

What’s next?

At the time I started with rake-compiler, none of the cool tools like Pik or rvm existed.

Because of that, the only way possible to generate fat binaries (mentioned before here) was cross-compiling.

Now that is easy to switch Ruby versions and implementations, it will be possible to implement changes to generate native fat-binaries on any platform.

This functionality is planned, but not ETA yet. Want to help? Fork the project on GitHub and start right now!