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

Panic when you query a local crate with unpublished version under its package root #60

Closed
weihanglo opened this issue Dec 7, 2023 · 3 comments · Fixed by #66
Closed
Labels

Comments

@weihanglo
Copy link

weihanglo commented Dec 7, 2023

Reproduce:

  1. clone a published crate
  2. bump a version
  3. cargo info <crate>
  4. Bang!
$ RUST_BACKTRACE=1 cargo info my-unpublished-crate
thread 'main' panicked at /home/weihanglo/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cargo-0.75.1/src/cargo/sources/registry/mod.rs:463:9:
assertion failed: source_id.is_remote_registry()
stack backtrace:
   0: rust_begin_unwind
             at /rustc/1a06ac5b5d7c9331e8de1aa1fd7e9d3533034b44/library/std/src/panicking.rs:645:5
   1: core::panicking::panic_fmt
             at /rustc/1a06ac5b5d7c9331e8de1aa1fd7e9d3533034b44/library/core/src/panicking.rs:72:14
   2: core::panicking::panic
             at /rustc/1a06ac5b5d7c9331e8de1aa1fd7e9d3533034b44/library/core/src/panicking.rs:127:5
   3: cargo::sources::registry::RegistrySource::remote
   4: cargo_information::ops::info::info
   5: cargo_info::command::info::exec
   6: cargo_info::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

version: 299e38e8787f43642b11d6e7bf687efa2c973aae

@SteveLauC
Copy link

It would be cool if we could do the query to local projects, to avoid naming conflicts, it probably needs a --local option

@hi-rustin
Copy link
Owner

Thanks for your reporting.

It sounds like a feature request. Right now, it only supports the released version on the registry. But I guess it makes sense to support it for workspace packages.

I will first try to make it not panic and give a clearer error message before we decide to support it.

cc @epage What do you think about this feature?

@hi-rustin
Copy link
Owner

I think this also related to #22

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants