[Rubygems-developers] Specifying a platform

Chad Fowler chad at chadfowler.com
Sat Apr 17 16:40:24 EDT 2004

On 17/4/2004, at 11:54 AM, Gavin Sinclair wrote:

> On Saturday, April 17, 2004, 11:04:28 PM, Chad wrote:
>>> There are a few points to make here.
>>> 1. The error message given there is a bit fearsome.  I'm not sure 
>>> what
>>>    the current policy on error messages is, but I'm sure this one can
>>>    be improved.  I'll take advice and then make the change myself.
>> This is just one of those bad error messages (stack traces) that 
>> hasn't
>> yet been cleaned up.
> Fixed.  I've gone and made all exception classes we create inherit
> from the new class Gem::Exception.  That makes it possible to catch
> them separately and generally.
>>> 2. Why is a platform required?  I understand platform to be "what 
>>> kind
>>>    of machine this can run on", which is fine, but what does "Ruby"
>>>    mean as a platform?  If a gem is platform-independent, does a
>>>    platform need to be specified?  If we must have "Ruby" meaning
>>>    "platform-independent Ruby-based gem", can it be the default
>>>    setting?
>>>    Platform suggests to me a binary gem, I suppose.
>> RUBY is indeed intended to mean that the gem is cross-platform.  I
>> think RUBY being a default is a sensible way to go about it.
> Sounds good.  I agree with Rich's comment elsewhere that Ruby *is* a
> platform.  So we can treat it as the default platform.
> But then, what if a gem includes C code as well as Ruby code?  And
> what if that C code uses, for instance, "fork"?  This platform
> business might need some more definition.

This would be a platform-independent source gem, usually.  But you're 
right about the fork() case.  More thought required.

> If my assumption that an platform specification implies a binary gem
> is correct (is it?) then a reordering *might* make sense.
>       wx-windows-0.3.2-mswin.gem
>       wx-windows-0.3.2-powerpc-darwin.gem
> I think it's easier to parse and less likely to confuse or conflict,
> but is it sensible and appealing?

It might make a little more sense, but the parsing issue shouldn't be 
important.  It *appears* that we would parse file names to get the 
platforms straight, but we really use the metadata.  We only parse the 
file names as humans.  So, it's probably not too important what order 
they're in.

> Gavin
> P.S. To address another point raised elsewhere in this thread, I do
> believe that the platform should be present in the filename (unless
> it's Ruby), because sometimes it's all that differentiates two gems.
> Is it not?

Yes.  The main reason we need platform name in the gem is to avoid 
blah-powerpc-darwin-0.0.1.gem and blah-mswin32-0.0.2 overwriting each 


More information about the Rubygems-developers mailing list