What a cruel world!

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

What a cruel world!

Igor Stasenko
 
Hi,

i trying to discover which directories and in what order mac VM
looking for extrnal plugin module,
and to make sure that it finds my module, i renamed library
FloatMathPlugin.dylib to
FloatMathPluginz.dylib

and correspondingly in primitive invocation, i put:

primitiveExp
       "Answer E raised to the receiver power.
        Optional. See Object documentation whatIsAPrimitive."

       <primitive: 'primitiveExp' module: 'FloatMathPluginz'>
       self isNaN ifTrue:[  ^self].

now i found that module is loaded, but primitive doesn't work..
entering gdb, i found following cruel line in callInitializersIn():

                if(strncmp(moduleName, module->name, strlen(module->name)) != 0) {
                        DPRINTF(("ERROR: getModuleName returned %s (expected: %s)\n",
moduleName, module->name));
                        return 0;
                }

where moduleName is a result from call module's 'getModuleName' function,
which is obviously returns 'FloatMathPlugin' instead of 'FloatMathPluginz',
and therefore comparison fails, and module fails to initialize :(


Btw, i would find this thing much faster, if somebody wouldn't put
following in the beginning of sqNamedPrims.c :

#undef DEBUG   <<<< whyyyy?!?!?

#undef DPRINTF
#ifdef DEBUG
#define DPRINTF(what) printf what
#else
#define DPRINTF(what)
#endif



--
Best regards,
Igor Stasenko AKA sig.
Reply | Threaded
Open this post in threaded view
|

Re: What a cruel world!

johnmci
 
What directories, the older and other reasoning can determined by
setting the debug value and if the plugins are loaded locally only or
not. The entire logic was rewritten for 5.x

On 12/28/10, Igor Stasenko <[hidden email]> wrote:

>
> Hi,
>
> i trying to discover which directories and in what order mac VM
> looking for extrnal plugin module,
> and to make sure that it finds my module, i renamed library
> FloatMathPlugin.dylib to
> FloatMathPluginz.dylib
>
> and correspondingly in primitive invocation, i put:
>
> primitiveExp
>        "Answer E raised to the receiver power.
>         Optional. See Object documentation whatIsAPrimitive."
>
>        <primitive: 'primitiveExp' module: 'FloatMathPluginz'>
>        self isNaN ifTrue:[  ^self].
>
> now i found that module is loaded, but primitive doesn't work..
> entering gdb, i found following cruel line in callInitializersIn():
>
> if(strncmp(moduleName, module->name, strlen(module->name)) != 0) {
> DPRINTF(("ERROR: getModuleName returned %s (expected: %s)\n",
> moduleName, module->name));
> return 0;
> }
>
> where moduleName is a result from call module's 'getModuleName' function,
> which is obviously returns 'FloatMathPlugin' instead of 'FloatMathPluginz',
> and therefore comparison fails, and module fails to initialize :(
>
>
> Btw, i would find this thing much faster, if somebody wouldn't put
> following in the beginning of sqNamedPrims.c :
>
> #undef DEBUG   <<<< whyyyy?!?!?
>
> #undef DPRINTF
> #ifdef DEBUG
> #define DPRINTF(what) printf what
> #else
> #define DPRINTF(what)
> #endif
>
>
>
> --
> Best regards,
> Igor Stasenko AKA sig.
>


--
===========================================================================
John M. McIntosh <[hidden email]>
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
===========================================================================
Reply | Threaded
Open this post in threaded view
|

Re: What a cruel world!

Igor Stasenko
 
On 28 December 2010 10:38, John McIntosh
<[hidden email]> wrote:
>
> What directories, the older and other reasoning can determined by
> setting the debug value and if the plugins are loaded locally only or
> not. The entire logic was rewritten for 5.x
>

ok, how about quick answer.. :)
where i should put the built
libXYZ.dylib files where XYZ is plugin name, relatively to Cog.app
dir, in order to make sure they will be found?

My cmake config now able to build external plugins, but i'm not yet
figured out what is good place
to copy them, so they could be loaded by VM.

And since earlier you advised to abandon idea of making bundles out of
them, i'm not doing it (and besides its easier :)


--
Best regards,
Igor Stasenko AKA sig.
Reply | Threaded
Open this post in threaded view
|

Re: What a cruel world!

johnmci
 
In the resource directory of the app, that is the first place looked
at. Btw Apple will make you sign the binaries if you choose to
distribute via the osx app store.

On 12/28/10, Igor Stasenko <[hidden email]> wrote:

>
> On 28 December 2010 10:38, John McIntosh
> <[hidden email]> wrote:
>>
>> What directories, the older and other reasoning can determined by
>> setting the debug value and if the plugins are loaded locally only or
>> not. The entire logic was rewritten for 5.x
>>
>
> ok, how about quick answer.. :)
> where i should put the built
> libXYZ.dylib files where XYZ is plugin name, relatively to Cog.app
> dir, in order to make sure they will be found?
>
> My cmake config now able to build external plugins, but i'm not yet
> figured out what is good place
> to copy them, so they could be loaded by VM.
>
> And since earlier you advised to abandon idea of making bundles out of
> them, i'm not doing it (and besides its easier :)
>
>
> --
> Best regards,
> Igor Stasenko AKA sig.
>


--
===========================================================================
John M. McIntosh <[hidden email]>
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
===========================================================================
Reply | Threaded
Open this post in threaded view
|

Re: What a cruel world!

Igor Stasenko

On 28 December 2010 10:58, John McIntosh
<[hidden email]> wrote:
>
> In the resource directory of the app, that is the first place looked
> at.

Thanks.

> Btw Apple will make you sign the binaries if you choose to
> distribute via the osx app store.

Okay, then next question:
how to digitally sign the binary? What utility? What key file to use etc.

You don't have to answer if you don't know quick answer to it.
It can take care about it later, when i'll have the rest if stuff done.


>
> On 12/28/10, Igor Stasenko <[hidden email]> wrote:
>>
>> On 28 December 2010 10:38, John McIntosh
>> <[hidden email]> wrote:
>>>
>>> What directories, the older and other reasoning can determined by
>>> setting the debug value and if the plugins are loaded locally only or
>>> not. The entire logic was rewritten for 5.x
>>>
>>
>> ok, how about quick answer.. :)
>> where i should put the built
>> libXYZ.dylib files where XYZ is plugin name, relatively to Cog.app
>> dir, in order to make sure they will be found?
>>
>> My cmake config now able to build external plugins, but i'm not yet
>> figured out what is good place
>> to copy them, so they could be loaded by VM.
>>
>> And since earlier you advised to abandon idea of making bundles out of
>> them, i'm not doing it (and besides its easier :)
>>
>>
>> --
>> Best regards,
>> Igor Stasenko AKA sig.
>>
>
>
> --
> ===========================================================================
> John M. McIntosh <[hidden email]>
> Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
> ===========================================================================
>



--
Best regards,
Igor Stasenko AKA sig.