Overview
The native build method compiles Redox OS directly on your host system without using containers. This approach is useful for development work where you need direct access to build artifacts and faster iteration cycles.When to Use Native Builds
Development
Faster iteration when working on specific components
Debugging
Direct access to build artifacts and intermediate files
IDE Integration
Better integration with development tools and IDEs
Low Memory
Lower memory overhead without container isolation
Prerequisites
System Requirements
- Operating System: Linux (recommended), macOS, FreeBSD, or Redox OS itself
- Memory: At least 8GB RAM (16GB recommended)
- Disk Space: 20-30GB free space
- Time: First build can take 1-4 hours depending on hardware
macOS Users: Native builds on macOS are not recommended. The toolchain relies on FUSE which requires kernel extensions. Use
podman_bootstrap.sh instead.Bootstrap Installation
The easiest way to set up a native build environment is using the bootstrap script.Using the Bootstrap Script
What the Bootstrap Does
Operating System Detection
Operating System Detection
The script automatically detects your OS and package manager:
- Debian/Ubuntu: apt-get
- Fedora/RHEL: dnf
- Arch Linux: pacman
- openSUSE: zypper
- Gentoo: emerge
- Solus: eopkg
- FreeBSD: pkg
- macOS: Homebrew or MacPorts
Build Dependencies
Build Dependencies
Installs comprehensive build tools including:
- Compilers: gcc, g++, clang, nasm
- Build systems: make, cmake, meson, ninja, scons
- Libraries: fuse3, gmp, mpfr, expat, jpeg, png
- Tools: autoconf, automake, bison, flex, patch, patchelf
- Version control: git, git-lfs
- Debugging: gdb or gdb-multiarch
- Package tools: pkg-config, protobuf-compiler
- Python: python3, python3-mako
- Perl modules: HTML::Parser
Rust Toolchain
Rust Toolchain
Sets up the Rust development environment:
- Detects existing Rust installations
- Offers to install rustup if needed
- Configures stable toolchain as default
- Installs cargo tools:
justandcbindgen - Adds cargo bin directory to PATH
Repository Setup
Repository Setup
Prepares the build environment:
- Clones Redox repository from GitLab
- Creates
.configwithPODMAN_BUILD=0 - Sets up directory structure
- Checks Travis CI build status
Manual Setup
For manual setup or if the bootstrap script doesn’t work:1. Install Build Dependencies
- Debian/Ubuntu
- Fedora
- Arch Linux
- macOS (Homebrew)
2. Install Rust
3. Install Cargo Tools
4. Clone Repository
5. Configure for Native Build
Create a.config file:
.config
.config
Building Redox OS
Standard Build
Build or Download Prefix
Either build the cross-compilation toolchain or download pre-built binaries
Build Time Expectations
| Configuration | First Build | Incremental |
|---|---|---|
| Minimal (from source) | 1-2 hours | 5-15 minutes |
| Desktop (from source) | 2-4 hours | 10-30 minutes |
| Minimal (binary) | 10-20 minutes | 2-5 minutes |
| Desktop (binary) | 20-40 minutes | 5-10 minutes |
Build Configuration
Environment Variables
Create or modify.config to customize the build:
.config
Configuration Profiles
Available configuration profiles inconfig/:
desktop
Full desktop environment with GUI and applications
server
Server configuration with networking utilities
minimal
Bare minimum system (fastest to build)
dev
Development tools and compilers
Build Targets
Image Targets
Package Management
Repository Management
Filesystem Operations
Running Redox
QEMU
VirtualBox
Troubleshooting
Missing dependencies
Missing dependencies
Symptoms: Build fails with “command not found” or “package not found”Solutions:
- Run the bootstrap script again
- Check the dependency list for your OS above
- Ensure PATH includes cargo binaries:
source $HOME/.cargo/env
Toolchain build fails
Toolchain build fails
Symptoms: Errors during prefix buildSolutions:
- Use pre-built toolchain:
echo 'PREFIX_BINARY=1' >> .config - Check available disk space (need 10+ GB)
- Check GCC version:
gcc --version(needs 7.0+)
FUSE errors
FUSE errors
Symptoms: Cannot mount filesystemSolutions:
- Install FUSE:
sudo apt-get install fuse3 libfuse3-dev - Check FUSE module:
lsmod | grep fuse - Add user to fuse group:
sudo usermod -a -G fuse $USER - Log out and back in for group change to take effect
- On FreeBSD:
sudo kldload fuse.ko
Out of memory
Out of memory
Symptoms: Build killed, system freezesSolutions:
- Reduce parallel jobs:
make all -j2 - Use swap space
- Build with fewer packages (minimal config)
- Close other applications
Recipe fails to build
Recipe fails to build
Symptoms: Specific package build errorsSolutions:
- Clean and rebuild:
make cr.package_name - Check recipe logs in
build/$(ARCH)/$(CONFIG_NAME)/ - Enable verbose output:
make r.package_name COOKBOOK_VERBOSE=1 - Skip problematic package by removing from config
Advanced Usage
Cross-Compilation
Native builds support cross-compilation for different architectures:Custom Toolchain
To use a custom toolchain location:.config
Incremental Development
For fast iteration during development:Debug Builds
Enable debug symbols:.config
- Keep debug symbols in binaries
- Disable stripping
- Enable debug assertions in Rust code
Performance Tips
Next Steps
Configuration
Learn about configuration options
Recipes
Understand the recipe system