« Rails vs Java | Main | First major set of embedded RubyCocoa changes complete »
March 29, 2005
RubyCocoa bundling
There was a new release of RubyCocoa a few days ago, it now builds fine on newer builds of OS X. They also turned on the relative Frameworks path inside RubyCocoa.framework that lets developers bundle RubyCocoa into their apps. If you don't mind depending on the system ruby 1.6.7, then you can use the dmg that the RubyCocoa developers provide, and ship RubyCocoa apps with an embedded RubyCocoa framework (which is only about 1MB total).
In the long run, developers are going to want to control what version of ruby they depend on, and make sure that all the third-party libraries they require are bundled with the app. I've mentioned before that I'm working on some changes to RubyCocoa to allow a full version of ruby to be bundled inside it... Well, I got in touch with W. Kimura, who made most of the changes for the recent release, and he's interested in incorporating my changes.
The work is a little difficult, since you want to embed an entire ruby distribution inside RubyCocoa, and make sure that the system ruby doesn't interfere in any way. It also needs to be fairly seamless, developers need to be able to build and integrate third-party ruby modules into their app (even ones that use C extensions) and make sure that are the ABI and path angles are covered.
So, the list of features I'm aiming for is:
- Add support for a Resources/ruby-core path inside RubyCocoa.framework that holds the binary bits of a given ruby install.
- Build script to import an existing ruby install and bundle it into Resources/ruby-core, making sure that rbconfig.rb/Config and other path configs are adjusted properly.
- Take ruby tarball and bundle it into Resources/ruby-core to get a fresh build.
- Make sure RubyCocoa's RBRuntime class knows where to find the embedded framework's standard classes, and any third-party modules that have been added. (This isn't too hard since RBRuntime is bundled into RubyCocoa's lib, and you can look at the bundle's path at runtime to figure out where the libs are hiding.)
I've got a basic hacked-up version of this working, but some things are hardcoded and I don't support the importing of an existing ruby install yet. Hopefully I can get that finished this week, since classes start up again on the 4th.
Posted by djb at March 29, 2005 11:34 AM