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

can't find crates #16

Closed
matthiaskrgr opened this issue Sep 9, 2019 · 6 comments
Closed

can't find crates #16

matthiaskrgr opened this issue Sep 9, 2019 · 6 comments

Comments

@matthiaskrgr
Copy link

I'm getting this a lot since updating to cargo-udeps 0.1.2:
repro:

git clone https://github.com/rust-lang/cargo --depth=1
cd cargo
cargo udeps

panics:

thread 'main' panicked at 'could not find "crates-io 0.28.0 (path+file:///tmp/cargo/crates/crates-io)"', /home/matthias/.cargo/registry/src/github.com-1ecc6299db9ec823/cargo-udeps-0.1.2/src/main.rs:349:25
stack backtrace:
   0: backtrace::backtrace::libunwind::trace
             at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.35/src/backtrace/libunwind.rs:88
   1: backtrace::backtrace::trace_unsynchronized
             at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.35/src/backtrace/mod.rs:66
   2: std::sys_common::backtrace::_print
             at src/libstd/sys_common/backtrace.rs:47
   3: std::sys_common::backtrace::print
             at src/libstd/sys_common/backtrace.rs:36
   4: std::panicking::default_hook::{{closure}}
             at src/libstd/panicking.rs:200
   5: std::panicking::default_hook
             at src/libstd/panicking.rs:214
   6: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:477
   7: std::panicking::continue_panic_fmt
             at src/libstd/panicking.rs:384
   8: std::panicking::begin_panic_fmt
             at src/libstd/panicking.rs:339
   9: cargo_udeps::main::{{closure}}
  10: cargo_udeps::main
  11: std::rt::lang_start::{{closure}}
  12: std::rt::lang_start_internal::{{closure}}
             at src/libstd/rt.rs:49
  13: std::panicking::try::do_call
             at src/libstd/panicking.rs:296
  14: __rust_maybe_catch_panic
             at src/libpanic_unwind/lib.rs:80
  15: std::panicking::try
             at src/libstd/panicking.rs:275
  16: std::panic::catch_unwind
             at src/libstd/panic.rs:394
  17: std::rt::lang_start_internal
             at src/libstd/rt.rs:48
  18: main
  19: __libc_start_main
  20: _start
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
@est31
Copy link
Owner

est31 commented Sep 10, 2019

cc @qryxip

@est31 est31 closed this as completed in fd3cedf Sep 10, 2019
@est31
Copy link
Owner

est31 commented Sep 10, 2019

The issue was that crates-io had a lib name that was different from the package name. crates-io was the package name while crates_io was the lib name. Other packages with dashes have dashes in their lib name too, it's just that crates-io has a custom [lib] section with a name = "crates_io" entry.

@est31
Copy link
Owner

est31 commented Sep 10, 2019

In fd3cedf i added a fallback search based on the pkg name instead of the lib name. @qryxip Is the lib name based search actually needed at all?

@matthiaskrgr
Copy link
Author

I checked with fd3cedf now and there's still a failure with cargo the FIRST time I run cargo-udeps:

Loading save analysis from "/home/matthias/vcs/github/cargo/target/debug/deps/save-analysis/libcrates_io-728b49bbdee2d583.json"
thread 'main' panicked at 'could not find "curl"', /home/matthias/.cargo/git/checkouts/cargo-udeps-a54b3ec58ed788c4/fd3cedf/src/main.rs:402:24
stack backtrace:
   0: backtrace::backtrace::libunwind::trace
             at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.35/src/backtrace/libunwind.rs:88
   1: backtrace::backtrace::trace_unsynchronized
             at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.35/src/backtrace/mod.rs:66
   2: std::sys_common::backtrace::_print
             at src/libstd/sys_common/backtrace.rs:47
   3: std::sys_common::backtrace::print
             at src/libstd/sys_common/backtrace.rs:36
   4: std::panicking::default_hook::{{closure}}
             at src/libstd/panicking.rs:200
   5: std::panicking::default_hook
             at src/libstd/panicking.rs:214
   6: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:477
   7: std::panicking::continue_panic_fmt
             at src/libstd/panicking.rs:384
   8: std::panicking::begin_panic_fmt
             at src/libstd/panicking.rs:339
   9: cargo_udeps::main::{{closure}}
  10: cargo_udeps::main
  11: std::rt::lang_start::{{closure}}
  12: std::rt::lang_start_internal::{{closure}}
             at src/libstd/rt.rs:49
  13: std::panicking::try::do_call
             at src/libstd/panicking.rs:296
  14: __rust_maybe_catch_panic
             at src/libpanic_unwind/lib.rs:80
  15: std::panicking::try
             at src/libstd/panicking.rs:275
  16: std::panic::catch_unwind
             at src/libstd/panic.rs:394
  17: std::rt::lang_start_internal
             at src/libstd/rt.rs:48
  18: main
  19: __libc_start_main
  20: _start
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

A second run right after just says All deps seem to have been used. and exits normally. 🤔

@est31 est31 reopened this Sep 10, 2019
@est31
Copy link
Owner

est31 commented Sep 10, 2019

After 6213e29 the error message is improved. The problem seems to be that crates-io is not a member of cargo's workspace but is only a path dependency. However, cargo-udeps lints for all path dependencies, workspace members or not. I'll review #18 soon.

@matthiaskrgr
Copy link
Author

Looks like that fixed it, thanks!

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

No branches or pull requests

2 participants