Boost logo

Boost-Build :

Subject: Re: [Boost-build] Custom generator problem
From: Johan Nilsson (r.johan.nilsson_at_[hidden])
Date: 2009-11-24 03:51:17


Vladimir Prus wrote:
> On Tuesday 17 November 2009 16:20:35 Johan Nilsson wrote:
>
>> Hi,
>>
>> I've been working on a custom generator for some time now, and have
>> it mostly working now, with one annoying problem. It appears that
>> using the alias rule on a target generated with my generator
>> triggers a "Duplicate name of actual target" error.
>
> local copy-target = [ new file-target $(target-base) : : $(project) :
> $(copy-action) ] ;
>
> copied-targets += $(copy-target) ;
>
> Here, you create a target, and never pass it via
> virtual-target.register. Every newly created target must be passed
> via it.

Did you try to register $(copied-targets) as well? It doesn't make any
difference to me - still seeing the same problem in combination with alias.
I just changed the last line of generate-targets to this (to no effect):

  return [ sequence.transform virtual-target.register : $(main-target)
$(main-foo2-target) $(copy2foo2tagged-target) $(copied-targets) ] ;

Actually, not having copied-targets registered has a history. In the "real"
generator I originally registered all virtual targets, effectively the same
as above. IIRC there was a problem with this. These are the details (caveat:
only as I remember it, I haven't stepped through the changes in my repo):

I started to get "duplicate name of actual target" at a certain point during
the development of the generator and I found out that by removing e.g. the
"copied-targets" from registration I managed to get rid of those. I thought
that made sense as I believed that virtual-targets.register descended
through the dependency graph and found those anyway as long as they were
dependencies of the targets that I _did_ register (such as in the example
above). Of course, registering the virtual targets should take care of that
duplication but I figured that I'd misunderstood something in the docs or
that there was actually a bug lurking in there somewhere.

Sorry, I've got no easy way of reproducing this latest part. Still - the
current error occurs even with the added registration of "copied-targets".

Thanks / Johan


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk