Skip to main content

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.
Native builds require careful management of dependencies and may behave differently across systems. Podman builds are recommended for most users.

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

1

Download the Script

2

Make it Executable

3

Run the Bootstrap

For QEMU (recommended):
For non-interactive installation:

What the Bootstrap Does

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
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
Sets up the Rust development environment:
  • Detects existing Rust installations
  • Offers to install rustup if needed
  • Configures stable toolchain as default
  • Installs cargo tools: just and cbindgen
  • Adds cargo bin directory to PATH
Prepares the build environment:
  • Clones Redox repository from GitLab
  • Creates .config with PODMAN_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

2. Install Rust

3. Install Cargo Tools

4. Clone Repository

5. Configure for Native Build

Create a .config file:
.config
Optional optimizations:
.config

Building Redox OS

Standard Build

The build process will:
1

Check Tools

Verify all required build tools are available
2

Build Filesystem Tools

Compile redoxfs, redoxfs-mkfs, and redox_installer
3

Build or Download Prefix

Either build the cross-compilation toolchain or download pre-built binaries
4

Build Recipes

Compile all packages specified in your configuration
5

Create Image

Generate the bootable disk image

Build Time Expectations

Use REPO_BINARY=1 for your first build to save significant time.

Build Configuration

Environment Variables

Create or modify .config to customize the build:
.config

Configuration Profiles

Available configuration profiles in config/:

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

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
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+)
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
Symptoms: Build killed, system freezesSolutions:
  • Reduce parallel jobs: make all -j2
  • Use swap space
  • Build with fewer packages (minimal config)
  • Close other applications
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
This will:
  • Keep debug symbols in binaries
  • Disable stripping
  • Enable debug assertions in Rust code

Performance Tips

1

Use Binary Packages

Reduces build time from hours to minutes
2

Use Binary Toolchain

Saves 30-60 minutes on first build
3

Use Minimal Config

Builds only essential packages
4

Parallel Jobs

Use all CPU cores

Next Steps

Configuration

Learn about configuration options

Recipes

Understand the recipe system