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.
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:
- 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. - Multi-Agent Compilation System: This module features two cooperating agents:
- Bash Command Generator: Takes the retrieved instructions and generates a candidate sequence of compilation commands.
- 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.
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.
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).
- 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