This document provides guidance for AI agents maintaining or extending the Archbuild codebase.
Archbuild is a modern Python rewrite of a legacy Bash-based Arch Linux package autobuilder. It prioritizes reliability, maintainability, and extensibility.
asyncio and aiohttp for AUR RPC queries and network-bound tasks.ProcessPoolExecutor for long-running makepkg builds to avoid GIL limitations.fcntl.flock() for file-based locking of the repository database and package builds.rich for structured, colorful terminal logging and optional file logging.cli.py: Command-line interface using click.config.py: Configuration models and migration tools.aur.py: AUR RPC API client with caching and retry logic.resolver.py: Dependency resolution and topological sorting.builder.py: Build orchestration and parallelization.repo.py: Repository database and package retention management.notifications.py: Extensible notification system (Email, Webhooks).Always use async context managers for AURClient and Builder to ensure sessions and executors are properly closed.
async with AURClient() as aur:
async with Builder(config, aur) as builder:
await builder.build_all()
Always wrap repository updates in the repository lock found in RepoManager.
Add new commands to cli.py using Click. If a command needs AUR access or building, use the AURClient and Builder inside an async function wrapped by run_async.
tests/test_*.py.tests/integration_test.py and require an Arch Linux environment.pytest for running unit tests.config.py are up to date with new features.resolver.py (Kahn's algorithm).DLAGENTS and VCSCLIENTS in integration_test.py in sync with system defaults.README.md when adding new CLI commands or configuration options.