reloading ffi library

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

reloading ffi library

Steven Costiou-2

Hi,

noob question: i installed bloc and tried to run examples.

It worked well on Fedora 27 but not on latest Debian 64 bits because the path of libcairo.so.2 was wrong.

So i fixed it in the code, but when trying the bloc examples again the lib path is still wrong (in the debugger).

 

Is there a way to reload the cairo lib or to reset it, so that the path would be right and it would find the lib ?

 

Steven.

Reply | Threaded
Open this post in threaded view
|

Re: reloading ffi library

EstebanLM
you need to reset FFI: 

FFIMethodRegistry resetAll.

Esteban

On 7 Dec 2017, at 16:04, Steven Costiou <[hidden email]> wrote:

Hi,

noob question: i installed bloc and tried to run examples.

It worked well on Fedora 27 but not on latest Debian 64 bits because the path of libcairo.so.2 was wrong.

So i fixed it in the code, but when trying the bloc examples again the lib path is still wrong (in the debugger).

 

Is there a way to reload the cairo lib or to reset it, so that the path would be right and it would find the lib ?

 

Steven.


Reply | Threaded
Open this post in threaded view
|

Re: reloading ffi library

Ben Coman

On 7 Dec 2017, at 16:04, Steven Costiou <[hidden email]> wrote:

Hi,

noob question: i installed bloc and tried to run examples.

It worked well on Fedora 27 but not on latest Debian 64 bits because the path of libcairo.so.2 was wrong.

So i fixed it in the code, but when trying the bloc examples again the lib path is still wrong (in the debugger).

 

Is there a way to reload the cairo lib or to reset it, so that the path would be right and it would find the lib ?

I've also been frustrated by this, particularly as a supa-fresh-FFI-noob before I understood what was happening.
I've found it a minor annoyance but sufficient to to close and reopen an image to reset things,
but being able to do it live in-Image is really nice.

On 7 December 2017 at 23:41, Esteban Lorenzano <[hidden email]> wrote:
you need to reset FFI: 

FFIMethodRegistry resetAll.

That is really nice to know, but by the time I need it I will probably have forgotten it, 
and closing/reopening the Image will be faster than searching forum.world.st or asking again the mail list.
Could we possibly have World > Tools > Reset FFI ?

cheers -ben
Reply | Threaded
Open this post in threaded view
|

Re: reloading ffi library

Ben Coman
On 8 December 2017 at 00:43, Ben Coman <[hidden email]> wrote:

>>
>>
>> On 7 Dec 2017, at 16:04, Steven Costiou <[hidden email]> wrote:
>>
>> Hi,
>>
>> noob question: i installed bloc and tried to run examples.
>>
>> It worked well on Fedora 27 but not on latest Debian 64 bits because the path of libcairo.so.2 was wrong.
>>
>> So i fixed it in the code, but when trying the bloc examples again the lib path is still wrong (in the debugger).
>>
>>
>>
>> Is there a way to reload the cairo lib or to reset it, so that the path would be right and it would find the lib ?
>
> I've also been frustrated by this, particularly as a supa-fresh-FFI-noob before I understood what was happening.
> I've found it a minor annoyance but sufficient to to close and reopen an image to reset things,
> but being able to do it live in-Image is really nice.
>
> On 7 December 2017 at 23:41, Esteban Lorenzano <[hidden email]> wrote:
>>
>> you need to reset FFI:
>>
>> FFIMethodRegistry resetAll.
>
>
> That is really nice to know, but by the time I need it I will probably have forgotten it,
> and closing/reopening the Image will be faster than searching forum.world.st or asking again the mail list.
> Could we possibly have World > Tools > Reset FFI ?
>
> cheers -ben

Added https://pharo.fogbugz.com/f/cases/20835/Add-World-Tools-Reset-FFI
I should have a go at doing it, but I'm not sure which class is
preferred to hang the menu pragma on,
and also I'm still lagging for contributing to Pharo 7 (not really any
technical issue now, but lack of time to practice the workflow)

cheers -ben

Reply | Threaded
Open this post in threaded view
|

Re: reloading ffi library

Steven Costiou-2
In reply to this post by EstebanLM

Thanks :)

Will try it :)

 

Le 2017-12-07 16:41, Esteban Lorenzano a écrit :

you need to reset FFI: 
 
FFIMethodRegistry resetAll.
 
Esteban

On 7 Dec 2017, at 16:04, Steven Costiou <[hidden email]> wrote:

Hi,

noob question: i installed bloc and tried to run examples.

It worked well on Fedora 27 but not on latest Debian 64 bits because the path of libcairo.so.2 was wrong.

So i fixed it in the code, but when trying the bloc examples again the lib path is still wrong (in the debugger).

 

Is there a way to reload the cairo lib or to reset it, so that the path would be right and it would find the lib ?

 

Steven.

 

Reply | Threaded
Open this post in threaded view
|

Re: reloading ffi library

Stephane Ducasse-3
In reply to this post by Ben Coman
Thanks Ben.
I have a question. Would it make sense to have a setting to reset on
each session the registry?

What you should know is that Guille is actively improving
(refactoring, rethinking the API of iceberg) to produce a better UI
then.
We are really concerned how we can get the same confort than we got before.
We do not send all the exchanges we have on the topics

Stef


On Thu, Dec 7, 2017 at 5:52 PM, Ben Coman <[hidden email]> wrote:

