Boost logo

Boost-Build :

Subject: Re: [Boost-build] Depending on an exe from two files
From: Julio M. Merino Vidal (jmmv84_at_[hidden])
Date: 2008-10-20 10:26:20


On Mon, Oct 20, 2008 at 12:30 AM, Vladimir Prus <ghost_at_[hidden]> wrote:
>
> Can you provide the exact error you get, a small project reproducing this
> problem (or unambiguous instructions how to reproduce this from SVN state),
> and output of "bjam --version".

Hm, actually writing a simpler Jamfile.v2 has made me discover that my
explanation was not too accurate. But still, the duplicate target
issue is there. First, create three source files with a main routine
that does nothing (for simplicity). Call them helper.cpp, a-test.cpp
and b-test.cpp. Then, use this Jamfile:

---- cut here ----
using testing ;

if ! $(BOOST_ROOT)
{
    BOOST_ROOT = [ modules.peek : BOOST_ROOT ] ;
}

project :
    : requirements
      <include>$(BOOST_ROOT)
    ;

exe helper
    : helper.cpp
    : <dependency>$(BOOT_ROOT)//filesystem
    ;

test-suite process :
    [ run a-test.cpp
        :
        :
        : <dependency>helper
        ]

    [ run b-test.cpp
        :
        :
        : <dependency>helper
        ]

    ;
---- cut here ----

With this file, try running 'bjam' and see it failing with:

/Users/jmmv/Projects/boost/trunk/tools/build/v2/build/virtual-target.jam:1047:
in virtual-target.register-actual-name from module virtual-target
error: Duplicate name of actual target: <pbin/darwin-4.0.1/debug>helper
error: previous virtual target { darwin%darwin.link-helper.EXE {
darwin%darwin.compile.c++-helper.o.OBJ { helper.cpp.CPP } } {
darwin%darwin.link.dll-libboost_filesystem-xgcc40-d-1_37.dylib.SHARED_LIB
{ darwin%darwin.compile.c++-operations.o.OBJ { operations.cpp.CPP } }
{ darwin%darwin.compile.c++-path.o.OBJ { path.cpp.CPP } } {
darwin%darwin.compile.c++-portability.o.OBJ { portability.cpp.CPP } }
{ darwin%darwin.compile.c++-utf8_codecvt_facet.o.OBJ {
utf8_codecvt_facet.cpp.CPP } } {
darwin%darwin.link.dll-libboost_system-xgcc40-d-1_37.dylib.SHARED_LIB
{ darwin%darwin.compile.c++-error_code.o.OBJ { error_code.cpp.CPP } }
} } }
error: created from ./helper
error: another virtual target { darwin%darwin.link-helper.EXE {
darwin%darwin.compile.c++-helper.o.OBJ { helper.cpp.CPP } } {
darwin%darwin.link.dll-libboost_filesystem-xgcc40-d-1_37.dylib.SHARED_LIB
{ darwin%darwin.compile.c++-operations.o.OBJ { operations.cpp.CPP } }
{ darwin%darwin.compile.c++-path.o.OBJ { path.cpp.CPP } } {
darwin%darwin.compile.c++-portability.o.OBJ { portability.cpp.CPP } }
{ darwin%darwin.compile.c++-utf8_codecvt_facet.o.OBJ {
utf8_codecvt_facet.cpp.CPP } } {
darwin%darwin.link.dll-libboost_system-xgcc40-d-1_37.dylib.SHARED_LIB
{ darwin%darwin.compile.c++-error_code.o.OBJ { error_code.cpp.CPP } }
} } }
error: created from ./helper
error: added properties: <python-debugging>off <python>2.3 <threadapi>pthread
error: removed properties: none
/Users/jmmv/Projects/boost/trunk/tools/build/v2/build/virtual-target.jam:480:
in actualize-no-scanner from module object(file-target)@538
/Users/jmmv/Projects/boost/trunk/tools/build/v2/build/virtual-target.jam:130:
in object(file-target)@538.actualize from module
object(file-target)@538
/Users/jmmv/Projects/boost/trunk/tools/build/v2/build/virtual-target.jam:779:
in actualize-source-type from module object(action)@555
/Users/jmmv/Projects/boost/trunk/tools/build/v2/build/virtual-target.jam:798:
in actualize-sources from module object(action)@555
/Users/jmmv/Projects/boost/trunk/tools/build/v2/build/virtual-target.jam:740:
in object(action)@555.actualize from module object(action)@555
/Users/jmmv/Projects/boost/trunk/tools/build/v2/build/virtual-target.jam:301:
in actualize-action from module object(file-target)@556
/Users/jmmv/Projects/boost/trunk/tools/build/v2/build/virtual-target.jam:489:
in actualize-no-scanner from module object(file-target)@556
/Users/jmmv/Projects/boost/trunk/tools/build/v2/build/virtual-target.jam:130:
in object(file-target)@556.actualize from module
object(file-target)@556
/Users/jmmv/Projects/boost/trunk/tools/build/v2/build-system.jam:695:
in load from module build-system
/Users/jmmv/Projects/boost/trunk/tools/build/v2/kernel/modules.jam:283:
in import from module modules
/Users/jmmv/Projects/boost/trunk/tools/build/v2/kernel/bootstrap.jam:128:
in boost-build from module
/Users/jmmv/Projects/boost/trunk/tools/build/v2/boost-build.jam:8: in
module scope from module

Now, if you try to build each target individually, no problems appear.
 Even running 'bjam a-test b-test' works (building helper as a
prerequisite first, without doing it manually).

Also, I have found that if you remove the library dependency on
filesystem from the helper exe target, the problem disappears.

And the version I'm currently using is:
Boost.Build V2 (Milestone 12)
Boost.Jam 03.1.17

The problem happens in all platforms I've tried (OS X, Linux and Windows).

Let me know if you need anything else to reproduce the issue.

(In case something here does not work, you can check out the
Boost.Process repository from
https://svn.boost.org/svn/boost/sandbox/SOC/2006/process/trunk/ and
then run 'bjam' into libs/process/test.)

Thanks,

-- 
Julio M. Merino Vidal <jmmv84_at_[hidden]>

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