views:

1083

answers:

18

I haven't worked for very large organizations and I've never worked for a company that had a "Build Server".

What is their purpose? Why aren't the developers building the project on their local machines, or are they? Are some projects so large that more powerful machines are needed to build it in a reasonable amount of time?

The only place I see a Build Server being useful is for continuous integration with the build server constantly building what is committed to the repository. Is it I have just not worked on projects large enough?

Someone, please enlighten me: What is the purpose of a build server?

+1  A: 

We use one so that we know that the production/test boxes have the same libraries and versions of those libraries installed as what is available on the build server.

RC
+4  A: 

The build server is used to build everyone's code when it is checked in. Your code may compile locally, but you most likely won't have all the change made by everyone else all the time.

Kevin
+2  A: 

For consistent quality and to get the build 'off your machine' to spot environment errors and so that any files you forget to check in to source control also show up as build errors.

I also use it to create installers as these take a lot of time to do on the desktop with code signing etc.

Ryan ONeill
+31  A: 

The reason given is actually a huge benefit. Builds that go to QA should only ever come from a system that builds only from the repository. This way build packages are reproducible and traceable. Developers manually building code for anything except their own testing is dangerous. Too much risk of stuff not getting checked in, being out of date with other people's changes, etc. etc.

Joel Spolsky on this matter.

Matt Kane
Things get especially hairy when developers are building against bleeding-edge libraries, not realizing it and then getting "NoClassDefFound" errors all over the place during testing and everyone else wondering what the hell went wrong. (This was problematic in my Java-based job until I set up Hudson and we moved QA builds to that)
MattC
+1  A: 

It's about management and testing for us. With a build server we always know that we can build our main "trunk" line from version control. We can create a master install with one-click and publish it to the web. We can run all of our unit tests each time code is checked in to make sure it works. By collecting all these tasks into a single machine it makes it easier to get it right repeatedly.

Paul Alexander
A: 

A build server gets you a sort of second opinion of your code. When you check it in, the code is checked. If it works, the code has a minimum quality.

Burkhard
+2  A: 

It's necessary to have a "clean" environment free of artifacts of previous versions (and configuration changes) in order to ensure that builds and tests work and don't depend on the artifacts. An effective way to isolate is to create a separate build server.

paulwhit
+2  A: 

A build server is a distinct concept to a Continuous Integration server. The CI server exists to build your projects when changes are made. By contrast a Build server exists to build the project (typically a release, against a tagged revision) on a clean environment. It ensures that no developer hacks, tweaks, unapproved config/artifact versions or uncommitted code makes it into the released code.

Rich Seller
A: 

These machines are used for several reasons, all trying to help you provide a superior product.

One use is to simulate a typical end user configuration. The product might work on your computer, with all your development tools and libraries set up, but the end user most likely won't have the same configuration as you. For that matter, other developers won't have the exact same setup as you either. If you have a hardcoded path somewhere in your code, it will probably work on your machine, but when Dev El O'per tries to build the same code, it won't work.

Also they can be used to monitor who broke the product last, with what update, and where the product regressed at. Whenever new code is checked in, the build server builds it, and if it fails, its clear that something is wrong and the user who committed last is at fault.

samoz
+1  A: 

I agree with the answers so far in regards to stability, tracability, and reproducability. (Lots of 'ity's, right?). Having ONLY ever worked for large companies (Health Care, Finance) with MANY build servers, I would add that it's also about security. Ever seen the movie Office Space? If a disgruntled developer builds a banking application on his local machine and no one else looks at it or tests it... BOOM. Superman III.

Greg
A: 

Additionally, remember that low level languages take much longer to compile than high level languages. It's easy to think "Well look, my .Net project compiles in a couple of seconds! What's the big deal?" Awhile back I had to mess with some C code and I had forgotten how much longer it takes to compile.

Spencer Ruport
A: 

You are right that developers could build on their own machines.

But these are some of the things our build server buys us, and we're hardly sophisticated build makers:

  • Version control issues (some have been mentioned in earlier responses)
  • Efficiency. Devs don't have to stop to make builds locally. They can kick it off on the server and get on to the next task. If builds are large, then that is even more time the dev's machine is not occupied. For those doing continuous integration and automated testing, even better.
  • Centralization. Our build machine has scripts that make the build, distribute it to UAT environments, and even to production staging. Keeping them in one place reduces the hassle of keeping them in sync.
  • Security. We don't do much special here, but I'm sure a sysadmin can make it such that production migration tools can only be accessed on a build server by certain authorized entities.
