Skip to content

Reject impossible project-extra conflict forks - #2593

Draft
zaniebot wants to merge 3 commits into
mainfrom
zaniebot/project-extra-conflict-prerequisite
Draft

zaniebot wants to merge 3 commits into
mainfrom
zaniebot/project-extra-conflict-prerequisite

Conversation

@zaniebot

Copy link
Copy Markdown
Collaborator

Overlapping project and extra entries in tool.uv.conflicts can keep an extra active after excluding its project, pulling that project's dependencies into an impossible fork and rejecting a satisfiable resolution. Reject those forks while respecting conflicts that explicitly make a project's extra an alternative to its production selection. Dependency groups can still be selected independently of production dependencies.

@zaniebot
zaniebot deployed to automations October 10, 2026 03:33 — with GitHub Actions Active
@astral-automations-bot astral-automations-bot Bot added bug Something isn't working preview Experimental behavior labels Oct 10, 2026
@zaniebot zaniebot mentioned this pull request Oct 10, 2026
@zaniebot
zaniebot deployed to automations October 10, 2026 03:38 — with GitHub Actions Active
Comment on lines +174 to +176
.filter(move |item| {
matches!(item.kind(), ConflictKind::Extra(_))
&& set.contains(item.package(), ConflictKindRef::Project)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P3] Centralize the own-project/extra conflict relationship

This duplicates the relationship already computed by the project_conflicts_with_extra closure and method in crates/uv-lock/src/lock/mod.rs. The same exception now controls resolver fork pruning and lockfile dependency validation, leaving three definitions that maintainers must keep synchronized. Move this domain query onto Conflicts and reuse it in both layers; the resolver can continue caching the resulting extras for fork checks.

@zaniebot
zaniebot deployed to automations October 10, 2026 03:48 — with GitHub Actions Active
@zaniebot
zaniebot deployed to automations October 10, 2026 03:52 — with GitHub Actions Active
Comment on lines +11257 to +11261
/// Dependency groups can be selected without their project's production dependencies.
#[test]
fn project_level_conflict_with_own_group() -> Result<()> {
let context = uv_test::test_context!("3.12");
let scenario = toml::from_str::<Scenario>(indoc! {r#"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P3] Remove the duplicate project/group conflict scenario

This standalone scenario duplicates lock_conflicting_project_basic1 in crates/uv/tests/lock/lock.rs, which already checks incompatible production/group requirements, successful locking with a declared conflict, and separate production and --only-group selections. The new project_level_conflict_with_extra_and_group_forks test also covers group independence alongside the changed extra-pruning behavior. Remove this standalone test to avoid maintaining another fixture and command snapshots for behavior already covered.

@zaniebot
zaniebot deployed to automations October 10, 2026 03:58 — with GitHub Actions Active
@codspeed

codspeed Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

⚠️ 8 benchmarks spent significant time in system calls

System calls cannot be consistently instrumented, so they are not included in the measure, which understates the real cost. Please switch to the Walltime instrument to accurately measure system calls.

Measurement and system calls

✅ 54 untouched benchmarks
⏩ 35 skipped benchmarks1


Comparing zaniebot/project-extra-conflict-prerequisite (1c7bcd3) with main (4bf8e7b)

Open in CodSpeed

Footnotes

  1. 35 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

This branch was successfully deployed

1 active deployment
automations — 1c7bcd38 Deployed Oct 10, 2026 by zaniebot via review-code-quality / code quality review #9522
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working preview Experimental behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant