Documentation Index
Fetch the complete documentation index at: https://mintlify.com/redox-os/redox/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The Redox OS recipe system, called Cookbook, is a package management and build system that handles compilation, installation, and dependency resolution for all userspace software. It’s similar to ports systems on BSD or package build systems like Gentoo’s Portage.What is a Recipe?
A recipe is a specification for building and installing a software package. Each recipe contains:Source
Where to fetch the source code (Git, tarball, etc.)
Dependencies
Build and runtime dependencies on other recipes
Build Instructions
How to configure, compile, and install the software
Patches
Modifications needed for Redox OS compatibility
Recipe Location
Recipes are stored in therecipes/ directory with this structure:
Recipe Structure
Each recipe is a directory containing:Recipe Definition (recipe.toml)
Therecipe.toml file defines how to build a package:
Basic Recipe Example
recipes/other/nano/recipe.toml
Recipe Sections
- [source]
- [build]
- [package]
Defines where to get the source code:
Build Templates
Cookbook provides templates for common build systems:Configure Template
For autotools-based projects:Cargo Template
For Rust projects:CMake Template
For CMake-based projects:Custom Template
For unique build systems:Build Variables
These variables are available in build scripts:Target triple (e.g.,
x86_64-unknown-redox)Root directory of the cookbook system
Installation destination directory
Path to current recipe directory
Source code directory
Build directory
Staging directory for installation
Number of parallel jobs for make
Host system triple
Recipe Commands
The build system provides shorthand commands for working with recipes:Basic Commands
r.PACKAGE - Build Recipe
r.PACKAGE - Build Recipe
Build (cook) a recipe and its dependencies:Build multiple recipes:
c.PACKAGE - Clean Recipe
c.PACKAGE - Clean Recipe
Clean build artifacts:Clean specific recipe including sysroot:
f.PACKAGE - Fetch Source
f.PACKAGE - Fetch Source
Download source code without building:
u.PACKAGE - Unfetch Source
u.PACKAGE - Unfetch Source
Remove downloaded sources:
Combined Commands
Query Commands
Working with Recipes
Building a Single Package
Modifying an Existing Recipe
Creating a New Recipe
Dependencies
Build Dependencies
Required to build the package:Runtime Dependencies
Required to run the package:Dependency Chains
Cookbook automatically resolves dependency chains:Patches
Patches modify source code for Redox compatibility:Applying Patches
Place.patch files in the recipe directory:
Creating Patches
Patch Format
Use unified diff format:fix-issue.patch
Repository Operations
Building All Packages
Cleaning Repository
Offline Builds
Build without internet access:Advanced Topics
Binary Packages
Use pre-built packages:.config
Debug Builds
Enable debug symbols:.config
Continuing on Errors
Don’t stop on recipe failures:.config
AppStream Metadata
Generate application metadata:.config
Cross-Compilation
Recipes support multiple architectures:Recipe Best Practices
Use Templates
Use Templates
Prefer built-in templates (
cargo, configure, etc.) over custom scripts when possible.Minimize Patches
Minimize Patches
Try to upstream changes rather than maintaining patches. Keep patches small and well-documented.
Specify Dependencies
Specify Dependencies
Explicitly list all dependencies, including transitive ones that might be needed.
Test Incrementally
Test Incrementally
Test recipes in isolation before adding to system configuration.
Document Changes
Document Changes
Add comments explaining non-obvious build steps or workarounds.
Version Pinning
Version Pinning
Use specific Git revisions or tags rather than branches for reproducibility.
Troubleshooting Recipes
Build fails
Build fails
Check logs:
Missing dependencies
Missing dependencies
Verify dependency tree:
Patch fails to apply
Patch fails to apply
Check source version:
Cross-compilation errors
Cross-compilation errors
Check toolchain:
Recipe Repository
Browse available recipes:- Core recipes:
recipes/core/ - Drivers:
recipes/drivers/ - GNU tools:
recipes/gnu/ - Applications:
recipes/other/ - Games:
recipes/games/
Next Steps
Configuration
Learn about configuration files
Build System Overview
Understand the complete build system