#5782·pixi

feat(pixi-build-rattler-build): expose package version from manifest to recipe

Author: toprinseCreated Mar 27, 2026Updated Sep 17, 2026
Labelsenhancementarea:buildpixi-build-rattler-build

Problem description

Problem

When using the pixi-build-rattler-build backend to build a package, or multiple packages using multi-outputs mode, the package version must be duplicated between pixi.toml and recipe.yml.

Currently the only option is to hardcode it in the recipe context as version is mandatory in the recipe file:

# recipe.yml
context:
  version: 0.1.0  # duplicated from pixi.toml

In some cases, this creates two sources of truth that must be kept in sync manually :

Expected behavior

The pixi-build-rattler-build backend should expose the package version defined in pixi.toml as an environment variable (e.g. PIXI_PACKAGE_VERSION) so that recipes can reference it without duplication:

Suggested solution

As mentioned in the community discussion on discord, pixi-build could inject the version (from pixi.toml ?) as an environment variable before invoking rattler-build, similar to how $PREFIX, $BUILD_PREFIX, etc. are already injected.