Boost logo

Boost-Build :

Subject: Re: [Boost-build] Very slow Visual Studio 2012 builds
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2013-09-29 20:03:47


On 09/27/2013 07:30 AM, Nogradi, Chris wrote:
> We have been investigating switching from using Visual Studio
> 2005 to Visual Studio 2012 for our development using
> The issue we are seeing is that a build that normally takes 2
> minutes with VS 2005, now takes twice as long with VS 2012. I
> did some investigation and discovered that the issue is with bb2's
> per compiler/linker action usage of vcvarsall.bat. In VS 2005,
> this batch file only sets up variables and paths. In VS 2012,
> the same thing is done but there are windows registry queries
> that apparently are very time consuming and result in adding 2
> additional minutes to the overall build. I plan to attempt to
> address this problem but wanted some advice from experts to ensure
> that I approach it the right way. Here are the solutions I have
> thought of so far:
> * THIS IS A HACK: Wrap the bjam command in a batch
> file which calls vcvarsall.bat 1st and then calls bjam.
> Also initialize the msvc toolset using <setup>echo to
> cause it to not call the vcvarsall.bat during every
> compiler/linker invocation or auto detect that the environment
> variables are already setup and so there is no need to invoke
> the batch script for every compiler/linker action. This will
> not work if bjam is invoked with multiple msvc versions so I
> would rather not do this.
> * During the msvc initialization, somehow capture
> the work performed by vcvarsall.bat, cache it to another
> batch file and execute this one for every compiler/linker
> action. Echo is off when executing this batch file and I
> can't find any way to override this so that the commands
> can be replayed later.
> * Figure out which env variables are really
> needed and provided by vcvarsall.bat and make msvc.jam
> set them up for every compiler/linker invocation
> instead of running the batch file.

Like this?
local original-vars = [ SHELL "set" ] ;
local new-vars = [ SHELL "$(setup) && set" ] ;
# Parse and diff the variable lists

In Christ,
Steven Watanabe

Boost-Build list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at