You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@buildr.apache.org by Ittay Dror <it...@gmail.com> on 2008/10/20 12:44:17 UTC

'super' doesn't invoke super method under drb?

Hi,


I'm trying to use the drb addon.


I have a class that overrides invoke_prerequisites, and at the end calls 
'super'. Without drb all works fine. When used under drb, it is as if 
the super method is not called (trace doesn't show the tasks being 
invoked and even a print debug in rake isn't printed). Trying to get the 
method via self.class.superclass.instance_method returns the right 
method). Any hints as to why this might happen?


Thanks,

Ittay

-- 
--
Ittay Dror <it...@gmail.com>



Re: 'super' doesn't invoke super method under drb?

Posted by Ittay Dror <it...@tikalk.com>.

Assaf Arkin wrote:
> On Mon, Oct 20, 2008 at 8:14 PM, Victor Hugo Borja <vi...@gmail.com> wrote:
>   
>> On Mon, Oct 20, 2008 at 5:44 AM, Ittay Dror <it...@gmail.com> wrote:
>>
>>     
>>> I have a class that overrides invoke_prerequisites, and at the end calls
>>> 'super'. Without drb all works fine. When used under drb, it is as if the
>>> super method is not called (trace doesn't show the tasks being invoked and
>>> even a print debug in rake isn't printed). Trying to get the method via
>>> self.class.superclass.instance_method returns the right method). Any hints
>>> as to why this might happen?
>>>
>>>       
>> I suppose that was because the first implementation of
>> DRbApplication#clear_invoked_tasks used to clear the tasks hash and recreate
>> each of then with something like .. original_task.class.define_task(...), so
>> if a task had been extended with a module or set some ivars, that
>> information was being lost.
>> The current implementation just reenables the task allowing it to execute
>> again, and restores the original task prerequisites/actions. See the
>> code/specs if you need more details.
>>
>> The current drb impl, recreates only tasks created by buildr itself, those
>> tasks created by your buildfile are just reenabled with clear_invoked_tasks.
>>     
>
> I'm not sure how far you can stretch this.  Each time you load the
> buildfile, you might have different source files or partially built
> files, and tasks that wire themselves differently depending on what
> remains to be built.  For some changes, re-enabling the task is not
> enough, on the repeat run it may build too much or not enough.  I'm
> not sure how people are going to handle the difference between what
> the buildfile should be doing and what goes on in the background.
>   
I agree that a buildfile won't be "drb-able" as-is in most cases. 
However, after making some simple changes, I was able to use my (very 
complex) build under drb. I opened an issue in Jira with some wishes 
that would enable easier integration.

About different source files: I think that in general it is not good to 
read the list of sources from disk during the loading of buildfile as it 
is IO and therefore slow (and with many modules, very noticable)

Ittay
> Assaf
>
>
>   
>> --
>> vic
>>
>> Quaerendo invenietis.
>>
>>     
>
>   

-- 
Ittay Dror <it...@tikalk.com>
Tikal <http://www.tikalk.com>
Tikal Project <http://tikal.sourceforge.net>


Re: 'super' doesn't invoke super method under drb?

Posted by Assaf Arkin <ar...@intalio.com>.
On Mon, Oct 20, 2008 at 8:14 PM, Victor Hugo Borja <vi...@gmail.com> wrote:
> On Mon, Oct 20, 2008 at 5:44 AM, Ittay Dror <it...@gmail.com> wrote:
>
>> I have a class that overrides invoke_prerequisites, and at the end calls
>> 'super'. Without drb all works fine. When used under drb, it is as if the
>> super method is not called (trace doesn't show the tasks being invoked and
>> even a print debug in rake isn't printed). Trying to get the method via
>> self.class.superclass.instance_method returns the right method). Any hints
>> as to why this might happen?
>>
>
> I suppose that was because the first implementation of
> DRbApplication#clear_invoked_tasks used to clear the tasks hash and recreate
> each of then with something like .. original_task.class.define_task(...), so
> if a task had been extended with a module or set some ivars, that
> information was being lost.
> The current implementation just reenables the task allowing it to execute
> again, and restores the original task prerequisites/actions. See the
> code/specs if you need more details.
>
> The current drb impl, recreates only tasks created by buildr itself, those
> tasks created by your buildfile are just reenabled with clear_invoked_tasks.

I'm not sure how far you can stretch this.  Each time you load the
buildfile, you might have different source files or partially built
files, and tasks that wire themselves differently depending on what
remains to be built.  For some changes, re-enabling the task is not
enough, on the repeat run it may build too much or not enough.  I'm
not sure how people are going to handle the difference between what
the buildfile should be doing and what goes on in the background.

Assaf


>
> --
> vic
>
> Quaerendo invenietis.
>

Re: 'super' doesn't invoke super method under drb?

Posted by Victor Hugo Borja <vi...@gmail.com>.
On Mon, Oct 20, 2008 at 5:44 AM, Ittay Dror <it...@gmail.com> wrote:

> I have a class that overrides invoke_prerequisites, and at the end calls
> 'super'. Without drb all works fine. When used under drb, it is as if the
> super method is not called (trace doesn't show the tasks being invoked and
> even a print debug in rake isn't printed). Trying to get the method via
> self.class.superclass.instance_method returns the right method). Any hints
> as to why this might happen?
>

I suppose that was because the first implementation of
DRbApplication#clear_invoked_tasks used to clear the tasks hash and recreate
each of then with something like .. original_task.class.define_task(...), so
if a task had been extended with a module or set some ivars, that
information was being lost.
The current implementation just reenables the task allowing it to execute
again, and restores the original task prerequisites/actions. See the
code/specs if you need more details.

The current drb impl, recreates only tasks created by buildr itself, those
tasks created by your buildfile are just reenabled with clear_invoked_tasks.

-- 
vic

Quaerendo invenietis.