Boost logo

Boost-Build :

Subject: Re: [Boost-build] BUMPITTY BUMP: [git] genrating forward headers
From: Bjørn Roald (bjorn_at_[hidden])
Date: 2013-08-22 01:08:18


On 08/22/2013 05:39 AM, Steven Watanabe wrote:
> AMDG
>
> On 08/21/2013 07:12 PM, Dave Abrahams wrote:
>>
>> Perhaps, but these posts assume a great deal of background that I don't
>> have. I need details filled in, please.
>> For instance, in that post Steven says:
>>
>>> I've applied the Boost.Build changes.
>>
>> Applied them where? What do these changes do?
>>
>
> In Boost.Build. (mostly tools/build/v2/tools/link.jam).

svn trunk log says:

SVN r84524 | steven_watanabe | 2013-05-27 02:02:43 +0200
Initial supprort for creating symlinks in the git layout.

SVN r85183 | steven_watanabe | 2013-08-01 17:49:37 +0200
Apply Bjorn Roald's patch for generating header links in git.

> These changes specify /how/ to create the header links.
> The remaining changes are to create the link targets
> and modify the rest of Boost to get the dependencies right.
>
>>> I don't want to apply the changes to Boost proper in svn, since it'll
>>> break without the git layout.
>>>
>>> Here are the changes that need to happen in git:
>>
>> What does he mean by "need to happen in git?" We are not making any
>> git-specific commits.

the point here is it can not be simply done in SVN as it will
break things in SVN layout. This is what we try to solve now by using
some condition detecting which layout we are in, so all changes can be
be in build files in both layouts.

>>> - Use the original boost-root patch (i.e. no <dependency>)
>>
>> Sorry, which patch is that?
>>
>
> It's somewhere in the archives. I think Jürgen
> and Bjørn both posted it earlier in this thread.

right, as of Stevens latest commit this is now working and remaining
needed parts of those patches are all in Jamroot. The git's of it is:

-------------
local all-headers =
     [ MATCH .*libs/(.*)/include/boost : [ glob libs/*/include/boost ] ] ;

for dir in $(all-headers)
{
     link-directory $(dir)-headers : libs/$(dir)/include/boost :
<location>. ;
}

local numeric-headers =
     [ MATCH .*libs/numeric/(.*)/include/boost : [ glob
libs/*/*/include/boost ] ] ;

for dir in $(numeric-headers)
{
     link-directory numeric-$(dir)-headers :
libs/numeric/$(dir)/include/boost : <location>. ;
}

alias headers : $(all-headers)-headers
numeric-$(numeric-headers)-headers : : : <include>. ;
---------------

at least the alias headers target need to be controlled with a condition
to avoid breaking build in SVN layout -- I think.

>>> - Change all uses of boost//headers to
>>> <implicit-dependency>/boost//headers. <use> <source> and <library> do not
>>> work correctly for handling generated headers.
>>> This is the cause of the build problems with
>>> the original patch.
>>
>> Is this a simple search-and-replace, or does it require some specialized
>> knowledge?
>>
>
> A search and replace won't quite work. e.g.
>
> lib A : a.cpp boost//headers ;
> becomes
> lib A : a.cpp : <implicit-dependency>/boost//headers ;
>
> lib B : b.cpp : <library>/boost//headers ;
> becomes
> lib B : b.cpp : <implicit-dependency>/boost//headers ;
>
> <implicit-dependency> needs to be in the target requirements.
>

right I did this and there where a few, but very few special cases.

>>> - Add <implicit-dependency>/boost//headers to all library and test
>>> targets.
>>
>> I /think/ I understand what that means.
>>
>
> It can be added at the project level:
>
> project : requirements <implicit-dependency>/boost//headers ;
>

I tested this with a single new jamfile in the libs folder, it works fine.

>>> - Change the header install glob to search the correct include
>>> directories
>>
>> I have no idea what that means. Please explain.
>>
>
> The install target has to copy all the boost headers.
> Currently it looks something like:
> headers = [ path.glob-recursive boost : *.hpp *.ipp : .svn ]
> It will need to be changed to search the library specific
> include directories instead, under the git layout only.
>
>>> The fact that we need to disable everything that is specific for the
>>> modularized layout when building in the monolithic layout complicates
>>> the process of proceeding.
>>
>> Huh; from what I'm reading here it seems like maybe it could be done
>> with a few project-wide bjam variables. Something like:
>>
>> if $(BOOST_SVNLAYOUT)
>> {
>> BOOST_HEADER_DEPENDENCY = boost//headers ;
>> }
>> else
>> {
>> BOOST_HEADER_DEPENDENCY = <implicit-dependency>boost//headers ;
>> }
>>
>> then replace uses of "boost//headers" with "$(BOOST_HEADER_DEPENDENCY)".
>> Is the problem more complicated than I'm guessing?
>>
>
> This doesn't need to be conditionalized.
> <implicit-dependency> will work correctly in svn.
>
>>> I imagine that some test may be used as a config step that allow new
>>> or changed rules to be conditioned or targets to be disabled.
>>
>> Sorry, I don't know what that means.
>>
>
> I think he means exactly what you just described
> (if $(BOOST_SVNLAYOUT)).
>
> BOOST_SVNLAYOUT = [ path.glob . :
> path/to/file/that/only/exists/in/git ] ;

I think so too :-)

--
Bjørn

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