Skip to main content

Overview

The repo 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 clean is run first)
  • Can operate in offline mode if sources are pre-fetched

cook

Build recipe packages.
  1. Fetches sources if not already present
  2. Runs the recipe’s build script
  3. Compiles sources in recipes/*/source/
  4. Stages outputs to recipes/*/target/$(TARGET)/stage/
  5. Creates package archives in repo/$(TARGET)/
  6. 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.
Removes the source/ directory for specified recipes.

clean

Delete recipe build artifacts.
Removes:
  • 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.
Removes only recipes/*/target/$(TARGET)/, preserving other architectures.

push

Extract packages into the sysroot (filesystem).
path
default:"./sysroot"
Target directory for package installation
Extracts package archives from repo/$(TARGET)/ into the sysroot.
Do not push packages while QEMU is running with the disk image mounted, as this may cause corruption.

find

Find the path to recipe directories.
Outputs:

cook-tree

Show the build dependency tree.
Outputs:

push-tree

Show the package installation tree with sizes.
Outputs:

Common Flags

—cookbook

Specify the recipes directory.
path
default:"$PWD/recipes"
Path to the recipes directory

—repo

Specify the package repository directory.
path
default:"$PWD/repo"
Path to the package output directory

—sysroot

Specify the installation target directory.
path
default:"$PWD/sysroot or /"
Target directory for push command. Defaults to / on Redox, ./sysroot elsewhere.

—with-package-deps

Include package (runtime) dependencies.
Builds the recipe plus all packages it needs at runtime (not just build dependencies).

—all

Apply command to all recipes.
Use with caution, especially with clean and unfetch. Cannot be combined with explicit recipe names.

—category

Apply command to all recipes in a category.
string
Category subdirectory name (e.g., core, games, drivers)

—filesystem

Use an installer TOML config to determine which recipes to build.
path
Path to filesystem configuration TOML file
Builds all packages specified in the configuration, respecting build rules (source/binary/ignore).

—repo-binary

Override recipes to use binary packages.
Forces all recipes to use pre-built binary packages from the repository instead of building from source.

Environment Variables

These environment variables control the repo tool’s behavior:

CI

Disable TUI when set.
any
default:"unset"
If set to any value, disables the interactive TUI and uses plain text output

COOKBOOK_LOGS

Control log file creation.
true|false
default:"!CI"
Whether to write build logs to files. Defaults to true unless CI is set.

COOKBOOK_OFFLINE

Prevent network access.
true|false
default:"false"
Prevent internet access if possible. Ignored when using the fetch command.

COOKBOOK_NONSTOP

Continue building after failures.
true|false
default:"false"
Keep running even if a recipe build fails. Useful for CI builds.

COOKBOOK_COMPRESSED

Build compressed packages.
true|false
default:"false"
Build packages in compressed (tar.gz) format instead of pkgar format

COOKBOOK_VERBOSE

Print build results.
true|false
default:"true"
Print success/error messages for each recipe build

COOKBOOK_CLEAN_BUILD

Remove build directory before building.
true|false
default:"false"
Remove the build directory before starting compilation

COOKBOOK_CLEAN_TARGET

Remove target directory after building.
true|false
default:"false"
Remove the target/stage directory after building the package

COOKBOOK_WRITE_FILETREE

Write stage file tree.
true|false
default:"false"
Write a text file listing all staged files

COOKBOOK_MAKE_JOBS

Override build parallelism.
number
default:"nproc"
Number of parallel build jobs. Defaults to number of CPU cores.

COOKBOOK_WEB

Generate package metadata for web.
true|false
default:"false"
Generate web-friendly package metadata files

COOKBOOK_HOST_SYSROOT

Set host sysroot for cross-compilation.
path
Path to host system sysroot for cross-compiler recipes

COOKBOOK_CROSS_TARGET

Set cross-compilation target.
string
Target triple for cross-compilation

COOKBOOK_APPSTREAM

Build AppStream metadata.
true|false
default:"false"
Generate AppStream metadata for packages (set by REPO_APPSTREAM=1)

COOKBOOK_NOSTRIP

Disable binary stripping.
true|false
default:"false"
Don’t strip debug symbols from binaries (set by REPO_DEBUG=1)

COOKBOOK_DEBUG

Enable debug builds.
true|false
default:"false"
Build with debug symbols and less optimization (set by REPO_DEBUG=1)

TUI Mode

When CI 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:
  1. The TUI exits and returns to the shell
  2. Full error context is printed to stderr
  3. Logs are saved to build/logs/$(TARGET)/$(RECIPE).log
  4. Exit code indicates failure
With 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

Builds all recipes in recipes/core/.

By Filesystem Config

Builds all recipes listed in the TOML configuration.

With Dependencies

Builds the recipe plus all its runtime dependencies.

Dependency Resolution

Build Dependencies

Automatically included when cooking recipes. These are specified in recipe.toml files.

Package Dependencies

Included only when using --with-package-deps flag. These are runtime dependencies.

Dependency Types

  • 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.
Specified in filesystem configuration files.

Ignore Mode

Skips building certain packages.

Exit Codes

Success
All operations completed successfully
Error
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