> On 8 December 2017 at 00:43, Ben Coman <[hidden email]> wrote:
>>>
>>>
>>> On 7 Dec 2017, at 16:04, Steven Costiou <[hidden email]> wrote:
>>>
>>> Hi,
>>>
>>> noob question: i installed bloc and tried to run examples.
>>>
>>> It worked well on Fedora 27 but not on latest Debian 64 bits because the path of libcairo.so.2 was wrong.
>>>
>>> So i fixed it in the code, but when trying the bloc examples again the lib path is still wrong (in the debugger).
>>>
>>>
>>>
>>> Is there a way to reload the cairo lib or to reset it, so that the path would be right and it would find the lib ?
>>
>> I've also been frustrated by this, particularly as a supa-fresh-FFI-noob before I understood what was happening.
>> I've found it a minor annoyance but sufficient to to close and reopen an image to reset things,
>> but being able to do it live in-Image is really nice.
>>
>> On 7 December 2017 at 23:41, Esteban Lorenzano <[hidden email]> wrote:
>>>
>>> you need to reset FFI:
>>>
>>> FFIMethodRegistry resetAll.
>>
>>
>> That is really nice to know, but by the time I need it I will probably have forgotten it,
>> and closing/reopening the Image will be faster than searching forum.world.st or asking again the mail list.
>> Could we possibly have World > Tools > Reset FFI ?
>>
>> cheers -ben
>
> Added https://pharo.fogbugz.com/f/cases/20835/Add-World-Tools-Reset-FFI
> I should have a go at doing it, but I'm not sure which class is
> preferred to hang the menu pragma on,
> and also I'm still lagging for contributing to Pharo 7 (not really any
> technical issue now, but lack of time to practice the workflow)
>
> cheers -ben
>

Reply | Threaded
Open this post in threaded view
|

Re: reloading ffi library

Ben Coman


On 8 December 2017 at 03:40, Stephane Ducasse <[hidden email]> wrote:
Thanks Ben.
I have a question. Would it make sense to have a setting to reset on
each session the registry?

Naively I'd presume it must always do this to cover:
* the OS upgrading libraries
* moving images between OS platforms and dropping the old platform's FFI in memory
* moving images between flavours of Linux where libraries are in different locations
* moving images between 64bit & 32bit VMs (or wait! I forget if thats possible?)

What are the use cases where you would *not* reset the FFI registry each session? 
 

What you should know is that Guille is actively improving
(refactoring, rethinking the API of iceberg) to produce a better UI then.
We are really concerned how we can get the same confort than we got before.
 

We do not send all the exchanges we have on the topics

Understood.  Email is a broad but narrow channel.  Although if you use a whiteboard
to brainstorm, a quick phone photo & summary notes to the mail list is a good way to 
ensure all participants are aligned as well as keep the community informed.
 
cheers -ben


On Thu, Dec 7, 2017 at 5:52 PM, Ben Coman <[hidden email]> wrote:
> On 8 December 2017 at 00:43, Ben Coman <[hidden email]> wrote:
>>>
>>>
>>> On 7 Dec 2017, at 16:04, Steven Costiou <[hidden email]> wrote:
>>>
>>> Hi,
>>>
>>> noob question: i installed bloc and tried to run examples.
>>>
>>> It worked well on Fedora 27 but not on latest Debian 64 bits because the path of libcairo.so.2 was wrong.
>>>
>>> So i fixed it in the code, but when trying the bloc examples again the lib path is still wrong (in the debugger).
>>>
>>>
>>>
>>> Is there a way to reload the cairo lib or to reset it, so that the path would be right and it would find the lib ?
>>
>> I've also been frustrated by this, particularly as a supa-fresh-FFI-noob before I understood what was happening.
>> I've found it a minor annoyance but sufficient to to close and reopen an image to reset things,
>> but being able to do it live in-Image is really nice.
>>
>> On 7 December 2017 at 23:41, Esteban Lorenzano <[hidden email]> wrote:
>>>
>>> you need to reset FFI:
>>>
>>> FFIMethodRegistry resetAll.
>>
>>
>> That is really nice to know, but by the time I need it I will probably have forgotten it,
>> and closing/reopening the Image will be faster than searching forum.world.st or asking again the mail list.
>> Could we possibly have World > Tools > Reset FFI ?
>>
>> cheers -ben
>
> Added https://pharo.fogbugz.com/f/cases/20835/Add-World-Tools-Reset-FFI
> I should have a go at doing it, but I'm not sure which class is
> preferred to hang the menu pragma on,
> and also I'm still lagging for contributing to Pharo 7 (not really any
> technical issue now, but lack of time to practice the workflow)
>
> cheers -ben
>


Reply | Threaded
Open this post in threaded view
|

Re: reloading ffi library

EstebanLM
In reply to this post by Ben Coman


On 7 Dec 2017, at 17:43, Ben Coman <[hidden email]> wrote:


On 7 Dec 2017, at 16:04, Steven Costiou <[hidden email]> wrote:

Hi,

noob question: i installed bloc and tried to run examples.

It worked well on Fedora 27 but not on latest Debian 64 bits because the path of libcairo.so.2 was wrong.

So i fixed it in the code, but when trying the bloc examples again the lib path is still wrong (in the debugger).

 

Is there a way to reload the cairo lib or to reset it, so that the path would be right and it would find the lib ?

I've also been frustrated by this, particularly as a supa-fresh-FFI-noob before I understood what was happening.
I've found it a minor annoyance but sufficient to to close and reopen an image to reset things,
but being able to do it live in-Image is really nice.

probably what we need to do is to include cairo library into our distribution as we do with others. 
this will minimise the problem from one side, but it will enlarge it in other (some distros disallow/discourage the inclusion of 3rd party libraries with your binary)

Esteban


On 7 December 2017 at 23:41, Esteban Lorenzano <[hidden email]> wrote:
you need to reset FFI: 

FFIMethodRegistry resetAll.

That is really nice to know, but by the time I need it I will probably have forgotten it, 
and closing/reopening the Image will be faster than searching forum.world.st or asking again the mail list.
Could we possibly have World > Tools > Reset FFI ?

cheers -ben