One step forward, Two steps forward


It was a great day today.  Not just because i went to Mini-golf
with my team and scored a 49 on a par 57 course, but because we finally
completed our migration of the C# IDE source tree to the MSBuild system
We’ve wanted to do this for quite a long time but we never had the time
to do a full migration and we also kept on running into a few issues
that kept causing problems.  So we worked with the MSBuild team to
resolve all of them, and as of today we now build just fine with their
fantastic system.



Plusses:

  1. Clean build time reduced from 6 minutes 20 seconds to 2 minutes 40 seconds.  That’s 40% of the original build time!
  2. The project file is incredibly clean.  We have a simple
    wildcard inclusion will pulls in all *.h’s and *.cpp’s in our
    directory.  This means we don’t have to strugle with keeping a
    project file and our on disk files in sync.  When we add a new
    cpp/h file anywhere in the directory (or subdirectory) MSBuild will
    pull it in
  3. We only have one build system that we use now.  We used to
    use the VS build system for command line builds (what eventually
    produces the final VS sku), and the VC++ build system for building
    within the IDE.   We did this so we could code in the IDE and
    get things like IntelliSense and whatnot.  This meant that we
    always had to keep two systems up to date.  Nothing like trying to
    submit a checkin through our build system and realizing a few hours
    later that you didn’t update the command line build system
    properly.  Now we just have one project.  The same project
    builds from the command line or inside the IDE *identically*
  4. Much faster incremental rebuilds.  Because MSBuild watches
    actual file accesses, it can do a much better job determing what to
    rebuild then our old build system.  Faster incremental builds
    means quicker time between making changes and being able to use
    them. 

Minuses:

  1. Nothing

Great job MSBuild team!  This is going to be a big boon for us!


Comments (7)

  1. Vish says:

    I have a hand in our company build system and just wanted to understand a little bit about point 3. Am I correct in saying you were previously using lines of "devenv /build <project>" for your old build system? And now with the switch to MSBuild you get faster compilations and improved incremental builds, how comes devenv isn’t of comparible speed (if my first assumption is correct). One more thing, I recall sometime ago there was talk about the C++ compiler being able to carry out parallel builds (or perhaps it was the MSBuild system that would be able to do this), will this functionality be able in the RTM of Whidbey?

  2. CyrusN says:

    "I have a hand in our company build system and just wanted to understand a little bit about point 3. Am I correct in saying you were previously using lines of "devenv /build <project>" for your old build system?"

    No. Sorry that i wasn’t clear. We actually had two build systems. One was the "build.exe" build process which was reponsible for building all of Visual Studio. The other was that we also had a .vcproj solution that we used to organize and compile our C++ sources ourselves. The .vcproj was great because it gave us intellisense and incremental linking and fast rebuilds, but it wasn’t consumed by the command line build. The command line build system worked, but it didn’t give us all of those benefits.

    Now we just have one system, and it’s the same whether or not it’s used from the command line or VS.

    "And now with the switch to MSBuild you get faster compilations and improved incremental builds, how comes devenv isn’t of comparible speed (if my first assumption is correct)."

    It is 🙂

    VS and the command line are now identical. "building" in VS just spawns MSBuild, so it does the exact same work at spawning msbuild from teh command line.

    "One more thing, I recall sometime ago there was talk about the C++ compiler being able to carry out parallel builds (or perhaps it was the MSBuild system that would be able to do this), will this functionality be able in the RTM of Whidbey?"

    I have heard similar things but i don’t know what the actual story is here.

    IIRC, MSBuild doesn’t support parallel builds in Whidbey, but has it on it’s plate for the future.

  3. Luc Cluitmans says:

    Quote: "We’ve wanted to do this for quite a long time but we never had the time to do a full migration and we also kept on running into a few issues that kept causing problems."

    So, can you tell us a bit more about what those ‘issues’ that you bumped into were? Will your solution in the end result in new features for us all in MsBuild?

  4. CyrusN says:

    Luc: "So, can you tell us a bit more about what those ‘issues’ that you bumped into were? Will your solution in the end result in new features for us all in MsBuild?"

    They were, in general, pretty minor things. For example, we would use it’s regexp capabilities to say: "include all .cpp files from all subdirectories", however, after you opened the project file in VS then the regexp would be expanded out to all files that matches and it would get replaces with that list. Thus the regexp would be lost and the project wouldn’t pick up any new files added to the directory.

  5. CyrusN says:

    Luc: Plus, MSBuild is getting used to build more and more of the VS source tree (With many teams already using it). The team wants to make sure that they can really handle the most complicated of tasks, and building all of VS is a great test of that.

    So they’re very responsive to helping out individual teams to be able to effectively use MSBuild for their own projects. If there and any problems, or needed functionality, then it’s very likely that it will soon be in an upcoming build 🙂

    Hopefully, after being able to support the tons of teams inside VS all of which build differently, they’ll be able to handle your system!

  6. Michael Kariv says:

    I am surprised to learn msbuild and devenv command line are identical. I keep using devenv with vs2005 b2 because of the bug in msbuild that doest work correctly with the post build event macros, as of b2.

    I however noticed that when compiling large solutions the visible progress indicator bar appears and says it is building the intellisense base. Does msbuild do it too? I’d be gravely disappointed.