Monday, April 06, 2009

Pea in a Box

There is a pea in a box and it is dry.
Pour some water, my little friend.

And then the box is filled with water.
There is a pea in a box and it is floating.

The box, however, suddenly begins to leak.
And soon it soaks water and shatters to pieces.

Crate is an incredible tool used to deploy Ruby applications to end-users. It magically creates self-contained statically compiled binaries. Crate is flexible and package applications the right way. The tool can target multiple platforms. In Theory, That Is.

Crate is developed on MacOS X, AFAIK. There is no instructions given on how-to use Crate on Windows. It clearly doesn't work as advertised. What are the current elements of concerns?
  • Poor documentation
  • Too many requirements
  • Fully Microsoft® Windows Awkward
  • Lack of integration with IDEs
  • Doesn't work as advertised
  • Overly forgiving policies on building rules
  • Very little control over dependencies
  • Painfully slow
Crate uses MinGW, MSYS, MinDTK and many other UNIX tools. These are mandatory in order to compile packages used in your applications. Even if you only need Ruby, don't forget that it has its own requirements to be compiled as well.

Unfortunately, your pain is not over once the software requirements are met. The system is absolutely Windows unfriendly and despises your long path names with spaces. This will force you to hack your way in and run Crate from a valid UNIX path. It seems also impossible to either set and use CC environment variable or pass a reference down to MAKE in order to use a different compiler than cc (MinGW has gcc). A symbolic link is necessary. Moreover, as a complementary annoyance, I had to create a Bourne shell script to use Ruby from my Windows installation.

That's nothing you would say. Right. I just mean that it currently doesn't work right off the box.

The tutorial provided by the author of Crate is relatively straightforward. I am sure that it is absolutely great for those who can actually make it work. However, on the Windows platform, this tutorial won't work at all. The requirements met will only give you the keys to ...nothing. Nothing else than a working script that won't be able to compile properly. Some to many modifications are likely to be necessary. Likewise, I have unsuccessfully tried to produce a simple test by reducing its requirements from both the tutorial and Ruby.

Using Crate through MSYS rather than just using MinGW tools makes it challenging to integrate the process within your favourite IDE. I would like to have a deployment process that can go through all steps automatically and from one source (e.g. my own packaging script).

This is undoubtedly possible to manage files in the generated directory structure and then compile within MSYS by sharing a common UNIX valid directory. Then, you would have to figure out how to run Crate in MSYS from your IDE. Oh, wait. Shall we catch the output in your console pane? Unlikely! Besides, MSYS is also painfully slow.

Crate is a series of recipes for Rake. Heavily relying on Rake to performs its tasks, Crate completely hides the low-level operations such as unpacking, patching, and compiling dependencies. This would be wonderful if only it wouldn't be so forgiving and continue executing its recipes until the very end, without stopping on critical errors. Furthermore, there is apparently very little control over the low-level operations such as compiling (Ruby, zlib, and friends).

And So...
The fact remains that Crate is perfect for my needs by its definition. It's just not mature enough for now. I have been in contact with its author, Jeremy Hinegardner, in the hope to bring progress to Crate For Windows. His track record includes the famous RubyGem amalgalite providing SQLlite support for Ruby. Therefore, the future of Crate is most likely a sure thing...

...there is a pea in a box

No comments:

Post a Comment