Skip to main content
Build backends decouple package building from Pixi, providing language-specific build implementations through a standardized protocol.

What Are Build Backends?

Build backends are executables that:
  • Follow a specific protocol for communication with Pixi
  • Handle language-specific build logic
  • Convert projects into conda packages
  • Are decoupled from Pixi’s manifest specification
This design allows backends to evolve independently from Pixi itself.

Available Backends

pixi-build-cmake

For CMake-based C/C++ projects. Automatically provides CMake, Ninja, and compilers.

pixi-build-python

For Python packages using PEP 517 build backends like Hatchling or setuptools.

pixi-build-rattler-build

For direct recipe.yaml builds with full control over the build process.

pixi-build-ros

For ROS (Robot Operating System) packages using colcon.

pixi-build-rust

For Cargo-based Rust applications and libraries.

pixi-build-mojo

For Mojo applications and packages.
All backends are available through conda-forge and work across Linux, macOS, and Windows.

Quick Comparison

Installing a Backend

Specify the backend in your manifest:
pixi.toml
Pixi automatically installs the backend from conda channels.

Using Custom Backend Channels

For the latest features, use the dedicated backend channel:
pixi.toml
The pixi-build-backends channel contains pre-release versions with the latest features.

Common Backend Configurations

Backend-Specific Configuration

Each backend supports custom configuration through [package.build.config]:

CMake Backend

Python Backend

Rust Backend

See individual backend documentation for complete options.

Overriding Build Backends

For development, you can override backends:

Override Specific Backends

Format: {name}={path} with multiple backends separated by commas.
  • pixi-build-cmake=/path/to/bin - Use local executable
  • pixi-build-python - Use version from PATH

Override All Backends

This assumes all backends are in PATH and skips isolated installation.
Backend overrides are for development only. Don’t use in production or CI/CD.

Debugging Builds

Inspecting Generated Recipes

Backends generate rattler-build recipes stored in your project:

Rebuilding with rattler-build

Rerun a build directly:
This helps:
  • Inspect exact build recipes
  • Debug build failures
  • Understand backend behavior
  • Compare variant configurations
The <variant_hash> ensures each unique combination of build variants gets its own recipe directory.

Examining JSON-RPC Communication

Find debug files in the recipe directory:
These files show the exact communication between Pixi and the backend.

Backend Development

Backends implement a protocol for:
  1. Manifest protocol - Understanding project configuration
  2. Build protocol - Executing builds
  3. Recipe generation - Creating rattler-build recipes

Creating a Custom Backend

Backends must:
  • Accept JSON-RPC requests on stdin
  • Return JSON-RPC responses on stdout
  • Implement required protocol methods
  • Generate valid rattler-build recipes
See pixi-build-backends for examples.

Backend Selection Guide

Advanced Topics

Key Concepts

Compilers

How pixi-build integrates with conda-forge’s compiler infrastructure for cross-platform builds.

Multiple Backends in a Workspace

Different packages can use different backends:

Backend Versioning

Pin backends for reproducible builds:

Real-World Examples

Mixed Python and C++

pixi.toml
packages/cpp_core/pixi.toml

Best Practices

Use specific version ranges for reproducible builds:
Don’t force a backend:
Let backends handle defaults:
Comment why you chose a backend:

Next Steps

pixi-build-cmake

Complete CMake backend documentation

pixi-build-python

Complete Python backend documentation

Dependency Types

How backends use different dependencies

Build Variants

Building multiple configurations

Troubleshooting

Ensure backend channel is included:
Check generated recipe:
Try rebuilding with rattler-build directly for better error messages.
Explicitly specify compatible versions:
Some backends may not support all features. Consider:
  • Switching to pixi-build-rattler-build for full control
  • Contributing to the backend repository
  • Opening an issue for missing features