views:

131

answers:

3

Hi,

I have run into some bugs into one of the boost components that I am using. After analyzing the problem a bit, I've found that I was not the only one, and the author had already issued a fix that is available in the boost SVN trunk.

What would be the best approach if I wanted to update just this component and reuse the libraries that are already built? The component is not header only.

  • Compiler: MSVC 9 with SP1, TR1
  • OS: Vista
  • Boost: 1.39 from BoostPro computing
  • buggy component: Boost Wave
  • bug: race conditions. The bug was fixed in may this year, but they haven't included it in any release as far as I can tell.

What I did so far:

  • svn checkout of the wave subdir
  • replaced local subdir
  • now I'm looking for a way to specify that I want to build just wave

I'm a bit weary of rebuilding the entire boost lib. I don't know if trunk is production-ready right now.

+1  A: 

Best approach: build a patch by diffing the changes in the repository (e.g. by checking out a part of the repository and using svn diff), then applying the patch to the files in your Boost installation using patch (Unix tool).

This might require a Unix-like console on Windows (e.g. Cygwin). Alternatively, you can perhaps harness a Windows SVN client such as TortoiseSVN but I'm not sure that this allows patching files outside of version control.

Are you talking about a header library? If not, you also need to rebuild that part of your Boost library and unfortunately I don't think this is quite compatible with the Boost installer from BoostPro.

Konrad Rudolph
Non header-lib. I already did the diff, but it's the (re)build I'm curious about.
rpg
+1  A: 

Well, you can check the logs and see the exact revision that the issue was fixed, diff only yhat revision and manually apply the patch.

It is not recommended that you only updated one component, as boost heavily reuses itself, so if the interface changes you'd start getting all kinds of weird behaviors. Perhaps if you specify the component and the bug we could help you further.

Edu Felipe
+2  A: 

Here's what I ended up doing:

  1. First I checked out the version of the wave lib where the issue was fixed (53230). After diffing it to my local copy, I have found the following changes:

    - wave was reusing a boost.iterator implementation instead of providing its own

    - the flex_string implementation was updated

    - a ref counter was made atomic. This should be the bugfix

  2. Then I simply replaced my boost/wave dir with the one from SVN. I ran bootstrap.bat (if using BoostPro you will have to get this from the boost sources zip) and then I ran bjam:

    bjam --build-directory=build toolset=msvc variant=debug|release link=static threading=multi runtime-link=shared --with-wave

    Adding --with-wave will only build wave and its dependencies.

  3. At this point I got compile errors: it seems that Spirit was also updated. I downloaded Spirit (53252) from SVN and reissued the bjam command.

    The library build cleanly and I copied the two libs to my boost lib folder.

After doing those steps, I rebuild my project and the crashing errors were gone.

rpg