help loading latest Squeak FFI

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

help loading latest Squeak FFI

douglas mcpherson
Hi,

I'm trying to load the latest version of FFI for Squeak. (I'm using a recent Cog VM if it makes a difference)

1. Start with Squeak4.4-11925.image from ftp.squeakfoundation.org.
2. Update the image (latest update 12083).
3. Add a Monticello repository 'http://www.squeaksource.com/MetacelloRepository'.
4. Select and load latest configuration of FFI (ConfigurationOfFFI-tbn.23).
5. In a workspace, do: 
ConfigurationOfFFI load

Results in an MNU:
ExternalFunction class(Object)>>doesNotUnderstand: callingConventionModifierFor:

I'm sure I've got the process wrong somewhere. Should I be using a different repository? Maybe I'm trying something more appropriate to Pharo? Clearly, I'm confused. Help appreciated :)

Thanks,
Doug



Reply | Threaded
Open this post in threaded view
|

Re: help loading latest Squeak FFI

Bert Freudenberg
On 08.06.2012, at 23:47, Douglas McPherson <[hidden email]> wrote:

Hi,

I'm trying to load the latest version of FFI for Squeak. (I'm using a recent Cog VM if it makes a difference)

1. Start with Squeak4.4-11925.image from ftp.squeakfoundation.org.
2. Update the image (latest update 12083).
3. Add a Monticello repository 'http://www.squeaksource.com/MetacelloRepository'.
4. Select and load latest configuration of FFI (ConfigurationOfFFI-tbn.23).
5. In a workspace, do: 
ConfigurationOfFFI load

Results in an MNU:
ExternalFunction class(Object)>>doesNotUnderstand: callingConventionModifierFor:

I'm sure I've got the process wrong somewhere. Should I be using a different repository? Maybe I'm trying something more appropriate to Pharo? Clearly, I'm confused. Help appreciated :)

In Squeak we normally use Installer:

(Installer repository: 'http://source.squeak.org/FFI')
install: 'FFI-Pools';
install: 'FFI-Kernel';
install: 'FFI-Tests'.

(IIRC this is also in the "how to extend the system" workspace in squeak's menu)

- Bert -


Reply | Threaded
Open this post in threaded view
|

Re: help loading latest Squeak FFI

John McKeon


On Fri, Jun 8, 2012 at 7:11 PM, Bert Freudenberg <[hidden email]> wrote:
On 08.06.2012, at 23:47, Douglas McPherson <[hidden email]> wrote:

Hi,

I'm trying to load the latest version of FFI for Squeak. (I'm using a recent Cog VM if it makes a difference)

1. Start with Squeak4.4-11925.image from ftp.squeakfoundation.org.
2. Update the image (latest update 12083).
3. Add a Monticello repository 'http://www.squeaksource.com/MetacelloRepository'.
4. Select and load latest configuration of FFI (ConfigurationOfFFI-tbn.23).
5. In a workspace, do: 
ConfigurationOfFFI load

Results in an MNU:
ExternalFunction class(Object)>>doesNotUnderstand: callingConventionModifierFor:

I'm sure I've got the process wrong somewhere. Should I be using a different repository? Maybe I'm trying something more appropriate to Pharo? Clearly, I'm confused. Help appreciated :)

In Squeak we normally use Installer:

(Installer repository: 'http://source.squeak.org/FFI')
install: 'FFI-Pools';
install: 'FFI-Kernel';
install: 'FFI-Tests'.

Off topic: I have been meaning to say something about this so I thought this would be a good opportunity. If you run this code you will notice that FFI-Pools gets "loaded" three times, and FFI-Kernel twice, because install: adds the package name to the packages collection and then installs all the packages in packages.

(Installer repository: 'http://source.squeak.org/FFI')
addPackage: 'FFI-Pools';
addPackage: 'FFI-Kernel';
addPackage: 'FFI-Tests';
install.

avoids this redundancy (and probably cuts down on the repository traffic a bit).

John


(IIRC this is also in the "how to extend the system" workspace in squeak's menu)

- Bert -






Reply | Threaded
Open this post in threaded view
|

Re: help loading latest Squeak FFI

Bert Freudenberg
On 2012-06-09, at 02:14, John McKeon wrote:

>> On Fri, Jun 8, 2012 at 7:11 PM, Bert Freudenberg <[hidden email]> wrote:
>> On 08.06.2012, at 23:47, Douglas McPherson <[hidden email]> wrote:
>>
>>> Hi,
>>>
>>> I'm trying to load the latest version of FFI for Squeak. (I'm using a recent Cog VM if it makes a difference)
>>>
>>> 1. Start with Squeak4.4-11925.image from ftp.squeakfoundation.org.
>>> 2. Update the image (latest update 12083).
>>> 3. Add a Monticello repository 'http://www.squeaksource.com/MetacelloRepository'.
>>> 4. Select and load latest configuration of FFI (ConfigurationOfFFI-tbn.23).
>>> 5. In a workspace, do:
>>> ConfigurationOfFFI load
>>>
>>> Results in an MNU:
>>> ExternalFunction class(Object)>>doesNotUnderstand: callingConventionModifierFor:
>>>
>>> I'm sure I've got the process wrong somewhere. Should I be using a different repository? Maybe I'm trying something more appropriate to Pharo? Clearly, I'm confused. Help appreciated :)
>>
>> In Squeak we normally use Installer:
>>
>> (Installer repository: 'http://source.squeak.org/FFI')
>> install: 'FFI-Pools';
>> install: 'FFI-Kernel';
>> install: 'FFI-Tests'.
>>
> Off topic: I have been meaning to say something about this so I thought this would be a good opportunity. If you run this code you will notice that FFI-Pools gets "loaded" three times, and FFI-Kernel twice, because install: adds the package name to the packages collection and then installs all the packages in packages.
>
> (Installer repository: 'http://source.squeak.org/FFI')
> addPackage: 'FFI-Pools';
> addPackage: 'FFI-Kernel';
> addPackage: 'FFI-Tests';
> install.
>
> avoids this redundancy

