[Ironruby-core] .so files and library paths

John Lam (IRONRUBY) jflam at microsoft.com
Mon May 19 13:27:21 EDT 2008

Wayne Kelly:

> ruby\lib\ruby\1.8\thread.rb which explicitly loads thread.so
> ruby\lib\ruby\1.8\openssl.rb which explicitly loads openssl.so
> ruby\lib\ruby\1.8\digest.rb which explicilty loads digest.so
> ruby\lib\ruby\1.8\pp.rb which explicitly loads etc.so
> These are all part of the Windows One click installer distribution.
> The .so files reside in ruby\lib\ruby\1.8\i386-mswin32
> I've been assuming that it is OK to alter files in this i386-mswin32
> directory as they are intended to be platform specific implementations.
> As IronRuby is effectively a different platform, I've been assuming
> that we will rename this directory 'ironruby'. I was also assuming,
> however, that in the long run, it would be "cheating" to modify any of
> the other ruby source files in the standard libraries in order to get
> IronRuby to work correctly.
> So, what are the ground rules for altering these libraries?

I have no idea right now. That said, I think we're going to need a process for filtering out a bunch of libraries that don't make sense for our implementation. For example, the various Tcl related libraries are a reasonable candidate to remove. So we're already going down the path of modifying the sate of lib\ruby\1.8.

Since those libraries you referenced above are nothing more than just wrappers around loading native libraries, I don't see the harm in changing them. We could also use Tomas' hack around creating a thread.so.rb file to thunk to loading thread.so as well ...

> On a related issue - MRI automatically includes a number of relative
> library paths into its load search path. Currently in IronRuby we need
> to explicitly list each of these libraries in the command line using
> the /paths command line option (and it's really painfull when there's
> half a dozen long paths included on your command line). Is there any
> plan to add any of these search paths automatically, or at least semi
> automatically? We may want to provide a mechanism for specifying the
> standard library root (eg "c:\ruby\lib") rather than assuming that it
> is relative to the ruby interpreter executable, but couldn't we then
> automatically add other "standard" paths relative to that?

I added some time ago an implementation for -I on the Ruby command line. I have the following PowerShell alias defined:

function rbd { cmd /C "${env:MERLIN_ROOT}\Bin\Debug\ir.exe -I ${env:MERLIN_ROOT}\..\External\Languages\Ruby\ruby-1.8.6\lib\ruby\1.8;${env:MERLIN_ROOT}\..\External\Languages\Ruby\ruby-1.8.6\lib\ruby\site_ruby\1.8;${env:MERLIN_ROOT}\..\External\Languages\Ruby\ruby-1.8.6\lib\ruby\1.8\i386-mswin32 -D $args"}

You should be able to do the same with your local copy.

> There is of course also the possibility of creating a new (additional)
> IronRuby console front end that behaves more like MRI in terms of
> command line options.

The goal is to make ir.exe do exactly that. We just haven't invested beyond -I today.


More information about the Ironruby-core mailing list