anda.hcl format to define how packages are built in Terra. Each package directory contains an anda.hcl file that specifies build configuration, architecture support, and package metadata.
Basic structure
Theanda.hcl file uses HCL (HashiCorp Configuration Language) syntax with a project pkg block:
anda.hcl
- Build an RPM package
- Use the specified spec file as the build recipe
- Build for all supported architectures by default
Architecture support
Restrict which architectures a package builds for using thearches array:
anda.hcl
Supported architectures
x86_64
64-bit x86 processors (most common)
aarch64
64-bit ARM processors (Raspberry Pi, etc.)
i386
32-bit x86 processors (legacy)
Multi-architecture example
Fromanda/lib/DirectX-Headers/anda.hcl:
anda.hcl
RPM configuration
Therpm block configures RPM package building:
Spec file
Thespec field is required and points to the RPM spec file:
Extra repositories
Some packages need additional repositories during the build:anda.hcl
anda/multimedia/ffmpeg/anda.hcl adds the NVIDIA and multimedia repos to build FFmpeg with full codec support.
Labels
Labels provide metadata and control build behavior:Subrepo assignment
Thesubrepo label assigns packages to specific subrepos:
extras- Packages that may conflict with Fedoranvidia- NVIDIA driver packagesmesa- Patched Mesa packagesmultimedia- Multimedia codecs and tools
Packages without a
subrepo label go into the main Terra repository.Mock builds
Themock label indicates the package should be built in a clean chroot:
Large packages
Thelarge label marks packages that require significant build resources:
anda.hcl
anda/apps/coolercontrol/anda.hcl, this helps the build system allocate appropriate resources.
Update branch
Theupdbranch label enables automatic update tracking:
anda.hcl
anda/terra/release/anda.hcl ensures the terra-release package tracks upstream updates.
Real-world examples
Minimal package
Simple tool with no special requirements (anda/tools/topgrade/anda.hcl):
Architecture-restricted package
Application only for x86_64 (anda/devs/neovide/anda.hcl):
Subrepo package
Package that conflicts with Fedora (anda/apps/anki/anda.hcl):
Complex build
Multimedia package with dependencies (anda/multimedia/ffmpeg/anda.hcl):
Configuration reference
Root project block that defines the package
List of architectures to build for. Defaults to all supported architectures.Options:
x86_64, aarch64, i386RPM build configuration
Package metadata and build flags
Best practices
Keep it simple
Keep it simple
Start with the minimal manifest and only add configuration as needed. Most packages don’t need architecture restrictions or labels.
Match spec file names
Match spec file names
Name your spec file after the source package name for consistency. Use the
rust- prefix for Rust crates.Use subrepos appropriately
Use subrepos appropriately
Only assign packages to subrepos if they genuinely conflict with Fedora packages or require special handling.
Document extra repos
Document extra repos
If you need
extra_repos, add a comment explaining why those specific repos are required.Test architecture builds
Test architecture builds
If restricting architectures, verify that the package actually fails on other architectures or has arch-specific dependencies.
Repository structure
Learn about the monorepo organization
Subrepos
Understand the subrepo system