Building using devenv.exe

1,538 views
Skip to first unread message

Jeremy Apthorp

unread,
Feb 27, 2012, 10:43:13 PM2/27/12
to Chromium-dev
Hi,

I'm experimenting with building from the command line on Windows with devenv.exe. It seems really slow to start up:

$ time devenv.com /build Debug chrome.sln /project chrome.vcproj
   <-- about 50s is spent here, before anything shows up
Microsoft (R) Visual Studio Version 9.0.30729.1.
Copyright (C) Microsoft Corp. All rights reserved.
1>------ Build started: Project: chrome_version_resources, Configuration: Debug Win32 ------
1>Generating version information in "..\build\Debug/obj/global_intermediate/chrome_version/other_version.rc"
1>Generating version information in "..\build\Debug/obj/global_intermediate/chrome_version/chrome_exe_version.rc"
1>Generating version information in "..\build\Debug/obj/global_intermediate/chrome_version/chrome_dll_version.rc"
1>Generating version information in "..\build\Debug/obj/global_intermediate/chrome_version/nacl64_exe_version.rc"
1>Build log was saved at "file://e:\src\chromium\src\build\Debug\obj\chrome_version_resources\BuildLog.htm"
1>chrome_version_resources - 0 error(s), 0 warning(s)
========== Build: 1 succeeded, 0 failed, 326 up-to-date, 0 skipped ==========
devenv.com /build Debug chrome.sln /project chrome.vcproj  0.00s user 0.01s system 0% cpu 1:37.40 total

Any tips for making it faster?

Cheers,
Jeremy

Aaron Leventhal

unread,
Feb 27, 2012, 10:46:55 PM2/27/12
to jer...@google.com, Chromium-dev
How long does it take to get the build started when you do it from inside of Visual Studio? The startup is slow for me either way.

--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev

Nico Weber

unread,
Feb 27, 2012, 10:49:51 PM2/27/12
to aaro...@gmail.com, jer...@google.com, Chromium-dev
With MSVC2010,

set GYP_MSVS_VERSION=2010
gclient runhooks
msbuild chrome\chrome.vcxproj /p:Configuration=Release

had fairly fast startup if I remember correctly.

Nico

Greg Thompson

unread,
Feb 27, 2012, 11:08:17 PM2/27/12
to aaro...@gmail.com, jer...@google.com, Chromium-dev
On Mon, Feb 27, 2012 at 10:46 PM, Aaron Leventhal <aaro...@gmail.com> wrote:
How long does it take to get the build started when you do it from inside of Visual Studio? The startup is slow for me either way.

+1 to that.  The problem is that it takes a heck of a long time to load all those projects.  If you run VS, you only pay that cost when you first load the solution.  Building the chrome project should then start right away.

Alex Pakhunov

unread,
Feb 28, 2012, 1:33:43 AM2/28/12
to tha...@chromium.org, aaro...@gmail.com, jer...@google.com, Chromium-dev
msbuild chrome\chrome.vcxproj /p:Configuration=Release
 
You can specify a solution file and /m for parallel build:

msbuild chrome\chrome.sln /p:Configuration=Release /m

I'm using some.gyp to generate some.sln that includes only the targets that I need to build. Works pretty well.

Alex.

Scott Byer

unread,
Feb 28, 2012, 12:54:39 PM2/28/12
to alex...@google.com, tha...@chromium.org, aaro...@gmail.com, jer...@google.com, Chromium-dev
The key here is getting to VisualStudio 2010. In VisualStudio 2010, MSBuild is used, and in a way that keeps a couple of instances open and cached. Repeated command line builds w/ VS2010 will be faster than from the IDE.

I've had better luck with 'devenv.com chrome/chrome.sln -build Debug -project chrome', since there are a couple of  MSBuild flags I can't find the documentation on that VS seems to use to aid in that cache-keeping. First build of the day usually suffers from that do-nothing period, though (I can see the drive is busy).

Use devenv.com (instead of .exe) to get the unbuffered output as the build happens. Better when outputting to an Emacs compile buffer.

Finnur Thorarinsson

unread,
Feb 28, 2012, 4:14:09 PM2/28/12
to scot...@chromium.org, alex...@google.com, tha...@chromium.org, aaro...@gmail.com, jer...@google.com, Chromium-dev
On Tue, Feb 28, 2012 at 17:54, Scott Byer <scot...@chromium.org> wrote:
The key here is getting to VisualStudio 2010. In VisualStudio 2010, MSBuild is used, and in a way that keeps a couple of instances open and cached. Repeated command line builds w/ VS2010 will be faster than from the IDE.

As I recall, MSBuild could be used pre-VS2010. Is the caching you describe VS2010 dependent or would using MSBuild in general give some benefits?

Scott Graham

unread,
Feb 28, 2012, 4:15:06 PM2/28/12
to fin...@chromium.org, scot...@chromium.org, alex...@google.com, tha...@chromium.org, aaro...@gmail.com, jer...@google.com, Chromium-dev
MSBuild's not used for C++ pre-2010, only C#.

Scott Byer

unread,
Feb 28, 2012, 4:26:00 PM2/28/12
to Finnur Thorarinsson, alex...@google.com, tha...@chromium.org, aaro...@gmail.com, jer...@google.com, Chromium-dev
On Tue, Feb 28, 2012 at 1:14 PM, Finnur Thorarinsson <fin...@chromium.org> wrote:

On Tue, Feb 28, 2012 at 17:54, Scott Byer <scot...@chromium.org> wrote:
The key here is getting to VisualStudio 2010. In VisualStudio 2010, MSBuild is used, and in a way that keeps a couple of instances open and cached. Repeated command line builds w/ VS2010 will be faster than from the IDE.

As I recall, MSBuild could be used pre-VS2010. Is the caching you describe VS2010 dependent or would using MSBuild in general give some benefits?
 

You should be able to use MSBuild directly and get the caching if you can figure out the right command line switches for that. I didn't put much effort into finding out. 

Jeremy Apthorp

unread,
Mar 26, 2012, 8:50:17 PM3/26/12
to Alex Pakhunov, tha...@chromium.org, aaro...@gmail.com, Chromium-dev
On Tue, Feb 28, 2012 at 5:33 PM, Alex Pakhunov <alex...@google.com> wrote:
msbuild chrome\chrome.vcxproj /p:Configuration=Release
 
You can specify a solution file and /m for parallel build:

msbuild chrome\chrome.sln /p:Configuration=Release /m

I'm using some.gyp to generate some.sln that includes only the targets that I need to build. Works pretty well.

I just tried this and got some errors about the host architecture not being ia32. Am I using the wrong msbuild perhaps? I added c:\windows\microsoft.net\framework64\v4.0.30319 to my path. (perhaps I should use the non-64 version?)

Alex Pakhunov

unread,
Mar 27, 2012, 1:33:56 AM3/27/12
to Jeremy Apthorp, tha...@chromium.org, aaro...@gmail.com, Chromium-dev
My first guess would be that x64 compiler configuration is broken. You will need to install this update if VS2010 SP1 was installed after Windows SDK.

Am I using the wrong msbuild perhaps? I added c:\windows\microsoft.net\framework64\v4.0.30319 to my path.

It is easy to check this though. Just remove it from the path in one of cmd.exe windows and try building it.

PS. Thoroughly following http://dev.chromium.org/developers/how-tos/build-instructions-windows solved all building issues I've encountered so far.

Alex.
Reply all
Reply to author
Forward
0 new messages