Skip to content

stack overflow caused by too long environment resolutions #294

@h0nIg

Description

@h0nIg

Describe the issue

We build the workspace just using the "prod" groups only. The developers still get the psycopg2-binary / non-prod group by default.

Once too much workspace members have conflict rules (which are resolvable but simply too much exists), the resolution marker probably gets too long. We solved the problem intermediary by shrinking the tool.uv.environments array, but this should still get addressed.

# nix build ".#xxxx"
evaluating derivation 'git+file://xxx#xxx'error: stack overflow (possible infinite recursion)

Additional context

main pyproject.toml:

[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[project]
name = "python3"
version = "1.0"

requires-python = ">=3.12,<3.14"

dependencies = [
    "xxx1",
    "xxx2",
    ....
]

[tool.setuptools]
packages = []

[tool.uv]
package = false
environments = [
    "platform_python_implementation != 'PyPy' and sys_platform == 'linux' and platform_machine == 'x86_64'",
    "platform_python_implementation != 'PyPy' and sys_platform == 'linux' and platform_machine == 'aarch64'",
    "platform_python_implementation != 'PyPy' and sys_platform == 'darwin' and platform_machine == 'x86_64'",
    "platform_python_implementation != 'PyPy' and sys_platform == 'darwin' and platform_machine == 'arm64'",
]

exclude-dependencies = [
    "uv",
]

[tool.uv.workspace]
members = [
    "components/xx1",
    "components/xx2",
    ....
]

[tool.uv.sources]
xxx1 = { workspace = true, editable = true }
xxx2 = { workspace = true, editable = true }
....

workspace member pyproject.toml:

[project]
name = "xxx1"
version = "1.0"
requires-python = ">=3.12"
dependencies = [
    "requests==2.32.5",
    .....
]

[dependency-groups]
prod = [
    "psycopg2~=2.9.11",
]
non-prod = [
    "psycopg2-binary~=2.9.11",
]
dev = [
    "pytest"
]

[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[tool.setuptools]
include-package-data = false
packages = []

[tool.uv]
package = false

default-groups = ["dev", "non-prod"]

conflicts = [
    [
        { group = "prod" },
        { group = "non-prod" },
    ]
]

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