Boost logo

Boost-Build :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2008-04-08 13:24:19


On Tuesday 08 April 2008 00:09:42 Mat Marcus wrote:
> I am having some difficulty figuring out how to get boost build to do
> my bidding. Perhaps someone here can help. I have to completely
> separate project directory trees which I'll call tree1 and tree2. Each
> of these trees has at least the following files at the top level. Here
> is an abstracted picture of my directory structure:
>
> tree1
> - project-root.jam
> - boost-build.jam
> - Jamfile.v2
> - deep hierarchy of subdirectories some of which contain there own
> Jamfile.v2's
>
> tree2 (optional, depends on tree1 relative location and artifacts)
> - project-root.jam
> - boost-build.jam
> - Jamfile.v2
> - deep hierarchy of subdirectories some of which contain there own
> Jamfile.v2's
>
> built_artifacts:
> - Build dir used by both tree1 and tree2 Jamfiles
>
> tree2, if present, expects to be located as a peer to tree1 in the
> directory structure. Furthermore, built artifacts (from either tree)
> are to be located in built_artifacts. tree2 depends on some of the
> artifacts in tree1. Users of tree1 can "build the world" by invoking
> bjam when the working directory is tree1. Jamfiles in tree2 contain
> relative references to projects in tree1.
>
> Now I can pose my question. I would like for users of tree2 to be
> able to build both tree1 and tree2 by simply invoking bjam when the
> working directory is set to tree2. In order to make this possible,
> tree2/Jamfile.v2 contains a statement along the lines of build_project
> ../tree1 . This seems to work fine in case tree1 is already built. But
> if a user sets the working directory to tree2 and invokes bjam when
> the built_artifacts directory doesn't yet exist, then strange things
> begin to happen. As far as I can tell, what happens is that first
> tree1 is built successfully, but as boost build reaches the point
> where it tries to create tree2 artifacts I receive errors such as:
>
> MkDir1 ..\built_artifacts
> A subdirectory or file ..\built_artifacts already exists.
>
> mkdir "..\built_artifacts"
>
> ...failed MkDir1 ..\built_artifacts...
>
> If I run bjam again from the same location, the build continues
> successfully for a while. After several invocations of bjam all
> targets are built successfully.
>
> In the past I've spent a bit of time debugging this (on mac, win,
> cygwin), and it seems the issue relates to a combination of the fact
> that mkdir returns an error code when it tries to create a directory
> that already exists, and the fact that boost build asks for the same
> dir to be created at two different points in the build process under
> the above configuration.
>
> For now I provide a thing wrapper script around bjam that will execute
> it multiple times. But the error output doesn't make a good impression
> on my library users so I'd really like to find a better solution. Can
> anyone here advise me?

This can only happen if Boost.Build tries to create the same directory
twice with different paths. Can you provide the output of "bjam -n"
for the case where error happens, so that I know what those two different
paths are?

- Volodya


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