Boost logo

Boost :

Subject: Re: [boost] [BCP] Script for global renaming Boost Namespace
From: Artyom (artyomtnk_at_[hidden])
Date: 2009-05-30 14:43:19


Hello,

> I
> think there is interest for such a feature, especially if
> you are willing to
> maintain it on regular basis.

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

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

> 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.

   So I don't see a real problem in using Python for this purpose. 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
   
   Because it can be actually applied on full Boost tree, if someone
   wants its full version.

Artyom

> --
> Bjørn Roald
>
>
> On Saturday 30 May 2009 10:55:25 am Artyom wrote:
> > Hello,
> >
> > Some updates:
> > -------------
> >
> > 1. Added copyright - Boost License.
> > 2. Some more regression tests passed, some code
> cleanup
> >
> > Questions:
> > ----------
> >
> > 1. How can I submit it as an addon to BCP utility?
> > 2. Have anybody tested it, I'd like to see if there
> any problems,
> >    especially on Windows platform -- I
> hadn't tested it there.
> >
> >
> > Thanks
> >   Artyom
> >
> > P.S.: The source is there http://art-blog.no-ip.info/files/rename.py
> >
> > --- On Mon, 5/25/09, Artyom <artyomtnk_at_[hidden]>
> wrote:
> > > From: Artyom <artyomtnk_at_[hidden]>
> > > Subject: [BCP] Script for global renaming Boost
> Namespace
> > > To: boost_at_[hidden]
> > > Date: Monday, May 25, 2009, 11:14 AM
> > > Hello,
> > >
> > > Today Boost does not provide any backward binary
> > > compatibility. This
> > > makes big problems in shipping 3rd part libraries
> that
> > > depend on Boost
> > > because library user must use the same version of
> Boost as
> > > that 3rd
> > > part library was compiled with.
> > >
> > > The problem is become even more critical for ELF
> platforms
> > > (UNIXes)
> > > where all symbols are exported by default.
> > >
> > > I had written a small Python script that switches
> boost
> > > namespace
> > > to other, allowing 3rd part project include it
> without
> > > collisions
> > > with primary Boost namespace.
> > >
> > > The script passes over the source tree of boost
> and changes
> > > each
> > > include path from <boost/foo/bar.hpp> too
> > > <newnamespace/foo/bar.hpp>
> > > and renames all macros and identifiers from
> > > some_BOOST_something to
> > > some_NEWNAMESPACE_something and
> some_boost_something to
> > > some_newnamespace_something.
> > >
> > > It does not touch comments (copyright) and
> strings unless
> > > the string
> > > is in form "boost/.*" which is usually some
> reference for
> > > include.
> > >
> > > I've run this script on the 1.39 version of boost
> and
> > > successfully build full boost release and run
> some of
> > > regression tests
> > > like Boost.Asio, Boost.Regex, Boost.Function and
> others,
> > >
> > > The source code is available at:
> > > http://art-blog.no-ip.info/files/rename.py
> > >
> > > You run it as:
> > >
> > >    ./rename /path/to/boost/source
> > > new_namespace_name
> > >
> > > It renames all macros and namespaces to new
> namespace, and
> > > renames
> > > main include directory to new_namespace_na,e.
> > >
> > > Few points:
> > >
> > > 1. It is only alpha version script, I just want
> to see
> > > feedback and
> > >    proposals
> > > 2. I do not update build scripts. I assume that
> each
> > > library that
> > >    tryes to import its own version of
> Boost
> > > would provide its own
> > >    build system.
> > > 3. The build scripts should be updated
> differently because
> > > they have
> > >    different syntax and grammar. The
> > > required changes are to
> > >    fix different build defines
> > >
> > > Please, give feedback proposal. If there someone
> who is
> > > familiar
> > > with Boost.Build systems can actually help, this
> would be
> > > very good.
> > >
> > > Today there is a big problem with working with
> different
> > > versions of
> > > Boost. It should be solved.
> > >
> > > I think this script may be a valuable addition
> to
> > > Boost.BCP  utility
> > > that allows extracting a subset of boost for
> integration in
> > > 3rd part
> > > tools and libraries.
> > >
> > > Thanks,
> > >   Artyom
> > >
> > >
> > >     
> >
> > _______________________________________________
> > Unsubscribe & other changes:
> > http://lists.boost.org/mailman/listinfo.cgi/boost
>
> _______________________________________________
> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
>


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