fix: match repodata records by file name - #2454
Conversation
Assisted-by: OpenAI Codex <https://openai.com/codex>
baszalmstra
left a comment
There was a problem hiding this comment.
is this also what conda does?
|
I checked conda's current So yes, this is intended to match conda behavior: a spec like Refs I checked:
|
|
Addressed in the follow-up commits. The current implementation no longer parses a URL for |
|
Addressed the URL parsing concern in the current head: |
Description
Fixes #1721
fnconstraints were parsed intoMatchSpec, but were not checked when matchingMatchSpecorNamelessMatchSpecagainst aRepoDataRecord. That allowed a path-style spec such asfn=file:///.../package.condato behave like a name-only match instead of selecting by the record's archive filename.This adds
RepoDataRecordfilename matching and treats URL/pathfnvalues as their basename, so a local path dependency can matchpackage-...condawhile still rejecting a different archive filename.How Has This Been Tested?
Red check before implementation:
cargo test -p rattler_conda_types test_file_name_matches_repodata_identifier -- --nocapturefailed becausefn=other-1.0-py37_0.condastill matched the record.Green checks after implementation:
cargo test -p rattler_conda_types test_file_name_matches_repodata_identifier -- --nocapturecargo test -p rattler_conda_types --libcargo fmt --all -- --checkcargo clippy -p rattler_conda_types --all-targets -- -D warningsgit diff --checkAI Disclosure
Tools: OpenAI GPT-5.5 was used to inspect the matchspec/repodata matching path, add the regression test and implementation, and draft this PR text. The changes and tests were reviewed and run locally.
Checklist: