Skip to content

feat!: Make name in MatchSpec non-optional#2132

Merged
baszalmstra merged 4 commits intoconda:mainfrom
pavelzw:wip
Feb 28, 2026
Merged

feat!: Make name in MatchSpec non-optional#2132
baszalmstra merged 4 commits intoconda:mainfrom
pavelzw:wip

Conversation

@pavelzw
Copy link
Copy Markdown
Member

@pavelzw pavelzw commented Feb 26, 2026

Description

xref #2079

Fixes #2039

How Has This Been Tested?

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: github pr review comments to unspecified model

Checklist:

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

@pavelzw pavelzw marked this pull request as ready for review February 26, 2026 18:30
@pavelzw pavelzw requested a review from baszalmstra February 26, 2026 21:20
Copy link
Copy Markdown
Collaborator

@baszalmstra baszalmstra left a comment

Choose a reason for hiding this comment

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

Lets change the code to use as_exact and into_exact instead of Option::::From. I find that much more readable.

Comment thread crates/rattler_conda_types/src/match_spec/mod.rs Outdated
Comment thread crates/rattler_conda_types/src/match_spec/mod.rs
Comment thread crates/rattler_conda_types/src/match_spec/mod.rs Outdated
Comment thread crates/rattler_repodata_gateway/src/gateway/query.rs Outdated
Comment thread crates/rattler_repodata_gateway/src/sparse/mod.rs Outdated
Comment thread crates/rattler_solve/src/resolvo/mod.rs Outdated
Comment thread crates/rattler_solve/src/resolvo/mod.rs Outdated
Comment on lines -596 to -599
let matching_package = records.iter().find(|record| match &constraint_spec.name {
Some(matcher) => matcher.matches(&record.as_ref().name),
None => false,
});
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

this is a behavior change but makes more sense now. * should not match false but true every time

@pavelzw pavelzw requested a review from baszalmstra February 26, 2026 23:27
@baszalmstra baszalmstra merged commit 98815b8 into conda:main Feb 28, 2026
18 checks passed
@baszalmstra
Copy link
Copy Markdown
Collaborator

thanks @pavelzw

@pavelzw pavelzw deleted the wip branch February 28, 2026 13:01
@github-actions github-actions Bot mentioned this pull request Feb 27, 2026
suhr25 added a commit to suhr25/rattler that referenced this pull request Mar 1, 2026
…name change

After conda#2132 made MatchSpec::name non-optional (PackageNameMatcher instead of
Option<PackageNameMatcher>), the dependency override lookup code still called
.as_ref() which is not implemented for PackageNameMatcher. Replace with
.as_exact() which returns Option<&PackageName> as intended.

Also apply rustfmt formatting to PollResult::Validate struct literal in
gcs_middleware.rs.
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.

Replace MatchSpec with no name (*) with glob matchspec

2 participants