ruby uses .so files?

1,295 views
Skip to first unread message

rogerdpack

unread,
Jul 14, 2010, 3:13:21 PM7/14/10
to RubyInstaller
I've noticed that ruby "uses" .so files in windows. Everything else
seems to use .dll though...I guess what ruby creates as .so files
could be renamed .dll and it's the same? It just likes its own naming
convention, here? Anybody know?
Thanks.
-r

Luis Lavena

unread,
Jul 14, 2010, 3:22:30 PM7/14/10
to rubyin...@googlegroups.com

RbConfig::CONFIG['DLEXT']
RbConfig::CONFIG['DLEXT2']

DLL has been for historical reasons, but was renamed to .so to avoid
the clash with system libraries named similar and using dlopen on
them.

ruby -rrbconfig -ve "puts RbConfig::CONFIG['DLEXT']; puts
RbConfig::CONFIG['DLEXT2']"

ruby 1.8.7 (2010-06-23 patchlevel 299) [i386-mingw32]
so
dll

ruby 1.9.1p378 (2010-01-10 revision 26273) [i386-mingw32]
so


It has been deprecated in 1.9. so .so is the only extension supported.

FYI: Python uses .pyd, not DLL.
--
Luis Lavena
AREA 17
-
Perfection in design is achieved not when there is nothing more to add,
but rather when there is nothing more to take away.
Antoine de Saint-Exupéry

rogerdpack

unread,
Jul 14, 2010, 5:07:41 PM7/14/10
to RubyInstaller

> It has been deprecated in 1.9. so .so is the only extension supported.
>
> FYI: Python uses .pyd, not DLL.

Interesting. Thanks for the background!
-r

Dan Rathbun

unread,
Aug 4, 2010, 2:45:32 AM8/4/10
to RubyInstaller
How can we have Windows display the Version tab, in the (left-click)
Properties dialog, for .so files, as we can for .dll files ??

Luis Lavena

unread,
Aug 4, 2010, 7:31:30 AM8/4/10
to rubyin...@googlegroups.com
On Wed, Aug 4, 2010 at 3:45 AM, Dan Rathbun <danz...@gmail.com> wrote:
> How can we have Windows display the Version tab, in the (left-click)
> Properties dialog, for .so files, as we can for .dll files ??
>

You will need to provide a resource file (.res), preferable a .rc file
to be compiled by windres

I believe it will not automatically do it for you, as most of the
times the extensions are not normally accessible to users (in a way
that you don't browse your gem/extension folder and move files around.

Dan Rathbun

unread,
Aug 4, 2010, 7:57:54 PM8/4/10
to RubyInstaller
On Aug 4, 7:31 am, Luis Lavena wrote:
> On Wed, Aug 4, 2010 at 3:45 AM, Dan Rathbun wrote:
> > How can we have Windows display the Version tab, in the (left-click)
> > Properties dialog, for .so files, as we can for .dll files ??
>
> You will need to provide a resource file (.res), preferable a .rc file
> to be compiled by windres

I suppose I mis-interpreted your previous post.

I thought you implied that .so files were simply .dll files that had
been given a different extension, so that Windows would not load a dll
of the same name from, say the 'Windows/System32' folder.

Regardless, I am speaking about the .so files distro'd with Ruby, and
not those that I create. It would be nice to know (or be able to
interogate,) both .so and .rb files for Version and Release Date. I
see many of the pure Ruby library files that have no Revision stated
within them (comments) or a Revision object (Constant or some data
class, such as a Struct.)

Roger Pack

unread,
Aug 5, 2010, 11:06:20 AM8/5/10
to rubyin...@googlegroups.com
> How can we have Windows display the Version tab, in the (left-click)
> Properties dialog, for .so files, as we can for .dll files ??

Maybe rename them .dll then back to .so?
In 1.8 it will actually take both extensions, in 1.9 only .so...
-r

Luis Lavena

unread,
Aug 5, 2010, 11:21:59 AM8/5/10
to rubyin...@googlegroups.com
On Wed, Aug 4, 2010 at 8:57 PM, Dan Rathbun <danz...@gmail.com> wrote:
> On Aug 4, 7:31 am, Luis Lavena wrote:
>> On Wed, Aug 4, 2010 at 3:45 AM, Dan Rathbun wrote:
>> > How can we have Windows display the Version tab, in the (left-click)
>> > Properties dialog, for .so files, as we can for .dll files ??
>>
>> You will need to provide a resource file (.res), preferable a .rc file
>> to be compiled by windres
>
> I suppose I mis-interpreted your previous post.
>
> I thought you implied that .so files were simply .dll files that had
> been given a different extension, so that Windows would not load a dll
> of the same name from, say the 'Windows/System32' folder.

Yes, they are, but it's purpose is Ruby specific, like ".pyd" are DLLs
for Python extensions.

And no, Ruby-extensions are not general purpose DLLs that you can push
into system32 (and you shouldn't be doing that, btw).

The extension .so is used to avoid "sqlite3.dll" be loaded instead of
"sqlite3.so", Old versions of sqlite3-ruby suffered from this, I
renamed the extension to sqlite3_native to avoid that.

> Regardless, I am speaking about the .so files distro'd with Ruby, and
> not those that I create. It would be nice to know (or be able to
> interogate,) both .so and .rb files for Version and Release Date. I
> see many of the pure Ruby library files that have no Revision stated
> within them (comments) or a Revision object (Constant or some data
> class, such as a Struct.)
>

Well, there is no mechanism, and isn't supposed to interrogate those
directly but instead through ruby.

Reply all
Reply to author
Forward
0 new messages