[squeak-dev] Using a plugin?

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

[squeak-dev] Using a plugin?

Jan van de Sandt
Hello list,

I want to use the CurlPlugin as a http client. But I cannot find information on how a plugin should be installed/configured. I have loaded the package from SqueakSource using Monticello and I have downloaded the dll's and stored them in my SqueakVM directory. But when I try to run some code I get a primitive failed error.

I can find some information on how to create a plugin but not on how to use a plugin developed by someone else. Is the VMMaker package required when you just want to use a plugin? Please help me get started.

Jan.




Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Using a plugin?

johnmci
Ok, I assume you read http://wiki.squeak.org/squeak/5865
also you don't mention what platform (linux, windows, macintosh)

You only need VMMaker if you want to build a plugin.

In general to use a third party plugin you need:

(a) the smalltalk code that talks to the plugin
(b) the DLL
(c) any dynamically linked libraries the plugin relies on.

In general the primitive call will fail because:

(a) the VM cannot find the plugin DLL, so ensure the plugin DLL is  
placed where it can be found.
(b) the plugin DLL cannot find some dynamically linked library,  
usually plugins are statically linked to reduce this problem.
(c) the plugin startup logic decides some pre-condition or requirment  
isn't met, look for log messages.
(d) Plugins are tied to the Squeak callback API version, if you  
attempt to use a  plugin that uses the latest Squeak API against a VM  
that uses a older Squeak API it  will not load. Ensure you use the  
latest VM since it should support plugins complied today or 10 years  
back.
(e) On Unix systems beware the permissions on the DLL have to be  
correct, executable by the user for example.

On 22-Jan-09, at 1:03 PM, Jan van de Sandt wrote:

> Hello list,
>
> I want to use the CurlPlugin as a http client. But I cannot find  
> information on how a plugin should be installed/configured. I have  
> loaded the package from SqueakSource using Monticello and I have  
> downloaded the dll's and stored them in my SqueakVM directory. But  
> when I try to run some code I get a primitive failed error.
>
> I can find some information on how to create a plugin but not on how  
> to use a plugin developed by someone else. Is the VMMaker package  
> required when you just want to use a plugin? Please help me get  
> started.
>
> Jan.
>
>
>

--
=
=
=
========================================================================
John M. McIntosh <[hidden email]>
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
=
=
=
========================================================================




Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Using a plugin?

Jan van de Sandt
Hello John,

I'm using a recent Squeak VM, version 3.10.2-7179 and I use windows.

Thank you for the information, I followed the steps you describe. I now discovered that the plugin does work, at least partially. I can download contents using http via the plugin. The method that gives a primitiveFailed error is "Curl curlVersion". So the general mechanism works only a specific message gives an error.

Jan.

On Fri, Jan 23, 2009 at 8:05 PM, John M McIntosh <[hidden email]> wrote:
Ok, I assume you read http://wiki.squeak.org/squeak/5865
also you don't mention what platform (linux, windows, macintosh)

You only need VMMaker if you want to build a plugin.

In general to use a third party plugin you need:

(a) the smalltalk code that talks to the plugin
(b) the DLL
(c) any dynamically linked libraries the plugin relies on.

In general the primitive call will fail because:

(a) the VM cannot find the plugin DLL, so ensure the plugin DLL is placed where it can be found.
(b) the plugin DLL cannot find some dynamically linked library, usually plugins are statically linked to reduce this problem.
(c) the plugin startup logic decides some pre-condition or requirment isn't met, look for log messages.
(d) Plugins are tied to the Squeak callback API version, if you attempt to use a  plugin that uses the latest Squeak API against a VM that uses a older Squeak API it  will not load. Ensure you use the latest VM since it should support plugins complied today or 10 years back.
(e) On Unix systems beware the permissions on the DLL have to be correct, executable by the user for example.


On 22-Jan-09, at 1:03 PM, Jan van de Sandt wrote:

Hello list,

I want to use the CurlPlugin as a http client. But I cannot find information on how a plugin should be installed/configured. I have loaded the package from SqueakSource using Monticello and I have downloaded the dll's and stored them in my SqueakVM directory. But when I try to run some code I get a primitive failed error.

I can find some information on how to create a plugin but not on how to use a plugin developed by someone else. Is the VMMaker package required when you just want to use a plugin? Please help me get started.

Jan.




--
===========================================================================
John M. McIntosh <[hidden email]>
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
===========================================================================







Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Using a plugin?

johnmci

On 23-Jan-09, at 11:30 AM, Jan van de Sandt wrote:

> Hello John,
>
> I'm using a recent Squeak VM, version 3.10.2-7179 and I use windows.
>
> Thank you for the information, I followed the steps you describe. I  
> now discovered that the plugin does work, at least partially. I can  
> download contents using http via the plugin. The method that gives a  
> primitiveFailed error is "Curl curlVersion". So the general  
> mechanism works only a specific message gives an error.
>
> Jan.

Let me add another point

(f) the primitive can fail if the smalltalk code does not match the  
plugin code. Like using  newer smalltalk code with older plugin.

In this case
curlVersion
        <primitive: 'primCurlVersion' module: 'CurlPlugin'>
        ^self primitiveFailedInvalidCurlHandle

where the primCurlVersion appears to be added in march of 2007 so I  
wonder when the curl windows dll was compiled and what code base it  
used.

If the Smalltalk code contains SUnits (in this case CurlTests) you  
should run them and see what happens.

--
=
=
=
========================================================================
John M. McIntosh <[hidden email]>
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
=
=
=
========================================================================