Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add source replacement info when no matching package found #14715

Merged
merged 2 commits into from
Oct 24, 2024

Conversation

chentodd
Copy link
Contributor

@chentodd chentodd commented Oct 22, 2024

What does this PR try to resolve?

Fixes #14697

I updated error message in resolver/errors with Registry::describe_source

  • Use message from Registry::describe_source as default message
  • If the message is empty, use SourceId message

and I also updated related test cases.

How should we test and review this PR?

  1. Run following test cases:
  • resolver-tests
  • source_replacement
  • build
  • directory
  • local_registry
  • offline
  • package
  • publish
  • registry
  • update
  1. Run cargo-bug.zip
  • Unpack the zip archive
  • Run cargo build in the root

following message should be seen:

error: no matching package named `ahasha` found
location searched: directory source `/home/foo/Desktop/cargo-bug/vendor` (which is replacing registry `crates-io`)
required by package `example v0.1.0 (/home/foo/Desktop/cargo-bug)`

@rustbot
Copy link
Collaborator

rustbot commented Oct 22, 2024

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @ehuss (or someone else) some time within the next two weeks.

Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:

  • @rustbot author: the review is finished, PR author should check the comments and take action accordingly
  • @rustbot review: the author is ready for a review, this PR will be queued again in the reviewer's queue

@rustbot rustbot added A-dependency-resolution Area: dependency resolution and the resolver S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 22, 2024
@weihanglo weihanglo changed the title Error message fix fix: add source replacement info when no matching package found Oct 22, 2024
tests/testsuite/offline.rs Outdated Show resolved Hide resolved
…est cases

`Registry::describe_source` will be used as default error message, but if the message
come from `Registry::describe_source` is empty, then it uses `SourceId` message
@epage
Copy link
Contributor

epage commented Oct 24, 2024

Thanks!

@bors r+

@bors
Copy link
Contributor

bors commented Oct 24, 2024

📌 Commit 11f84a9 has been approved by epage

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 24, 2024
@bors
Copy link
Contributor

bors commented Oct 24, 2024

⌛ Testing commit 11f84a9 with merge 7571e92...

@bors
Copy link
Contributor

bors commented Oct 24, 2024

☀️ Test successful - checks-actions
Approved by: epage
Pushing 7571e92 to master...

1 similar comment
@bors
Copy link
Contributor

bors commented Oct 24, 2024

☀️ Test successful - checks-actions
Approved by: epage
Pushing 7571e92 to master...

@bors bors merged commit 7571e92 into rust-lang:master Oct 24, 2024
22 checks passed
@bors
Copy link
Contributor

bors commented Oct 24, 2024

👀 Test was successful, but fast-forwarding failed: 422 Changes must be made through a pull request.

@chentodd chentodd deleted the error_message_fix branch October 25, 2024 01:13
@hoodmane
Copy link

Thanks @chentodd!

bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 26, 2024
Update cargo

14 commits in cf53cc54bb593b5ec3dc2be4b1702f50c36d24d5..e75214ea4936d2f2c909a71a1237042cc0e14b07
2024-10-18 13:56:15 +0000 to 2024-10-25 16:34:32 +0000
- refactor(env): remove unnecessary clones (rust-lang/cargo#14730)
- test(install): Verify 2024 edition / resolver=3 doesn't affect resolution (rust-lang/cargo#14724)
- Fix: trace `config` `[env]` table in dep-info. (rust-lang/cargo#14701)
- Added unstable-schema generation for Cargo.toml (rust-lang/cargo#14683)
- fix: add source replacement info when no matching package found (rust-lang/cargo#14715)
- feat(complete): Include descriptions in zsh (rust-lang/cargo#14726)
- refactor(fingerprint): avoid unnecessary fopen calls (rust-lang/cargo#14728)
- docs(resolver): Make room for v3 resolver (rust-lang/cargo#14725)
- test: add fixes in the sat resolver (rust-lang/cargo#14707)
- docs(ci): Don't constrainty latest_deps job by MSRV (rust-lang/cargo#14711)
- refactor: use `Iterator::is_sorted` (rust-lang/cargo#14702)
- refactor(rustfix): minor refactors (rust-lang/cargo#14710)
- chore(deps): update msrv (rust-lang/cargo#14705)
- fix(renovate): Switch matchPackageNames to matchDepNames (rust-lang/cargo#14704)
@rustbot rustbot added this to the 1.84.0 milestone Oct 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-dependency-resolution Area: dependency resolution and the resolver S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Misleading error message when crates.io is replace-with a local source
6 participants