On Sep 19, 2010, at 9:50 AM, Eric MSP Veith wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Jeff--
> 
> some questions here:
> 
> On Sunday 19 September 2010, "Jeff Johnson" <j...@rpm5.org> wrote:
>>  +    rpmruby ruby = (flags & 0x80000000)
>>  +           ? rpmrubyI() : rpmrubyGetPool(_rpmrubyPool);
> 
> So you found it unncessary to protect the Ruby interpreter from being 
> initialized twice (thrice, ...)?  That was why I was ripping out this 
> portion of the code. (Just asking for some design rationale so that I can 
> get it right on the first try next time. ;-))
> 

No. The macro syntax always uses the 0x8000000, and I pass
0x8000000 with the scriptlet syntax easily. The global
interpreter (and a single interpreter instance) is all that is being used.

>>   #if defined(WITH_RUBYEMBED)
>>  -   ruby->state = rb_eval_string(str);
> 
> You might want to use rb_eval_string_protect to be sure that an exception in 
> the Ruby code doesn't kill the whole interpreter and take RPM with it.
> 

Noted and tried. But this rule applies to exceptins too:
        Never check for an error code you don't know how to handle.

> It seems you have thrown away all of my code. May I ask why? If there was 
> some serious design issue or major flaws behind it, please show me. I'm 
> always willing to learn (and hesitant to touch code here, anyways). :-)
> 

No. I checked into rpm-5_3 to preserve what you checked in on head.
And I was trying to fix a bug, not anything else.

But I don't think ruby 1.9.2 is embeddable atm (I see lots of failures and
no successes after googling).

So perhaps rethinking 1.8.x vs 1.9.x should be done instead?

73 de Jeff
______________________________________________________________________
RPM Package Manager                                    http://rpm5.org
Developer Communication List                        rpm-devel@rpm5.org

Reply via email to