Re: Boost-build Digest, Vol 49, Issue 27

View: New views
2 Messages — Rating Filter:   Alert me  

Parent Message unknown Re: Boost-build Digest, Vol 49, Issue 27

by Jim Gallagher :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Johan,

I'm fine with "alias stage ;". That makes sense.

So now I have a different issue. I have situations like this, where I
would like to stage a given lib to both a client and a server staging
area:

lib a : a.c ;
lib b : b.c ;
lib c : c.c ;

install stage-client
        : a c
        : <location>$(STAGE_CLIENT)
;

install stage-server
        : b c
        : <location>$(STAGE_SERVER)
;

explicit stage stage-client stage-server ;
alias stage : stage-client stage-server ;

If I run "bjam stage" at the subproject level, it works fine. If I run
it at the top level, I get errors like this:

M:\test_20090928\src>bjam stage
M:/test_20090928/boost-build/build\virtual-target.jam:996: in
virtual-target.register-actual-name from module virtual-target
error: Duplicate name of actual target: <pstage>c.exe
error: previous virtual target { common%common.copy-c.exe.EXE {
common%common.copy-c.exe.EXE { msvc%msvc.link-c.exe.EXE {
msvc%msvc.compile.c-c.obj.OBJ { c.c.C } } } } }
error: created from ./stage
error: another virtual target { common%common.copy-c.exe.EXE {
common%common.copy-c.exe.EXE { msvc%msvc.link-c.exe.EXE {
msvc%msvc.compile.c-c.obj.OBJ { c.c.C } } } } }
error: created from ./stage
error: added properties:  none
error: removed properties:  none
M:/test_20090928/boost-build/build\virtual-target.jam:459: in
actualize-no-scanner from module object(file-target)@5045
M:/test_20090928/boost-build/build\virtual-target.jam:111: in
object(file-target)@5045.  actualize from module
object(file-target)@5045
M:/test_20090928/boost-build\build-system.jam:488: in load from module
build-system
M:\test_20090928\devutils\..\boost-build\kernel\modules.jam:261: in
import from module modules
M:\test_20090928\devutils\..\boost-build\kernel\bootstrap.jam:132: in
boost-build from module
M:\test_20090928\devutils\..\boost-build\boost-build.jam:1: in module
scope from module

I think the errors are telling me that it has a problem with c.exe
being a target that gets copied to two different places. Any idea how
to get around this?

Thanks,
Jim

> Try:
>
> alias stage ;
>
> Alternatives (to avoid every Jamfile having to define this):
>
> As you have the paths to the Jamfiles, you _could_ make a regex search for
> e.g. "^\s*install\s+stage" (not sure if this exact regex works with the
> Boost.Jam regex engine). Hackish, but workable. As a variation you could add
> your own unique tags somewhere inside the Jamfiles to mark file as having a
> stage target.
>
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build

Re: Boost-build Digest, Vol 49, Issue 27

by Johan Nilsson-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

[Please don't reply to digests. It kinda makes the subject unclear.]

Answers below.

Jim Gallagher wrote:
> Johan,
>
> I'm fine with "alias stage ;". That makes sense.

Ok.

>
> So now I have a different issue. I have situations like this, where I
> would like to stage a given lib to both a client and a server staging
> area:
>
> lib a : a.c ;
> lib b : b.c ;
> lib c : c.c ;
>
> install stage-client
>> a c
>> <location>$(STAGE_CLIENT)
> ;
>
> install stage-server
>> b c
>> <location>$(STAGE_SERVER)
> ;
>
> explicit stage stage-client stage-server ;
> alias stage : stage-client stage-server ;
>
> If I run "bjam stage" at the subproject level, it works fine. If I run
> it at the top level, I get errors like this:
>
> M:\test_20090928\src>bjam stage
> M:/test_20090928/boost-build/build\virtual-target.jam:996: in
> virtual-target.register-actual-name from module virtual-target
> error: Duplicate name of actual target: <pstage>c.exe
> error: previous virtual target { common%common.copy-c.exe.EXE {
> common%common.copy-c.exe.EXE { msvc%msvc.link-c.exe.EXE {
> msvc%msvc.compile.c-c.obj.OBJ { c.c.C } } } } }

[snip]

> M:\test_20090928\devutils\..\boost-build\boost-build.jam:1: in module
> scope from module
>
> I think the errors are telling me that it has a problem with c.exe
> being a target that gets copied to two different places. Any idea how
> to get around this?

First of all, your errors don't look like they're related to the sample
definitions above; c is declared as a library above and the errors indicate
that it's an executable. Could you reproduce the problem with a minimal
Jamroot + needed sources?

Second, the errors seem indicate that the problem is that two targets with
the same name ("c.exe") are being copied to the same place, which could have
different reasons (unless there's a real problem here):

1) Are you by any chance generating both debug and release variants at the
same time? If you do that try invoking bjam using e.g. "bjam ... debug" and
see if you have the same problem. To enable installing both variants with a
single build invocation you need to either tag the exe targets, or specify
different locations for the install targets (e.g.
"<variant>debug:<location>$(STAGE-<whatever>)/debug").

2) STAGE-CLIENT and STAGE-SERVER point to the same directory. Don't do that.

(Please come up with an appropriate subject line for follow-ups)

HTH / Johan


_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build