Boost logo

Boost-Build :

Subject: Re: [Boost-build] Failing dependency_test.py test.
From: Jurko Gospodnetić (jurko.gospodnetic_at_[hidden])
Date: 2012-07-16 09:36:32


   Hi.

>> The problem is a result of these dependencies:
>>
>> INCLUDES x.cpp : x.bar ;
>> DEPENDS <object(c-scanner)>x.cpp : x.cpp ;
>>
>> The result is that <object(c-scanner)>x.cpp
>> (which binds to x.cpp) depends on x.bar.
>
> Ok, what if we could avoid the INCLUDES x.cpp : x.bar all together?
>
> I found that the include in question is added in virtual-target.jam
> in the action.actualize() rule where all targets are said to include
> each other. There is also the following comment above this code:
>
> # This works around a bug with -j and actions that produce multiple
> # target, where:
> # - dependency on the first output is found, and the action is
> # started
> # - dependency on the second output is found, and bjam noticed that
> # command is already running
> # - instead of waiting for the command, dependents of the second
> # targets are immediately updated.
>
> If we updated Boost Jam to work correctly in this case there would be
> no more need for this INCLUDE, right?

   Nah, no luck. That bug, if it ever existed, has since been fixed in
Boost Jam. I've tested it using the following test and it passes every time:

> #!/usr/bin/python
> import BoostBuild
>
> t = BoostBuild.Tester(pass_toolset=False)
>
> t.write("file.jam", r"""
> if $(NT)
> {
> .cp = copy ;
> .touch = echo. ">" ;
> }
> else
> {
> .cp = cp ;
> .touch = touch ;
> }
>
> rule sleep-command ( seconds )
> {
> if $(NT)
> {
> return ping 127.0.0.1 -n $(seconds) -w 1000 >NUL ;
> }
> else
> {
> return sleep $(seconds) ;
> }
> }
>
> rule build2 ( target1 target2 )
> {
> sleep-cmd on $(target1) $(target2) = [ sleep-command 5 ] ;
> }
>
> actions build2
> {
> $(.touch) "$(<[1])"
> $(sleep-cmd)
> $(.touch) "$(<[2])"
> }
>
> rule copy ( target : source )
> {
> sleep-cmd on $(target) = [ sleep-command 2 ] ;
> DEPENDS $(target) : $(source) ;
> }
>
> actions copy
> {
> $(.cp) "$(>)" "$(<)"
> $(sleep-cmd)
> }
>
> build2 a b ;
> copy a2 : a ;
> copy b2 : b ;
> DEPENDS all : a2 b2 ;
> """)
>
> t.run_build_system(["-ffile.jam", "-j 2"])

   I also removed the aforementioned INCLUDE call and it made no
difference to the original test :-( as the scanner's
'<pbin/gcc-3/debug/link-static>x.cpp (internal node)' target is still
listed as depending on x.bar in -d+12 output...

   Off to find out some more about this... :-(

   Best regards,
     Jurko Gospodnetić


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