# Build
The process of converting source code files into a standalone, executable software artifact, often involving compilation, linking, and packaging.
**Pronunciation:** /bɪld/
**Difficulty:** Beginner
**Synonyms:** compilation, make, construction
**Categories:** Software Development Lifecycle, DevOps, Programming
**Tags:** compilation, linking, packaging, automation, CI/CD, build tool
Canonical: https://scaleengineer.com/glossaries/build
---
## Definitions

- **Software Build Process:** In software engineering, a **build** is the process of converting human-readable source code files into a standalone artifact that can be run on a computer. This multi-step process is fundamental to software development and is typically automated.

### Key Concepts

*   **Compilation**: The first step is often **compilation**, where a compiler translates source code (e.g., Java, C++, Go) into a lower-level form like machine code or bytecode.
*   **Linking**: The compiler's output, often in the form of object files, is then combined with other necessary code, such as libraries, in a process called **linking**. This resolves dependencies between different code modules and creates a single executable file or library.
*   **Packaging**: The resulting executable, along with any necessary resources (e.g., images, configuration files, dependencies), is bundled into a distributable package. This could be a `.jar` file for a Java application, an `.exe` for a Windows program, a Docker image, or a simple compressed archive.
*   **Automation**: Modern build processes are almost always automated using build tools like `Make`, `Maven`, `Gradle`, `Webpack`, or `MSBuild`. This ensures the process is repeatable, fast, and less prone to human error.

### Example Usage

A developer working on a Java web application might use the build tool Maven. By running the command `mvn clean install`, they trigger a predefined build lifecycle that:
1.  Deletes previous build artifacts (`clean`).
2.  Compiles the `.java` source files into `.class` files.
3.  Runs automated unit tests.
4.  Packages the compiled code and resources into a Web Application Archive (`.war`) file (`install`).

This `.war` file is the **build artifact**, ready to be deployed to a web server.

## Etymology

The term 'build' in computing is a direct metaphor derived from its original meaning in Old English, 'byldan', which means 'to construct a house'. Just as a house is constructed from various materials like bricks and wood according to a blueprint, a software program is 'built' from its constituent parts (source code files, libraries, resources) according to a set of rules.

## First used

1970s

## Historical context

The concept of a build has existed since the first compilers, but the process and terminology have evolved significantly.

*   **Early Computing (1950s-1960s)**: The process was entirely manual. A programmer would individually compile source files and then manually link the resulting object files to create an executable. This was tedious and highly error-prone.
*   **The `make` Revolution (1976)**: The introduction of the `make` utility by Stuart Feldman at Bell Labs was a landmark event. `make` automated the build process by reading a `Makefile` that defined dependencies between files and the commands needed to generate them. It intelligently re-compiled only the parts of the program that had changed, saving immense amounts of time. This formalized the concept of an automated build.
*   **Rise of Integrated Build Systems (1990s-2000s)**: As software projects grew more complex, especially in the Java ecosystem, more advanced tools emerged. Apache Ant (2000) used XML files to define build steps, offering more flexibility than `make`. Apache Maven (2004) built upon this by introducing the concept of convention over configuration, standardized project structures, and automatic dependency management, which fundamentally changed how developers managed external libraries.
*   **Modern Era & CI/CD (2010s-Present)**: Today, the build is a core component of Continuous Integration and Continuous Delivery (CI/CD) pipelines. Tools like Gradle, Webpack (for web development), and integrated platform build services (e.g., GitHub Actions, GitLab CI) have made the build process a seamless, fully automated background task that often includes static analysis, testing, and packaging into containers like Docker.

## Q&A

- **What are the three primary stages of a typical software build process?:** The three primary stages are Compilation (converting source code to machine code), Linking (combining object files and libraries), and Packaging (bundling everything into a distributable format).
- **Why is automating the build process important in modern software development?:** Automation ensures consistency, reduces human error, saves developer time, and enables practices like Continuous Integration (CI) by providing a reliable and repeatable way to create the software artifact.
- **What is the output of a successful build process called?:** An artifact (or build artifact), such as an executable file, a library, a JAR file, or a Docker image.

## Usage examples

- The nightly **build** failed because of a syntax error in the new module.
- Let's kick off a new **build** to include the latest security patches before deploying to production.
- The developer had to wait ten minutes for the full project **construction** to complete on their local machine.
- Our CI server automates the entire **compilation** and packaging process for every commit.

## Related terms

- CI/CD
- Compiler
- Linker
- Build Automation
- Dependency Management
- Artifact
- Makefile

## Popular related terms

- CI/CD
- Compiler
- Build Automation