Not quite. Try both - the first works, the second does not.

If you do only one install, all the definitions from all the packages are merged and installed together. This may work for some packages, but not others.

> (and probably cuts down on the repository traffic a bit).

Well, the second time it comes from the cache, but still.

However, I think we can have our cake and eat it, too: We'll just clean the package list after install. This makes the first recipe (which is wide-spread) work without double installing, and shouldn't affect the other.

I just commit a fix.

- Bert -



Reply | Threaded
Open this post in threaded view
|

Re: help loading latest Squeak FFI

Bert Freudenberg
In reply to this post by Bert Freudenberg

On 2012-06-09, at 01:11, Bert Freudenberg wrote:

> On 08.06.2012, at 23:47, Douglas McPherson <[hidden email]> wrote:
>
>> Hi,
>>
>> I'm trying to load the latest version of FFI for Squeak. (I'm using a recent Cog VM if it makes a difference)
>>
>> 1. Start with Squeak4.4-11925.image from ftp.squeakfoundation.org.
>> 2. Update the image (latest update 12083).
>> 3. Add a Monticello repository 'http://www.squeaksource.com/MetacelloRepository'.
>> 4. Select and load latest configuration of FFI (ConfigurationOfFFI-tbn.23).
>> 5. In a workspace, do:
>> ConfigurationOfFFI load
>>
>> Results in an MNU:
>> ExternalFunction class(Object)>>doesNotUnderstand: callingConventionModifierFor:
>>
>> I'm sure I've got the process wrong somewhere. Should I be using a different repository? Maybe I'm trying something more appropriate to Pharo? Clearly, I'm confused. Help appreciated :)

I now tried your method. In addition to failing to install FFI correctly, it also installs 149 classes in 23 (!) unneeded packages.

> In Squeak we normally use Installer:
>
> (Installer repository: 'http://source.squeak.org/FFI')
> install: 'FFI-Pools';
> install: 'FFI-Kernel';
> install: 'FFI-Tests'.

This does work.

> (IIRC this is also in the "how to extend the system" workspace in squeak's menu)
>
> - Bert -

I did remember correctly, it is in the workspace: click the "Help" menu, and choose the "Extending the system" item.

- Bert -



Reply | Threaded
Open this post in threaded view
|

Re: help loading latest Squeak FFI

Chris Muller-3
> I did remember correctly, it is in the workspace: click the "Help" menu, and choose the "Extending the system" item.

The "head" release of FFI can now be loaded straight from SqueakMap.

I also made FFI Community-Supported in SqueakMap, so anyone can add a
new release (but not update Andreas' old releases).  When we put out
the next version of Squeak, whatever the individual package versions
of FFI should be put in as a fixed-configuration release designated
for Squeak4.4.

The head release should never need to be updated again (unless the
package structure of FFI changes).

Reply | Threaded
Open this post in threaded view
|

Re: help loading latest Squeak FFI

douglas mcpherson
Bert, John, and Chris,

Thanks all very much. I should have RTFM, but looks like there was some nice side effects from my silly question :)

Doug

On Jun 9, 2012, at 09:11 , Chris Muller wrote:

>> I did remember correctly, it is in the workspace: click the "Help" menu, and choose the "Extending the system" item.
>
> The "head" release of FFI can now be loaded straight from SqueakMap.
>
> I also made FFI Community-Supported in SqueakMap, so anyone can add a
> new release (but not update Andreas' old releases).  When we put out
> the next version of Squeak, whatever the individual package versions
> of FFI should be put in as a fixed-configuration release designated
> for Squeak4.4.
>
> The head release should never need to be updated again (unless the
> package structure of FFI changes).
>


Reply | Threaded
Open this post in threaded view
|

Re: help loading latest Squeak FFI

Sean P. DeNigris
Administrator
In reply to this post by douglas mcpherson
douglas mcpherson wrote
I'm trying to load the latest version of FFI for Squeak. (I'm using a recent Cog VM if it makes a difference)
...
ConfigurationOfFFI load... Results in an MNU:
Great try! That *should* have worked.

Metacello is an executable documentation of package dependencies. Of course, it's relatively new and we're all learning how to use this stuff*! In this case, FFI's internal dependencies were not properly declared. The DNU you got was the same DNU that John got when he tried to load the packages together, because Kernel depends on Pools being fully-loaded. I've fixed the configuration, so no one ever has to remember what depends on what loading in which order.

Now you have cool options like:
(Installer repository: 'http://www.squeaksource.com/MetacelloRepository') install: 'ConfigurationOfFFI'.

"Load the equivalent of the pure-Installer script"
(Smalltalk at: #ConfigurationOfFFI) project bleedingEdge load: 'Tests'.

"Load all packages (includes examples and tests)"
(Smalltalk at: #ConfigurationOfFFI) project stableVersion load: 'ALL'.

"Load just the basics (e.g. for deployment)"
(Smalltalk at: #ConfigurationOfFFI) project stableVersion load: 'Core'.

"Load Tests on top of FFI Core"
(Smalltalk at: #ConfigurationOfFFI) project stableVersion load: 'Tests'.

The advantage here is that you have a real model. For example, these logical groups are reified once and available via these exact scripts no matter how the internal details of FFI change over time - 'Tests' might load 1 package or 100 package, but you don't have to care.

And Bert, notice I even used Installer to make you happy ;-)


* Luckily there is a new crop of tools coming (like Versionner), which will help - writing configurations by hand is like writing in assembler :(
Cheers,
Sean