No description
  • Rust 94%
  • Nix 3.4%
  • Dockerfile 1.4%
  • Shell 1.2%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Jeremy Soller ebe4cf48e3 Merge branch 'rust-analyzer' into 'master'
rust-toolchain: Add rust-analyzer

See merge request redox-os/redoxer!115
2026-08-18 14:03:23 -06:00
example Apply nix fmt 2026-08-18 18:58:56 +07:00
res Update res 2026-04-25 04:47:00 +07:00
src Merge branch 'smart-dev' into 'master' 2026-08-16 11:32:22 -06:00
.dockerignore Workaround uutils not working on aarch64 2025-12-16 12:23:30 +07:00
.envrc adding rust toolchain and flake 2023-12-18 01:21:56 +01:00
.gitignore nix: Add result to gitignore 2026-08-14 16:17:29 +07:00
.gitlab-ci.yml Really check if /dev accessible 2026-08-16 22:40:55 +07:00
Cargo.lock Really check if /dev accessible 2026-08-16 22:40:55 +07:00
Cargo.toml Really check if /dev accessible 2026-08-16 22:40:55 +07:00
Dockerfile Apply nix fmt 2026-08-18 18:58:56 +07:00
Dockerfile-aarch64 Apply nix fmt 2026-08-18 18:58:56 +07:00
Dockerfile-i586 Apply nix fmt 2026-08-18 18:58:56 +07:00
Dockerfile-riscv64gc Apply nix fmt 2026-08-18 18:58:56 +07:00
flake.lock nix: Rework flake 2026-08-12 23:14:07 +07:00
flake.nix nix: Fix rustPlatform typo 2026-08-14 16:15:50 +07:00
LICENSE Add LICENSE file 2024-03-16 20:24:18 +01:00
README.md toolchain: Use prefix directory instead of tarball 2026-06-03 08:36:23 +07:00
rust-toolchain.toml rust-toolchain: Add rust-analyzer 2026-08-18 18:58:56 +07:00
rustfmt.toml Add help and bump edition 2026-04-26 09:24:34 +07:00
treefmt.nix nix: Rework flake 2026-08-12 23:14:07 +07:00

redoxer

The tool used to build/run Rust programs (and C/C++ programs with zero dependencies) inside of a Redox VM, the Redox GitLab CI use a Docker image with redoxer pre-installed.

A pre-built Docker image can be found on Docker Hub. Visit the book for Continous Integration for more information.

Options

redoxer env <command> [arguments]...
    Run as command with env configured to run with the toolchain
    The toolchain will be initialized by `redoxer toolchain`
    Environment flags:
        REDOXER_SYSROOT      Specify sysroot to link (default is target/$TARGET/sysroot on Cargo projects)

redoxer <bench | build | check | doc | fetch | install | run | rustc | test> [-g|--gui] [-o|--output file] [--] [arguments]
    Run as cargo passed by `redoxer env cargo`
    Additionally set `redoxer exec` as test runner

redoxer <ar | cc | cxx> [arguments]
    Run as GNU compiler passed by `redoxer env $GNU_TARGET-*`

redoxer exec [-f|--folder folder] [-f|--folder folder:/path/in/redox] [-g|--gui] [-h|--help] [-i|--install-config] [-o|--output file] [--] <command> [arguments]...
    Run a command inside QEMU, using a "base" or "gui" redox image, or provide custom one with --install-config
    The redox image will be initialized if not exist or different with the specified --install-config
    Specify a folder to copy it into /root inside redox image, or more generic one with folder:path
    If folder for /root is not specified but <command> is a file, the file will be copied
    Environment flags:
        REDOXER_QEMU_BINARY   Override qemu binary
        REDOXER_QEMU_ARGS     Override qemu args
        REDOXER_USE_FUSE      [true|false] Override use fuse (default is automatically detected)
    Notes:
    - Setting REDOXER_QEMU_BINARY will print qemu commands to terminal
    - Setting "-o -" will hide qemu serial output, only printing stdout/stderr from the command

redoxer pkg [install|remove|update] pkg-1 pkg-2 ...
    Install additional native packages for Cargo
    Environment flags:
        REDOXER_SYSROOT     Where to install sysroot (default is target/$TARGET/sysroot on Cargo projects)
        REDOXER_PKG_SOURCE  Override source of packages (default is https://static.redox-os.org/pkg)

redoxer toolchain [--update] [--url PATH]
    Install or manage toolchain
    Environment flags:
        REDOXER_TOOLCHAIN   Override toolchain path

Commands

  • Install the tool
cargo install redoxer --locked
  • Install the Redox toolchain
redoxer toolchain
  • Update the Redox toolchain using prebuilt toolchain from existing Redox OS Repo
make prefix
redoxer toolchain --update --url .
  • Build the Rust program or library with Redoxer
redoxer build
  • Build the Rust program or library with additional native packages
redoxer pkg install xz
redoxer build
  • Run the Rust program on Redox
redoxer run
  • Test the Rust program or library with Redoxer
redoxer test
  • Run arbitrary executable (echo hello) with Redoxer
redoxer exec echo hello

Host specific customizations

redoxer env can be configured to compile host binaries by setting TARGET to the correct host target:

  • *-unknown-redox
  • *-unknown-linux-gnu
  • *-unknown-linux-musl
  • *-unknown-freebsd
  • *-apple-darwin

This feature is mainly used for Redox build system. For other than Linux and Redox, you must supply additional environments to the correct paths or binary name for GCC and Binutils. You can also use it to specify other compiler or different version of GCC. Here's an example for using the system default, which also being the default values:

export REDOXER_HOST_AR=gcc-ar
export REDOXER_HOST_AS=as
export REDOXER_HOST_CC=cc
export REDOXER_HOST_CXX=c++
export REDOXER_HOST_LD=ld
export REDOXER_HOST_NM=gcc-nm
export REDOXER_HOST_OBJCOPY=objcopy
export REDOXER_HOST_OBJDUMP=objdump
export REDOXER_HOST_PKG_CONFIG=pkg-config
export REDOXER_HOST_RANLIB=gcc-ranlib
export REDOXER_HOST_READELF=readelf
export REDOXER_HOST_STRIP=strip