Overview
Therepo tool is the primary interface for managing recipe sources, building packages, and installing them into the filesystem. It replaces the older repo.sh script with a faster, more feature-rich Rust implementation.
The repo tool is built from
src/bin/repo.rs and is also available as make r.*, make f.*, etc. targets.Usage
Commands
fetch
Download recipe source code.Respects
COOKBOOK_OFFLINE=true to prevent network access if sources are already available.Behavior
- Downloads sources from Git, tarballs, or other configured locations
- Extracts archives to
recipes/*/source/directories - Skips downloads if sources already exist (unless
cleanis run first) - Can operate in offline mode if sources are pre-fetched
cook
Build recipe packages.Build Process
Build Process
- Fetches sources if not already present
- Runs the recipe’s build script
- Compiles sources in
recipes/*/source/ - Stages outputs to
recipes/*/target/$(TARGET)/stage/ - Creates package archives in
repo/$(TARGET)/ - Publishes packages to the repository
Features
- TUI Mode: Shows real-time build progress with colored output (default when not in CI)
- Parallel Building: Builds dependencies concurrently
- Build Logs: Saves logs to
build/logs/$(TARGET)/when enabled - Dependency Resolution: Automatically builds required dependencies
- Package Caching: Reuses previously built packages when possible
unfetch
Delete recipe source code.source/ directory for specified recipes.
clean
Delete recipe build artifacts.recipes/*/target/directory (all architectures)- Build cache and intermediate files
Does not remove source code. Use
unfetch for that.clean-target
Delete recipe artifacts for one target only.recipes/*/target/$(TARGET)/, preserving other architectures.
push
Extract packages into the sysroot (filesystem).Target directory for package installation
repo/$(TARGET)/ into the sysroot.
find
Find the path to recipe directories.cook-tree
Show the build dependency tree.push-tree
Show the package installation tree with sizes.Common Flags
—cookbook
Specify the recipes directory.Path to the recipes directory
—repo
Specify the package repository directory.Path to the package output directory
—sysroot
Specify the installation target directory.Target directory for
push command. Defaults to / on Redox, ./sysroot elsewhere.—with-package-deps
Include package (runtime) dependencies.—all
Apply command to all recipes.—category
Apply command to all recipes in a category.Category subdirectory name (e.g.,
core, games, drivers)—filesystem
Use an installer TOML config to determine which recipes to build.Path to filesystem configuration TOML file
—repo-binary
Override recipes to use binary packages.Environment Variables
These environment variables control the repo tool’s behavior:CI
Disable TUI when set.If set to any value, disables the interactive TUI and uses plain text output
COOKBOOK_LOGS
Control log file creation.Whether to write build logs to files. Defaults to true unless CI is set.
COOKBOOK_OFFLINE
Prevent network access.Prevent internet access if possible. Ignored when using the
fetch command.COOKBOOK_NONSTOP
Continue building after failures.Keep running even if a recipe build fails. Useful for CI builds.
COOKBOOK_COMPRESSED
Build compressed packages.Build packages in compressed (tar.gz) format instead of pkgar format
COOKBOOK_VERBOSE
Print build results.Print success/error messages for each recipe build
COOKBOOK_CLEAN_BUILD
Remove build directory before building.Remove the build directory before starting compilation
COOKBOOK_CLEAN_TARGET
Remove target directory after building.Remove the target/stage directory after building the package
COOKBOOK_WRITE_FILETREE
Write stage file tree.Write a text file listing all staged files
COOKBOOK_MAKE_JOBS
Override build parallelism.Number of parallel build jobs. Defaults to number of CPU cores.
COOKBOOK_WEB
Generate package metadata for web.Generate web-friendly package metadata files
COOKBOOK_HOST_SYSROOT
Set host sysroot for cross-compilation.Path to host system sysroot for cross-compiler recipes
COOKBOOK_CROSS_TARGET
Set cross-compilation target.Target triple for cross-compilation
COOKBOOK_APPSTREAM
Build AppStream metadata.Generate AppStream metadata for packages (set by REPO_APPSTREAM=1)
COOKBOOK_NOSTRIP
Disable binary stripping.Don’t strip debug symbols from binaries (set by REPO_DEBUG=1)
COOKBOOK_DEBUG
Enable debug builds.Build with debug symbols and less optimization (set by REPO_DEBUG=1)
TUI Mode
WhenCI is not set and the terminal supports it, repo cook displays an interactive TUI:
Features
- Live Log Viewing: Shows real-time build output for active recipes
- Progress Tracking: Displays fetch and cook queues
- Color Coding: Green for success, red for failures, yellow for active
- Automatic Scrolling: Follows log output automatically
- Keyboard Controls:
- Arrow keys: Scroll logs
- Page Up/Down: Fast scroll
- Home/End: Jump to top/bottom
- Tab: Switch between fetch/cook logs
Failure Handling
When a build fails in TUI mode:- The TUI exits and returns to the shell
- Full error context is printed to stderr
- Logs are saved to
build/logs/$(TARGET)/$(RECIPE).log - Exit code indicates failure
COOKBOOK_NONSTOP=true:
- Failed recipes are skipped
- Building continues with remaining recipes
- All failures are logged
Recipe Selection
The tool supports multiple ways to specify recipes:By Name
By Wildcard Pattern
Not directly supported. Use--category or --all instead.
By Category
recipes/core/.
By Filesystem Config
With Dependencies
Dependency Resolution
Build Dependencies
Automatically included when cooking recipes. These are specified inrecipe.toml files.
Package Dependencies
Included only when using--with-package-deps flag. These are runtime dependencies.
Dependency Types
Dependency Types in recipe.toml
Dependency Types in recipe.toml
- dependencies: Build-time dependencies (always included)
- build_dependencies: Build tools needed during compilation
- host_dependencies: Dependencies for cross-compiler recipes
- package_dependencies: Runtime dependencies (only with
--with-package-deps)
Build Modes
Source Mode
Builds packages from source code (default).Binary Mode
Uses pre-built binary packages from the repository.Binary mode is much faster but requires packages to be available in the binary repository.
Local Mode
Forces building from local source, ignoring binary packages.Ignore Mode
Skips building certain packages.Exit Codes
All operations completed successfully
One or more recipes failed to build, or invalid arguments provided
Examples
Build a single recipe
Build with dependencies
Clean and rebuild
Build entire desktop system
Build in offline mode
Build all recipes in a category
Show dependencies before building
Build with verbose logging
See Also
Make Commands
Makefile targets that wrap the repo tool
Configuration Options
Build system configuration variables