Skip to content
This repository has been archived by the owner on Aug 15, 2024. It is now read-only.

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

@Rustin170506
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?

@Rustin170506
Copy link
Owner

I think this also related to #22

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

Successfully merging a pull request may close this issue.

3 participants