BuildBench: Benchmarking LLM Agents on Compiling Real-World Open-Source Software

Zehua Zhang, Ati Priya Bajaj, Divij Handa, Siyu Liu, Arvind S Raj, Hongkai Chen, Hulin Wang, Yibo Liu, Zion Leonahenahe Basque, Souradip Nath, Vishal Juneja, Nikhil Chapre, Yan Shoshitaishvili, Adam Doupé, Chitta Baral, Ruoyu Wang

TL;DR

Compiling open-source software automatically is notoriously difficult due to missing dependencies, broken build scripts, and poor documentation. This paper introduces BUILD-BENCH, a realistic, human-verified benchmark reflecting the messy reality of real-world codebases, alongside OSS-BUILD-AGENT, a multi-agent system that leverages iterative LLM-guided retrieval and error correction to outperform traditional rule-based tools by roughly 50%.

What Problem Does This Paper Address?

Anyone who has tried to build a years-old GitHub repository knows the pain: the documentation is missing, dependencies are broken, or the code relies on outdated APIs. While commercial software follows strict engineering standards, open-source software (OSS) is highly heterogeneous.

Traditional automated compilation tools rely on rigid, rule-based workflows that break down when faced with custom environment setups. While recent attempts have used Large Language Models (LLMs) to solve this, they evaluated their systems on highly popular, pristine repositories. This creates a skewed perception of success. In reality, the vast majority of OSS lies in the "long tail" of lower-profile repositories where documentation is scattered or non-existent.

Figure 1: Demonstration of rule-based and AI agentic compilation methods. While rule-based methods follow a predefined workflow, they cannot adequately adapt to different environments. In comparison, AI agents leverage their pre-trained knowledge to adjust the compilation commands based on execution results. In this example, the agent realizes LIBEVENT is a key missing dependency for Bitcoin to compile and installs it to successfully compile the project.

Methods

The authors propose OSS-BUILD-AGENT, an end-to-end agentic architecture designed to mimic a human engineer's approach to troubleshooting build failures. It consists of two primary modules:

  1. LLM-Assisted Retrieval: Instead of diving straight into build scripts, an out-of-the-box LLM acts as an incremental retriever. It reads the README, extracts potential instructions, evaluates if the information is sufficient, and recursively follows internal or external links (up to three iterations) to synthesize a complete build recipe.
  2. Multi-Agent Compilation System: This module features two cooperating agents:
  3. Bash Command Generator: Takes the retrieved instructions and generates a candidate sequence of compilation commands.
  4. Execution Agent: Runs these commands inside a fresh, containerized Ubuntu Docker environment and feeds the execution logs back to the generator.

If a build fails, the system enters an iterative observation-repair-rebuild loop, allowing the agent to troubleshoot errors, install missing packages, or even patch source code files on the fly.

Figure 3: OSS-BUILD-AGENT system diagram. The initial input is the README, then an optional LLM extends this with additional compilation instructions. Finally, a multi-agent build system iteratively generates and executes compilation steps, attempting to compile the target repository.

Datasets

The authors introduce BUILD-BENCH, a benchmark specifically curated to represent the true diversity of GitHub's C/C++ repositories.

  • The Filtering Process: Starting from a pool of 6.57 million repositories, they filtered out low-quality projects (e.g., homework assignments) and applied a minimum threshold of 50 stars.
  • Human Verification: To ensure a rigorous ground truth, 12 graduate students spent roughly 150 hours manually building and verifying a statistically representative sample. This resulted in a final test set of 148 compilable repositories and a 70-repository validation set.

Unlike previous benchmarks like CompileAgentBench, which only feature high-profile projects averaging over 8,000 stars, BUILD-BENCH focuses on the 50–500 star range, capturing the realistic, messy challenges of everyday open-source software.

Figure 2: Distribution of stargazer counts of BUILD-BENCH and COMPILEAGENTBENCH. Note that in BUILD-BENCH, relatively low- profile repositories made up the majority of the samples.

Key Insights and Ideas

  • Documentation Over Code: Traditional rule-based systems fail because they prioritize parsing build scripts (like Makefiles), which are often too noisy. OSS-BUILD-AGENT succeeds by prioritizing human-centric documentation traversal first.
  • Coarse-Grained Command Generation: Rather than executing commands one line at a time, generating a complete sequence of compilation steps gives the LLM a holistic view of the command history, providing better context for error resolution.
  • The Code Specialization Trap: Surprisingly, specialized coding models (like Qwen3 Coder) underperformed compared to general-purpose models. The authors note that the retrieval phase relies heavily on general documentation comprehension rather than pure code generation.
  • AI as a Code Patcher: In a notable case study, the agent successfully compiled a 10-year-old repository by automatically patching its source code—updating deprecated OpenCV v3 API constants to their modern OpenCV v4 equivalents based purely on compiler error logs.

Key Results

The authors evaluated several rule-based and LLM-driven baselines on the BUILD-BENCH test set using two validation metrics: Strict Success (all expected binaries are generated) and Flexible Success (at least one main binary is generated).

Table 1: Performance of all evaluated build techniques on BUILD-BENCH test set. Section 5 describes the evaluation metrics of completion and validated successes.
  • Agentic Superiority: OSS-BUILD-AGENT paired with Claude 3.7-Sonnet achieved state-of-the-art performance, reaching a 66.4% strict success rate and 71.8% flexible success rate. This represents a massive 49.7 percentage point gain over the single-turn LLM baseline.
  • Benchmark Difficulty: CompileAgent, which boasts an 89% success rate on its own pristine benchmark, saw its performance plummet to just 49.7% strict success on BUILD-BENCH, validating the new benchmark's real-world difficulty.

Limitations and Future Work

While highly effective, the framework suffers from the inherent instability and non-determinism of LLM agents. Because the retrieval module can follow different documentation trajectories across different runs, results can fluctuate (GPT-4o showed a variance of ±6.8% in strict success across three independent runs). Additionally, the test set size is relatively small (148 repositories) due to the intensive manual labor required for human verification.

Future work will focus on stabilizing agent trajectories and incorporating recent advancements in multi-agent orchestration to further refine the retrieval process.

Summary updated

Abstract

Automatically compiling open-source software (OSS) projects is a vital, labor-intensive, and complex task, which makes it a good challenge for LLM Agents. Existing methods rely on manually curated rules and workflows, which cannot adapt to OSS that requires customized configuration or environment setup. Recent attempts using Large Language Models (LLMs) used selective evaluation on a subset of highly rated OSS, a practice that underestimates the realistic challenges of OSS compilation. In practice, compilation instructions are often absent, dependencies are undocumented, and successful builds may even require patching source files or modifying build scripts. We propose a more challenging and realistic benchmark, BUILD-BENCH, comprising OSS that are more diverse in quality, scale, and characteristics. Furthermore, we propose a strong baseline LLM-based agent, OSS-BUILD-AGENT, an effective system with enhanced build instruction retrieval module that achieves state-of-the-art performance on BUILD-BENCH and is adaptable to heterogeneous OSS characteristics. We also provide detailed analysis regarding different compilation method design choices and their influence to the whole task, offering insights to guide future advances. We believe performance on BUILD-BENCH can faithfully reflect an agent's ability to tackle compilation as a complex software engineering tasks, and, as such, our benchmark will spur innovation with a significant impact on downstream applications in the fields of software development and software security.
BibTeX
@inproceedings{zhang2025buildbench,
  author = {Zehua Zhang and Ati Priya Bajaj and Divij Handa and Siyu Liu and Arvind S Raj and Hongkai Chen and Hulin Wang and Yibo Liu and Zion Leonahenahe Basque and Souradip Nath and Vishal Juneja and Nikhil Chapre and Yan Shoshitaishvili and Adam Doupé and Chitta Baral and Ruoyu Wang},
  title = {{BuildBench: Benchmarking LLM Agents on Compiling Real-World Open-Source Software}},
  booktitle = {DL4C @ NeurIPS},
  year = {2025},
  url = {https://openreview.net/forum?id=ZqFdnJLXHP},
}
Figure