Bernard Dy
+1  A: 

Maybe i'm the only one...

I think everyone agrees that one should

  • use a file repository
  • do builds from the repository (and in a clean environment)
  • use a continous testing server (e.g. cruise control) to see if anything is broken after your "fixes"

But no one cares about automatically built versions. When something was broken in an automatic build, but it's not anymore - who cares? It's a work in progress. Someone fixed it.

When you want to do a release version, you run a build from the repository. And i'm pretty sure you want to tag the version in the repository at that time and not every six hours when the server does it's work.

So, maybe a "build server" is just a misnomer and it's actually a "continous test server". Otherwise it sounds pretty much useless.

Stroboskop
+9  A: 

What is their purpose?
Take load of developer machines, provide a stable, reproducible environment for builds.

Why aren't the developers building the project on their local machines, or are they?
Because with complex software, amazingly many things can go wrong when just "compiling through". problems I have actually encountered:

  • various versions of incomplete Dependency Checks, resulting in binaries not updated
  • Publish commands not working, the error message in the log ignored, old DLLs delivered
  • Build including local sources not yet commited to source control (fortunately, no "damn customers" message boxes yet..)
  • when trying to avoid above problem by building from another folder, some files picked from the wrong folder
  • Target folder where binaries are aggregated contains additional stale developer files not to be released

We've got an amazing stability increase since all public releases start with a get from source control onto an empty folder. Before, there were lots of "funny problems" that "went away when Joe gave me a new DLL".

Are some projects so large that more powerful machines are needed to build it in a reasonable amount of time?

What's "reasonable"? If I run a batch build on my local machine, there are many things I can't do. Rather than pay developers for builds to complete, pay IT to buy a real build machine already.

Is it I have just not worked on projects large enough?

Size is certainly one factor, but not the only one.

peterchen
+15  A: 

Build servers are important for several reasons.

  • They isolate the environment The local Code Monkey developer says "It compiles on my machine" when it won't compile on yours. This can mean out-of-sync check-ins or it could mean a dependent library is missing. Jar hell isn't near as bad as .dll hell; either way, using a build server is cheap insurance that your builds won't mysteriously fail or package the wrong libraries by mistake.

  • They focus the tasks associated with builds. This includes updating the build tag, creating any distribution packaging, running automated tests, creating and distributing build reports. Automation is the key.

  • They coordinate (distributed) development. The standard case is where multiple developers are working on the same code base. The version control system is the heart of this sort of distributed development but depending on the tool, the developers may not interact with each other's code much. Instead of forcing developers to risk bad builds or worry about merging code overly aggressively, design the build process where the automated build can see the appropriate code and processes the build artifacts in a predictable way. That way when a developer commits something with a problem, like not checking in a new file dependency, they can be notified quickly. Doing this in a staged area let's you flag the code that has built so that developers don't pull code that would break their local build. PVCS did this quite well using the idea of promotion groups. Clearcase could do it too using labels but would require more process administration than a lot of shops care to provide.

Kelly French
+1 Getting programmers to document changes to their build environment is like herding cats. They simply can't remember at what stage they updated their .Net or Boost lib, if they realize they did it at all. Having a central server doing a daily build catches them in the act the evening after they check in the code- and there's nothing quite as motivating as being told, "you broke the team build, what did you forget?"
kmarsh
A: 

I've found that TeamCity was the best Continuous Integration system for my old organisation. We don't have big enough development-effort projects to justify such a complex set up any more, but http://www.duncangunn.me.uk/dasblog/2008/12/17/ContinousIntegrationBuildProcessOverview.aspx details my findings on the subject.

Duncan
A: 

A build server is used to schedule compile tasks (e.g. nightly builds) of usually large projects located in a repository that can sometimes take more than a couple of hours.

cmdev
A: 

A build server also gives you a basis for escrow, being able to capture all the parts necessary to reproduce a build in the case that others may have rights to take ownership.

Greg Domjan