Skip to content

feat(rattler-build): Add config option for custom recipe path #471

@jackm97

Description

@jackm97

Summary

Add a configuration option to pixi-build-rattler-build to specify a custom path to the recipe file, rather than only searching the hardcoded locations.

Use Case

When building multi-output recipes in a pixi workspace, it's common to have:

  • One shared recipe.yaml with multiple outputs (e.g., mylib-libs, mylib-devel, mylib)
  • Multiple sub-package pixi.toml files, each with [package] name = "mylib-libs" etc.

The current directory structure requires symlinks as a workaround:

packages/mylib/
├── pixi.toml                  # Workspace
├── recipe/
│   └── recipe.yaml            # Single recipe with 3 outputs
├── libs/
│   ├── pixi.toml              # [package] name="mylib-libs"
│   └── recipe -> ../recipe    # Symlink workaround
├── devel/
│   ├── pixi.toml              # [package] name="mylib-devel"  
│   └── recipe -> ../recipe    # Symlink workaround
└── toolkit/
    ├── pixi.toml              # [package] name="mylib"
    └── recipe -> ../recipe    # Symlink workaround

Proposed Solution

Add a recipe-path config option:

# libs/pixi.toml
[package]
name = "mylib-libs"
version = "1.0.0"

[package.build]
backend = { name = "pixi-build-rattler-build", version = "*" }

[package.build.config]
recipe-path = "../recipe/recipe.yaml"  # or "../recipe" for directory

This would eliminate the need for symlinks and make the configuration more explicit.

Current Behavior

The backend only searches these hardcoded paths relative to the manifest:

  1. recipe.yaml
  2. recipe.yml
  3. recipe/recipe.yaml
  4. recipe/recipe.yml

(From rattler_build.rs)

Alternatives Considered

  • Symlinks: Works but feels like a workaround, not explicit in config
  • Duplicate recipes: Defeats the purpose of multi-output recipes
  • Flat structure: Loses the logical grouping of sub-packages

Additional Context

This came up while building Intel DPC++/SYCL compiler packages where we have a single complex recipe producing sycl-toolkit-libs, sycl-toolkit-devel, and sycl-toolkit outputs, managed as separate packages in a pixi workspace.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions