Skip to content

fix(dispatch): resolve nested source dependencies declared in workspace - #7063

Open
aoright wants to merge 1 commit into
prefix-dev:mainfrom
aoright:fix-nested-source-dependencies
Open

aoright wants to merge 1 commit into
prefix-dev:mainfrom
aoright:fix-nested-source-dependencies

Conversation

@aoright

@aoright aoright commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

Description

When a build backend produces host or build dependencies as binary matchspec requirements (such as r-statforbiology * from an R DESCRIPTION file or a Python pyproject.toml), nested solves previously had no visibility into workspace-level source declarations and attempted to solve these dependencies as binary packages from remote Conda channels. If the package was only available from Git or a local path declared in the workspace, the solve failed with "No candidates were found".

This PR:

  1. Propagates workspace_sources through SolvePixiEnvironmentSpec, ResolveSourcePackageSpec, assemble_source_record, and nested_solve.
  2. In nested_solve, checks if any required package name matches an entry in workspace_sources, resolving it as a source package while preserving the backend's version constraints.
  3. Ensures walk_and_resolve falls back to workspace_sources when traversing nested dependencies.

Fixes #6925

How Has This Been Tested?

  • Added integration test test_nested_source_dependency_resolved_from_workspace in crates/pixi_command_dispatcher/tests/integration/main.rs:
    • Verifies that without workspace sources, solving fails when a nested source dependency is missing from channels.
    • Verifies that with workspace sources, the nested dependency is resolved from source, included in host packages, and added to the top-level solve output.
    • Verifies that version constraints are enforced against the workspace source package.
  • Ran cargo test -p pixi_command_dispatcher (174 unit tests, 44 integration tests passed).

AI Disclosure

  • This PR contains AI-generated content.
    • I have tested any AI-generated content in my PR.
    • I take responsibility for any AI-generated content in my PR.
      Tools: Claude

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added sufficient tests to cover my changes.

When a build backend produces host or build dependencies as binary matchspec requirements (such as r-statforbiology * from an R DESCRIPTION or Python pyproject.toml), nested solves previously had no visibility into workspace-level source declarations and attempted to solve these dependencies as binary packages from remote Conda channels.

This change propagates workspace_sources across SolvePixiEnvironmentSpec, ResolveSourcePackageSpec, assemble_source_record, and nested_solve. In nested_solve, binary requirements whose package name matches an entry in workspace_sources are mapped into source specifications while preserving version and build constraints from the backend matchspec. In addition, walk_and_resolve falls back to workspace_sources during dependency traversal.

Signed-off-by: aoright <102943475+aoright@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Nested source dependencies ignore workspace Git declarations

1 participant