Pixi Build Backends#
Backend Implementations for Building Pixi Projects from Source
Pixi Build Backends is a collection of specialized build backend implementations designed to facilitate building Pixi packages directly from their source code. These backends enable seamless integration with the Pixi ecosystem, supporting multiple programming languages and build systems while maintaining the conda ecosystem's cross-platform compatibility.
🚀 What Are Build Backends?#
Build backends are executables that follow a specific protocol to decouple the building of conda packages from Pixi itself. This architecture allows for:
- Language-specific optimization: Each backend is tailored for specific programming languages and build tools
- Modular design: Backends can be developed, updated, and distributed independently
- Extensibility: New backends can be added without modifying Pixi core
- Standardization: All backends follow the same protocol and manifest specifications
📦 Available Backends#
The repository currently provides the following specialized build backends:
| Backend | Use Case |
|---|---|
pixi-build-cmake |
Projects using CMake |
pixi-build-python |
Building Python packages |
pixi-build-rattler-build |
Direct recipe.yaml builds with full control |
pixi-build-ros |
ROS (Robot Operating System) packages |
pixi-build-rust |
Cargo-based Rust applications and libraries |
pixi-build-mojo |
Mojo applications and packages |
All backends are available through the prefix.dev/conda-forge conda channel and work across multiple platforms (Linux, macOS, Windows). For the latest backend versions, you can extend the channel list with the prefix.dev/pixi-build-backends conda channel, here we push the latest versions of the backends.
🛠️ Getting Started#
Check out our tutorial series to learn how to use pixi build in practice.
📚 Key Concepts#
- Compilers
Learn how pixi-build integrates with conda-forge's compiler infrastructure to provide cross-platform, ABI-compatible builds. Covers compiler configuration, platform-specific behavior, and available compiler options for supported backends.
🔧 Troubleshooting#
Rebuilding Generated Recipes#
When you build a package using pixi build, the build backends generate a complete rattler-build recipe that is stored in your project's build directory. This can be useful for debugging build issues or understanding exactly how your package is being built.
Recipe Locations#
The build backends generate recipes in two locations:
1. General Recipe (all outputs)#
This directory contains:
recipe.yaml- A general recipe that can build all package outputsvariants.yaml- All variant configurations for the package
2. Variant-Specific Recipe (single output)#
This directory contains:
recipe.yaml- The complete rattler-build recipe generated by the build backendvariants.yaml- The variant configuration used for this specific build
Rebuilding a Package#
To debug or rebuild a package using the same configuration, you have two options:
Option 1: Navigate to the recipe directory#
-
Navigate to the recipe directory:
-
Use
rattler-buildto rebuild the package:
Option 2: Point to the recipe directory#
Use the --recipe flag to build without changing directories:
This allows you to:
- Inspect the exact recipe that was generated
- Debug build failures with direct access to
rattler-build - Understand how the build backend translated your project model (
pixi.toml)
Tip
The <variant_hash> ensures that each unique combination of build variants gets its own recipe directory, making it easy to compare different build configurations.
🔗 Useful Links#
- GitHub: Pixi source code, feel free to leave a star!
- Discord: Join our community and ask questions.
- Prefix.dev: The company behind Pixi, building the future of package management.
- conda-forge: Community-driven collection of recipes for the conda package manager.
- Rattler: Everything conda but built in Rust. Backend of Pixi.
- rattler-build: A blazing fast build system for conda packages.