Boost logo

Boost-Build :

From: Ali Azarbayejani (ali_at_[hidden])
Date: 2003-05-28 10:30:02


Vladimir Prus wrote:
>
> Just to clarify: did you have to use "foo/bar" because file "bar" in directory
> "foo" was not found? Your posts did not contain an example of *this* problem.
> I believe there's no other need to use main target names with slashes?
>
> > question: how do you refer to target "foo/bar" in project "my/lib"?
>
> There's no way, but also, IMO, no need to name target "foo/bar".

here is the use case:

i have a module type where a tar file gets expanded and then individual
files get patched. the method for storing the patches and indicating
which files require patches is to store the patches in a parallel tree
with the same name as the file that needs patching.

EXAMPLE:

Source files:

foo.tar.gz
patches/foo/b
patches/foo/d

First step, extraction:

foo.tar.gz
foo/a
foo/b
foo/c
foo/d
foo/...
patches/foo/b
patches/foo/d

Second step, patching:

foo.tar.gz
foo/a
foo/b
foo/b.orig
foo/c
foo/d
foo/d.orig
foo/...
patches/foo/b
patches/foo/d

The rule (called automatically based upon the files in subdirectory
"patches") looks like this

patch foo/b.orig : foo/b patches/foo/b ;
patch foo/d.orig : foo/d patches/foo/d ;

It's natural to name the targets "foo/b.orig", "foo/b" and
"patches/foo/b". You can't really name them all "b", can you?

Do you have a better solution for naming the targets? (Note that the
sources are themselves main targets either because other rules depend on
them using a <dependency> property, or because the current system design
does not allow them to be found as files, because the type-filename
mapping is too limited or for a variety of other reasons. This is also
the use case, btw, for why <dependency> ought to allow filenames in
addition to main targets.)

> > is there anyplace where there is a concise syntactical description of
> > these id's? i see a number of examples in new/boost_build_v2.html, but
> > i can't find a definitive specification.
>
> http://boost.sourceforge.net/boost-build2/boost_build_v2.html#targets
>
> even contains something like a grammar.

Sorry, I had completely missed this and I was browsing that file.

It does contain something like a grammar, but I'm pretty sure it is not
fully consistent either with the intent or with the implementation.

Target identifier is used to denote a target. It is described by the
following grammar:

target-id -> project-reference local-target-name
project-reference -> [jamfile-location] [ "@" [project-id] ]
jamfile-location -> pathname
project-id -> pathname
local-target-name -> identifier

For example, according to this, there is no slash between the
project-reference and local-target-name, and it allows simply "@" as a
project-reference (is this really allowed? what does it mean?). I'm
not sure why project-reference requires a path AND a project-id, but I
guess this is the one you are proposing to eliminate?

Also, how to you refer to a project alone? Is "@/boost/thread
" a project withh identifier "/boost/thread" or is it target "thread" in
project "/boost"?

So, again, I agree that this needs tightening up. We should start by
being complete and clear about the requirements of things to be
referenced.

I maintain that it is confusing and not visually clear what is a project
and what is a target when they are separated by slashes and at least the
project can itself contain slashes. Even if it is logical, it is not
visually clear. And I'm waiting on your judgement of the above examples
if targets deserve to have slashes. If so, then it cannot even be
logical.

--Ali

 


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