Skip to content

feat(build): variant selection for path source packages #4599

@lucascolley

Description

@lucascolley

original text from @baszalmstra


Description

It is currently not possible to specify any additional fields for source dependencies other than the name. This limits how much a backend (and a user for that matter) can express about different variants returned by the backends.

Example

Build backends cannot depend on a specific variant of a source package. Take this example

# regression test that pin subpackage works with `my.package`
context:
  name: my-package
  version: 0.1.0
recipe:
  version: ${{ version }}
build:
  number: 0
outputs:
  - package:
      name: ${{ name }}
    requirements:
      host:
        - python
    build:
      noarch: generic
  - package:
      name: ${{ name }}-pinned
    build:
      noarch: generic
    requirements:
      run:
        - ${{ pin_subpackage(name, exact=true) }}

With the following variants:

python:
  - "3.8"
  - "3.9"
  - "3.10"

We would expect 3 variants of my-package-pinned where each variant depends on a specific variant of my-package (because ${{ pin_subpackage(name, exact=true) }}) was specified.

However, when we call conda/outputs all dependencies to my-package are replaced with:

{
  "name": "my-package",
  "source": {
    "Path": {
      "path": "."
    }
  }
}

The hash for each variant is not added, which is wrong.

Solution

Source dependencies should also be allowed to specify the same fields as a NamelessMatchSpec or a BinarySpec to allow full control over variants.

Metadata

Metadata

Assignees

Labels

area:buildRelated to pixi buildbugSomething isn't workingenhancementNew features

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions