Boost logo

Boost :

Subject: Re: [boost] [BCP] Script for global renaming Boost Namespace
From: Bjørn Roald (bjorn_at_[hidden])
Date: 2009-05-30 17:56:28


On Saturday 30 May 2009 08:43:19 pm Artyom wrote:

> If there is an interest in it and, it would be accepted
> I'd be glad to continue supporting it on regular basis.

That is a very good thing :-)

> Probably it may be integreted with regeression test to ensure that
> Boost still works after renaming.

Yes, that is needed for this to be useful. Users need to assert the issues
before and after a namespace switch are identical for the same
platform/toolset.

I did some testing of running test after conversion and got most of it
automated and successful. It was actually some special handling in the build
scripts that caused most grief, as they had to be modified more or less with
special cases or by hand. This all need to be automated. The good thing is
that most of these special cases probably went away with the change to
Boost.Build 2.

> > If we do expect all
> > possible users to have Python
> > installed, it may be nice to use python for this. But
> > how do you propose to
> > integrate with bcp?
>
> 1. First of all this script is "one time use" and it is targeted
> for mostly project maintainers/managers that need to solve
> name collision problems. So, if it is not a big price to install
> Python to run such script, especially that it is availible by default
> for most supported platforms, like Solaris, FreeBSD, Linux, with an
> exception of Windows where in can be easily installed.

Yes, I think that is a fair demand on those in need of this tool.

> So I don't see a real problem in using Python for this purpose.

neither do I.

> In
> any case there are already some Perl scripts are used for code
> generation. (See Boost.Asio for example)
>
> 2. I don't see it as a part of BCP but rather the tool that can be used
> together, like:
>
> bcp --boost=/path/to/boost bind.hpp regex asio my_boost_dir
> boost_rename.py my_boost_dir mybst

Ah, in that case this is a stand-alone tool. Much easier to get accepted I
would think. ;-) And you do not need to get it accepted to make it useful
and maintainable as integration and use does not affect boost in any way.

> Because it can be actually applied on full Boost tree, if someone
> wants its full version.

yes.

In my view, the key issue to solve is automating the complete boost test suite
execution after conversion of namespace, and then compare relevant results to
the original on same platform/toolset. Differences in compilation and test
results is a problem with the tool. If bcp is used, only relevant tests can
be executed, and that may provide some trickiness. Maybe it is good enough to
validate the tool with the whole lot, and then assume it is correct for any
destination namespace and bcp subset of boost.

-- 
Bjørn

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk