77

Due to a number of circumstances leading to a poor deployment last build cycle, I campaigned in our office to perform all future deployments with a dedicated build machine, and my boss accepted this proposal.

However, instead of getting an actual machine in our office to use, we're having to share a single machine with several other groups - and the hassle of having to leave my office with all the necessary information and then walk down a flight of stairs to another office just to perform a simple build is making me wonder why I ever proposed this in the first place.

The idea of having a separate build machine was, originally, to separate my own locally-written code from the code of several other developers, and to separate any hijacked files I had on my machine from deployment. It was also to resolve a growing concern I've had with our ClearCase file management system, which often refuses to let me deploy certain build activities unless I've also included another activity for which it 'has dependencies'.

Now that I'm actually going forward with this process, I'm wondering if I misunderstood the entire purpose of using a build machine - and since we're only using this machine for code deployment to our Test, Staging and Production environments, and not for our personal Developer testing deployments, I'm not sure it serves any purpose at all.

So, what is the actual reason for using a build machine, and have I even come close to using it correctly?

Zibbobz
  • 1,552
  • 3
  • 13
  • 20
  • 167
    "the hassle of having to leave my office with all the necessary information and then walk down a flight of stairs to another office just to perform a simple build [...]" What do you mean exactly? You physically access that machine to create a build? – Vincent Savard Mar 03 '17 at 14:07
  • 7
  • 3
    @Vincent_Savard Admittedly I could remote access the machine, but I'm still a bit confused as to the purpose of using a separate machine at all. – Zibbobz Mar 03 '17 at 14:18
  • 14
    The real WTF is Clearcase, which is worse than all the modern open source alternatives. What language(s) is this project and how large/complex is the build? – pjc50 Mar 04 '17 at 00:38
  • 7
    Are you using tools? Git/SVN and Jenkins/Team City/Octopus/TFS, etc? Or are you just logging into another computer, loading Visual Studio or what have you... copying project, loading, compiling... Are you using professional tools or doing it manually? – WernerCD Mar 04 '17 at 00:58
  • 84
    My build machine is somewhere in South Carolina and I am in Seattle. I assure you I do not walk down any set of stairs to use it. I think the last time I had physical access to a build machine was when I was the intern in charge of build machines for Microsoft compilers in 1994, when they fit into a small closet; they are now an entire data center somewhere. Get the machine on your network; better yet, get it in the cloud and make someone else take care of it. – Eric Lippert Mar 04 '17 at 08:07
  • 1
    And don't let developers have access to it - only the dedicated Jenkins guy – Mawg says reinstate Monica Mar 06 '17 at 09:35
  • 2
    @VincentSavard The necessary information resides on a stack of 5-1/4 inch floppies that must be fed into the build machine one at a time. – shoover Mar 06 '17 at 17:18
  • 1
    At my workplace we have a dedicated build machine. This builds every proposed change before it can be accepted. It also builds the complete project from scratch every night. This is all automated through Jenkins and Gitlab. It's shared with two other groups, but so far this hasn't been an issue. One of the main purposes of this machine is as an official source of truth - if it doesn't build on the build machine then someone broke the build, but if it does, then the problem must be on your machine. – user253751 Mar 07 '17 at 07:34
  • Plus, anything that's automated like that has to have a server - it's hard to imagine a distributed system for automatic scheduled builds that wouldn't duplicate a bunch of work. – user253751 Mar 07 '17 at 07:36

7 Answers7

136

Normally you wouldn't just have a dedicated build machine, but also run a build server on that dedicated machine. A dedicated build machine merely offers the advantage of never blocking the work of a developer and deploying from a centralized machine.

A build server offers much more. A build sever allows for CI (continuous integration), meaning that it will automatically build on every push to your VCS (like git), might even execute unit tests if you have them and allows for "one click deployment". Build servers can notify you per mail if builds or tests fail. They offer historic data and trends on what happened.

Build servers can generally be accessed by multiple users or teams at once, by using a web gui that runs in a browser.

In the Java world one of the most used build servers is Jenkins. Jenkins works perfectly fine with C++ builds as well (Since you seem to use those two languages). Jenkins calls itself automation server, since it can run all kinds of tasks that don't have to be related to programming and building.

ASA
  • 1,279
  • 3
    I actually haven't touched c++ since college, but I can understand the usefulness. Though in this case, I think what we're actually doing might be far removed from the intended purpose. – Zibbobz Mar 03 '17 at 14:22
  • 22
    For some languages (C++ in particular) having a dedicated box with more processing power can be useful, too, given it's a relatively slow compilation. – enderland Mar 03 '17 at 15:16
  • 32
    Continuous Integration means more than just having a build server -- it also means everyone integrates each others changes as frequently as possible, to avoid "big bang" merge problems. Otherwise, spot-on. – Rob Crawford Mar 03 '17 at 18:00
  • While I like the power that an example gives to the point being made here, I still think the last paragraph is totally unnecessary in this answer. – Pierre Arlaud Mar 04 '17 at 15:09
  • 3
    "A dedicated build machine merely offers the advantage of never blocking the work of a developer and deploying from a centralized machine." Is not totally true. The asker pointed out that it is very easy to have an unclean environment on a developers machine. Included libraries and other environment variables can all change the build result. A dedicated machine should have a well documented environment to allow for easy build recreation. – TafT Mar 06 '17 at 16:45
107

In addition to Traubenfuchs' answer, you have hinted at another reason for a build machine in your question.

Just because the software builds on your machine, it doesn't mean that it will build on anyone else's. You may be relying on some random files that just happen to be on your machine (and may not even be under version control). You may be relying on some forgotten application or library that is called up from an obscure build script.

If you have a dedicated build machine, you should know what is installed on it. This should be well documented. If there is ever a need to rebuild the software, perhaps years later, it should only be necessary to create a new build machine with the documented stuff installed on it.

Simon B
  • 9,621
  • 46
    This. The main purpose of building on another machine is to have reproducible builds; notably by eliminating non-committed stuff, disparate environment variables, etc... from the equation. – Matthieu M. Mar 03 '17 at 16:01
  • 9
    Extend on that: use a new, clean container image from which you start each build. Then have a bootstrap script setup the system. That truly guarantees reproducible builds. – Matthias Kuhn Mar 03 '17 at 20:12
  • 9
    @MatthiasKuhn: truly (byte for byte) reproducible builds require much more, cf: https://reproducible-builds.org/ https://wiki.debian.org/ReproducibleBuilds – ninjalj Mar 05 '17 at 12:04
  • 1
    Also, just because the Linux version of the product builds and passes tests on your Linux desktop does not mean that the Windows version or the Mac version will build. – Solomon Slow Mar 06 '17 at 21:59
  • Truly referred to guarantee and not reproducible /nitpick off. but concerning the topic, the main message is: scripts are more reliable than docs. that counts for build envs as well as for truly reproducible builds ;) – Matthias Kuhn Mar 06 '17 at 23:14