Skip to content

[Bug]: resolution-markers never resolved #994

Description

@timothyklim

What happened?

For example I'm using torch for MacOS and Linux but because for Linux I need cuda packages, on macos it's selected also because there no evaluation of package resolution-markers from lock file.

name = "backend"
version = "1.0.0"
dependencies = [
    "fastapi>=0.128.0",
    "torch==2.9.1",
    "torchvision",
    "torchaudio",
]

[tool.uv.sources]
torch = [
  { index = "torch-cuda", marker = "sys_platform == 'linux'" },
  { index = "pypi", marker = "sys_platform == 'darwin'" },
]
torchaudio = [
  { index = "torch-cuda", marker = "sys_platform == 'linux'" },
  { index = "pypi", marker = "sys_platform == 'darwin'" },
]
torchvision = [
  { index = "torch-cuda", marker = "sys_platform == 'linux'" },
  { index = "pypi", marker = "sys_platform == 'darwin'" },
]

[[tool.uv.index]]
name = "torch-cuda"
url = "https://download.pytorch.org/whl/cu130"
explicit = true

[[tool.uv.index]]
name = "pypi"
url = "https://pypi.org/simple"```

### Version

bazel 9.1.0

### How to reproduce

```shell

Any other information?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions