Skip to content

feat: Add extra-args config option to pixi-build-rattler-build backend #468

@jackm97

Description

@jackm97

Summary

The pixi-build-rattler-build backend currently only supports debug-dir and extra-input-globs configuration options. It would be very useful to add an extra-args option (similar to pixi-build-cmake) to pass arbitrary flags to the underlying rattler-build invocation.

Use Case

I'm building a multi-output conda package using the cache: feature in my recipe.yaml. This feature requires the --experimental flag to be passed to rattler-build:

# recipe.yaml
schema_version: 1

cache:
  source:
    path: ../repo
  # ... shared build configuration

outputs:
  - package:
      name: my-package-libs
      # ...
  - package:
      name: my-package-devel
      # ...

When running rattler-build build --experimental -r recipe.yaml directly, this works fine. However, when using pixi build, there's no way to pass the --experimental flag through the backend.

Current Behavior

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

[package.build.config]
extra-args = ["--experimental"]  # ❌ Not supported

Results in:

Error: unknown field `extra-args`, expected one of `debug-dir`, `debug_dir`, `extra-input-globs`

Proposed Solution

Add an extra-args configuration option to pixi-build-rattler-build, similar to how pixi-build-cmake handles it:

[package.build.config]
extra-args = ["--experimental"]

This would allow users to pass any rattler-build CLI flags through pixi, including:

  • --experimental - for experimental features like cache:
  • --no-test - to skip tests
  • --keep-build - to preserve build directory
  • Any future flags

Alternatives Considered

  1. Add only an experimental = true option: This would solve my immediate problem but wouldn't be as flexible for other use cases.

  2. Restructure the recipe to avoid cache:: This would require either building multiple times (very slow for large projects like LLVM) or using a single monolithic package.

  3. Use rattler-build directly instead of pixi build: Loses the benefits of pixi's dependency management and workspace features.

Additional Context

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