Git Product home page Git Product logo

cargo-udeps's People

Contributors

artslob avatar atkinschang avatar casey avatar cmtm avatar danhhz avatar deg4uss3r avatar dependabot[bot] avatar est31 avatar fenollp avatar garvys avatar gcomte avatar hendrikmaus avatar ithinuel avatar jayvdb avatar joshtriplett avatar jplatte avatar leroyguillaume avatar lo48576 avatar lu-zero avatar luckysori avatar nicholas-baron avatar nobodyxu avatar oconnor663 avatar orhun avatar paolobarbolini avatar pvdrz avatar qryxip avatar rajivshah3 avatar rouge8 avatar utkarshgupta137 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cargo-udeps's Issues

cargo udeps panic

when I run cargo udeps for my project, the udeps panic, it panic at

errorthread '<unnamed>' panicked at 'invalid format for extern arg: proc_macro', /home/sherlock/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/cargo-udeps-0.1.9/src/lib.rs:580:25: worker panicked

image

however I run cargo check, it runs successfully.

Do not handle package renaming properly

In our case, we got:

Loading save analysis from "/home/otavio/src/updatehub/updatehub/target/debug/deps/save-analysis/updatehub-1134cf3d97c43219.json"
unused crates: ["pkg_schema"]
cargo udeps  237.24s user 14.16s system 589% cpu 42.643 total

The repo is at: https://github.com/otavio/updatehub/
Renaming: https://github.com/otavio/updatehub/blob/12387d84774c986c59e2d8336baa0b128373b120/updatehub/Cargo.toml#L27

This crate is used, and likely due to the rename, it was not found.

GitHub action

Would there be an interest to roll out a GitHub action for cargo-udeps so that adding this one to CI runs would be just a one-liner?
There is an awesome template by embark guys with their cargo-deny sanitizer we could use as a reference, which is nothing more than a Dockerfile and 3-4 lines of bash at it's core (link)
There is also an opened issue to think about somehow merging deny and udeps both together, but this is yet another topic :D

The action will probably reside in a separate repo (since it involves tagging versions of the action and this may interfere with cargo-udeps cli releases).

cargo-lipo does not have any 'lib' target

Hi,

I ran cargo +nightly udeps from a crate in a workspace. I got:

thread 'main' panicked at '`cargo-lipo v3.1.0` does not have any `lib` target', /Users/rainhead/.cargo/registry/src/github.com-1ecc6299db9ec823/cargo-udeps-0.1.6/src/lib.rs:640:24

cargo-lipo is a build-dependency of another crate in the workspace, but not one in the dependency tree of the crate I ran the command from.

Parse Rust code with syn

The current approach is to compile the entire crate and use save-analysis. While this is very good at mimicing the actual build, it also is very time consuming, requires nightly, and compiles all dependencies of the crate. Also, it can't really be run on completely untrusted code.

An alternative approach would be to parse the Rust code with syn, following all mod statements. Then one can scan for all top level-path items and check their names.

cargo install cargo-udeps --locked: `linking with cc failed`

Stdout
% cargo install cargo-udeps --locked
    Updating crates.io index
  Installing cargo-udeps v0.1.15
   Compiling libc v0.2.79
   Compiling pkg-config v0.3.18
   Compiling cfg-if v0.1.10
   Compiling autocfg v1.0.1
   Compiling proc-macro2 v1.0.24
   Compiling unicode-xid v0.2.1
   Compiling syn v1.0.43
   Compiling version_check v0.9.2
   Compiling serde_derive v1.0.116
   Compiling serde v1.0.116
   Compiling lazy_static v1.4.0
   Compiling bitflags v1.2.1
   Compiling crc32fast v1.2.0
   Compiling log v0.4.11
   Compiling getrandom v0.1.15
   Compiling memchr v2.3.3
   Compiling tinyvec v0.3.4
   Compiling matches v0.1.8
   Compiling ryu v1.0.5
   Compiling typenum v1.12.0
   Compiling percent-encoding v2.1.0
   Compiling regex-syntax v0.6.18
   Compiling serde_json v1.0.58
   Compiling openssl-probe v0.1.2
   Compiling anyhow v1.0.33
   Compiling curl v0.4.33
   Compiling openssl v0.10.30
   Compiling foreign-types-shared v0.1.1
   Compiling ppv-lite86 v0.2.9
   Compiling unicode-width v0.1.8
   Compiling itoa v0.4.6
   Compiling same-file v1.0.6
   Compiling vec_map v0.8.2
   Compiling utf8parse v0.1.1
   Compiling ansi_term v0.11.0
   Compiling fnv v1.0.7
   Compiling quick-error v1.2.3
   Compiling unicode-segmentation v1.6.0
   Compiling strsim v0.8.0
   Compiling semver-parser v0.7.0
   Compiling hex v0.3.2
   Compiling termcolor v1.1.0
   Compiling remove_dir_all v0.5.3
   Compiling shell-escape v0.1.5
   Compiling glob v0.3.0
   Compiling rustc-workspace-hack v1.0.0
   Compiling bytesize v1.0.1
   Compiling opener v0.4.1
   Compiling hex v0.4.2
   Compiling humantime v2.0.1
   Compiling home v0.5.3
   Compiling lazycell v1.3.0
   Compiling ansi_term v0.12.1
   Compiling thread_local v1.0.1
   Compiling proc-macro-error-attr v1.0.4
   Compiling proc-macro-error v1.0.4
   Compiling im-rc v15.0.0
   Compiling crossbeam-utils v0.7.2
   Compiling unicode-bidi v0.3.4
   Compiling unicode-normalization v0.1.13
   Compiling foreign-types v0.3.2
   Compiling textwrap v0.11.0
   Compiling walkdir v2.3.1
   Compiling vte v0.3.3
   Compiling humantime v1.3.0
   Compiling heck v0.3.1
   Compiling strip-ansi-escapes v0.1.0
   Compiling idna v0.2.0
   Compiling jobserver v0.1.21
   Compiling filetime v0.2.12
   Compiling socket2 v0.3.15
   Compiling atty v0.2.14
   Compiling num_cpus v1.13.0
   Compiling quote v1.0.7
   Compiling aho-corasick v0.7.13
   Compiling bstr v0.2.13
   Compiling tar v0.4.30
   Compiling cc v1.0.61
   Compiling rand_core v0.5.1
   Compiling clap v2.33.3
   Compiling url v2.1.1
   Compiling bitmaps v2.1.0
   Compiling regex v1.3.9
   Compiling rand_chacha v0.2.2
   Compiling rand_xoshiro v0.4.0
   Compiling libz-sys v1.1.2
   Compiling openssl-sys v0.9.58
   Compiling libnghttp2-sys v0.1.4+1.41.0
   Compiling curl-sys v0.4.36+curl-7.71.1
   Compiling libssh2-sys v0.2.19
   Compiling libgit2-sys v0.12.13+1.0.1
   Compiling sized-chunks v0.6.2
   Compiling rand v0.7.3
   Compiling globset v0.4.5
   Compiling env_logger v0.7.1
   Compiling ignore v0.4.16
   Compiling tempfile v3.1.0
   Compiling structopt-derive v0.4.12
   Compiling flate2 v1.0.18
   Compiling structopt v0.3.19
   Compiling cargo v0.48.0
   Compiling crypto-hash v0.3.4
   Compiling git2 v0.13.11
   Compiling semver v0.10.0
   Compiling toml v0.5.6
   Compiling serde_ignored v0.1.2
   Compiling cargo-platform v0.1.1
   Compiling crates-io v0.31.1
   Compiling rustfix v0.5.1
   Compiling git2-curl v0.14.1
   Compiling cargo-udeps v0.1.15
error: linking with `cc` failed: exit code: 1
  |
  = note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m64" "-Wl,--eh-frame-hdr" "-L" "/home/linusb/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/tmp/cargo-installJlrhXh/release/deps/cargo_udeps-4ad270e2c9a4b29f.cargo_udeps.8rvwrm26-cgu.0.rcgu.o" "/tmp/cargo-installJlrhXh/release/deps/cargo_udeps-4ad270e2c9a4b29f.cargo_udeps.8rvwrm26-cgu.1.rcgu.o" "/tmp/cargo-installJlrhXh/release/deps/cargo_udeps-4ad270e2c9a4b29f.cargo_udeps.8rvwrm26-cgu.10.rcgu.o" "/tmp/cargo-installJlrhXh/release/deps/cargo_udeps-4ad270e2c9a4b29f.cargo_udeps.8rvwrm26-cgu.11.rcgu.o" "/tmp/cargo-installJlrhXh/release/deps/cargo_udeps-4ad270e2c9a4b29f.cargo_udeps.8rvwrm26-cgu.12.rcgu.o" "/tmp/cargo-installJlrhXh/release/deps/cargo_udeps-4ad270e2c9a4b29f.cargo_udeps.8rvwrm26-cgu.13.rcgu.o" "/tmp/cargo-installJlrhXh/release/deps/cargo_udeps-4ad270e2c9a4b29f.cargo_udeps.8rvwrm26-cgu.14.rcgu.o" "/tmp/cargo-installJlrhXh/release/deps/cargo_udeps-4ad270e2c9a4b29f.cargo_udeps.8rvwrm26-cgu.15.rcgu.o" "/tmp/cargo-installJlrhXh/release/deps/cargo_udeps-4ad270e2c9a4b29f.cargo_udeps.8rvwrm26-cgu.2.rcgu.o" "/tmp/cargo-installJlrhXh/release/deps/cargo_udeps-4ad270e2c9a4b29f.cargo_udeps.8rvwrm26-cgu.3.rcgu.o" "/tmp/cargo-installJlrhXh/release/deps/cargo_udeps-4ad270e2c9a4b29f.cargo_udeps.8rvwrm26-cgu.4.rcgu.o" "/tmp/cargo-installJlrhXh/release/deps/cargo_udeps-4ad270e2c9a4b29f.cargo_udeps.8rvwrm26-cgu.5.rcgu.o" "/tmp/cargo-installJlrhXh/release/deps/cargo_udeps-4ad270e2c9a4b29f.cargo_udeps.8rvwrm26-cgu.6.rcgu.o" "/tmp/cargo-installJlrhXh/release/deps/cargo_udeps-4ad270e2c9a4b29f.cargo_udeps.8rvwrm26-cgu.7.rcgu.o" "/tmp/cargo-installJlrhXh/release/deps/cargo_udeps-4ad270e2c9a4b29f.cargo_udeps.8rvwrm26-cgu.8.rcgu.o" "/tmp/cargo-installJlrhXh/release/deps/cargo_udeps-4ad270e2c9a4b29f.cargo_udeps.8rvwrm26-cgu.9.rcgu.o" "-o" "/tmp/cargo-installJlrhXh/release/deps/cargo_udeps-4ad270e2c9a4b29f" "/tmp/cargo-installJlrhXh/release/deps/cargo_udeps-4ad270e2c9a4b29f.snemrwk7v1kupuf.rcgu.o" "-Wl,--gc-sections" "-pie" "-Wl,-zrelro" "-Wl,-znow" "-Wl,-O1" "-nodefaultlibs" "-L" "/tmp/cargo-installJlrhXh/release/deps" "-L" "/usr/lib" "-L" "/tmp/cargo-installJlrhXh/release/build/libnghttp2-sys-22c16f041504b78d/out/i/lib" "-L" "/usr/lib/openssl-1.0" "-L" "/usr/lib" "-L" "/tmp/cargo-installJlrhXh/release/build/libssh2-sys-b6d0c21048e26722/out/build" "-L" "/home/linusb/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "/tmp/cargo-installJlrhXh/release/deps/libcargo_udeps-2fc5a7b1e77b30a1.rlib" "/tmp/cargo-installJlrhXh/release/deps/libstructopt-1d18183a458d84ee.rlib" "/tmp/cargo-installJlrhXh/release/deps/libansi_term-1eef6c07e7bfb725.rlib" "/tmp/cargo-installJlrhXh/release/deps/libcargo-becaee37a9ef7bcc.rlib" "/tmp/cargo-installJlrhXh/release/deps/libunicode_xid-a022950b7ec6389a.rlib" "/tmp/cargo-installJlrhXh/release/deps/libhex-56d14df33fe6856e.rlib" "/tmp/cargo-installJlrhXh/release/deps/libhome-69013ab9cb34ec5f.rlib" "/tmp/cargo-installJlrhXh/release/deps/libopener-9bea2681af56d383.rlib" "/tmp/cargo-installJlrhXh/release/deps/libim_rc-6908106d0547ee58.rlib" "/tmp/cargo-installJlrhXh/release/deps/librand_xoshiro-14db6d0a03039928.rlib" "/tmp/cargo-installJlrhXh/release/deps/libsized_chunks-0cf4989e400b899e.rlib" "/tmp/cargo-installJlrhXh/release/deps/libbitmaps-deea59fe81620cdc.rlib" "/tmp/cargo-installJlrhXh/release/deps/libtypenum-d7ca20abc12abbe8.rlib" "/tmp/cargo-installJlrhXh/release/deps/libtoml-8402a86390b16ad3.rlib" "/tmp/cargo-installJlrhXh/release/deps/libstrip_ansi_escapes-359611d286e9925f.rlib" "/tmp/cargo-installJlrhXh/release/deps/libvte-dca5c58a4af53e85.rlib" "/tmp/cargo-installJlrhXh/release/deps/libutf8parse-6e6008836aa47294.rlib" "/tmp/cargo-installJlrhXh/release/deps/libhumantime-7a0fb41d81f906e5.rlib" "/tmp/cargo-installJlrhXh/release/deps/libnum_cpus-06fb0fe06e8892a9.rlib" "/tmp/cargo-installJlrhXh/release/deps/libserde_ignored-49493f7cbb7bdfce.rlib" "/tmp/cargo-installJlrhXh/release/deps/libcrypto_hash-cb087f1bb9035e24.rlib" "/tmp/cargo-installJlrhXh/release/deps/libopenssl-87fe2bf9690c6b2e.rlib" "/tmp/cargo-installJlrhXh/release/deps/libforeign_types-e905659fd4f440fd.rlib" "/tmp/cargo-installJlrhXh/release/deps/libforeign_types_shared-23e9a159fd1edb9e.rlib" "/tmp/cargo-installJlrhXh/release/deps/libhex-ef2ab26148ee3bcd.rlib" "/tmp/cargo-installJlrhXh/release/deps/libshell_escape-b96d9154467062fe.rlib" "/tmp/cargo-installJlrhXh/release/deps/libclap-3f36a4849f1545d8.rlib" "/tmp/cargo-installJlrhXh/release/deps/libvec_map-9c252890059a866d.rlib" "/tmp/cargo-installJlrhXh/release/deps/libtextwrap-d6ca0e7161200f6a.rlib" "/tmp/cargo-installJlrhXh/release/deps/libunicode_width-b72199703ba264b4.rlib" "/tmp/cargo-installJlrhXh/release/deps/libstrsim-d9cf646f3a963a27.rlib" "/tmp/cargo-installJlrhXh/release/deps/libatty-56b7b5b0fc589437.rlib" "/tmp/cargo-installJlrhXh/release/deps/libansi_term-eec6258261c7a122.rlib" "/tmp/cargo-installJlrhXh/release/deps/libignore-a71bbbd9142b05bd.rlib" "/tmp/cargo-installJlrhXh/release/deps/libwalkdir-a4a6df542d335966.rlib" "/tmp/cargo-installJlrhXh/release/deps/libsame_file-7b7f7655017bd7b0.rlib" "/tmp/cargo-installJlrhXh/release/deps/libglobset-eb7f1fbaf9fce51b.rlib" "/tmp/cargo-installJlrhXh/release/deps/libregex-26b208ca90b46e27.rlib" "/tmp/cargo-installJlrhXh/release/deps/libthread_local-0e43aa4642bab06e.rlib" "/tmp/cargo-installJlrhXh/release/deps/libregex_syntax-a64aeef778f68b17.rlib" "/tmp/cargo-installJlrhXh/release/deps/libfnv-47e7fa303c27fcd0.rlib" "/tmp/cargo-installJlrhXh/release/deps/libbstr-162345631364e459.rlib" "/tmp/cargo-installJlrhXh/release/deps/libaho_corasick-118d8944ceaaaea2.rlib" "/tmp/cargo-installJlrhXh/release/deps/libmemchr-446044cc20eec784.rlib" "/tmp/cargo-installJlrhXh/release/deps/libcrates_io-1f8a19b7d98af40d.rlib" "/tmp/cargo-installJlrhXh/release/deps/librustfix-4969e68bfdc6ada2.rlib" "/tmp/cargo-installJlrhXh/release/deps/libserde_json-886b6b382248ec5b.rlib" "/tmp/cargo-installJlrhXh/release/deps/libryu-0ce1a54a4a2f4496.rlib" "/tmp/cargo-installJlrhXh/release/deps/libitoa-3845f42908e2d57d.rlib" "/tmp/cargo-installJlrhXh/release/deps/libtar-72bda84d2f9d60b3.rlib" "/tmp/cargo-installJlrhXh/release/deps/libflate2-21df2df80e272602.rlib" "/tmp/cargo-installJlrhXh/release/deps/libcrc32fast-713a53fd85ece4af.rlib" "/tmp/cargo-installJlrhXh/release/deps/libgit2-ac1d7c0bcdb097dd.rlib" "/tmp/cargo-installJlrhXh/release/deps/libopenssl_probe-6060252f9d2ab544.rlib" "/tmp/cargo-installJlrhXh/release/deps/liblibgit2_sys-7a368d2a53589104.rlib" "/tmp/cargo-installJlrhXh/release/deps/liblibssh2_sys-b63aa527293ffb5e.rlib" "/tmp/cargo-installJlrhXh/release/deps/liblibz_sys-3cbd50681ddc35fc.rlib" "/tmp/cargo-installJlrhXh/release/deps/libbitflags-3481844fb16a27e3.rlib" "/tmp/cargo-installJlrhXh/release/deps/libtempfile-c88ed794bea65fb8.rlib" "/tmp/cargo-installJlrhXh/release/deps/librand-306b02ba05716fab.rlib" "/tmp/cargo-installJlrhXh/release/deps/librand_chacha-20936efc05fdcf58.rlib" "/tmp/cargo-installJlrhXh/release/deps/libppv_lite86-2b5b5b6e438ae06d.rlib" "/tmp/cargo-installJlrhXh/release/deps/librand_core-fae5a7de1f05876c.rlib" "/tmp/cargo-installJlrhXh/release/deps/libgetrandom-379b55f4bcba82a9.rlib" "/tmp/cargo-installJlrhXh/release/deps/libremove_dir_all-265754eac9db3c5f.rlib" "/tmp/cargo-installJlrhXh/release/deps/libglob-02ff78eb7fcfed36.rlib" "/tmp/cargo-installJlrhXh/release/deps/libtermcolor-8b875c960548daec.rlib" "/tmp/cargo-installJlrhXh/release/deps/libcurl-edcf9252205263b3.rlib" "/tmp/cargo-installJlrhXh/release/deps/libopenssl_sys-25de0af3bd09c6e2.rlib" "/tmp/cargo-installJlrhXh/release/deps/libsocket2-f3dae21f7a869d97.rlib" "/tmp/cargo-installJlrhXh/release/deps/libcurl_sys-ba794b725aba7076.rlib" "/tmp/cargo-installJlrhXh/release/deps/libbytesize-065391c583124529.rlib" "/tmp/cargo-installJlrhXh/release/deps/liburl-d059e2bc568f5cc7.rlib" "/tmp/cargo-installJlrhXh/release/deps/libpercent_encoding-bfd9f3d20760f93a.rlib" "/tmp/cargo-installJlrhXh/release/deps/libidna-d68e9a57c422e9d7.rlib" "/tmp/cargo-installJlrhXh/release/deps/libunicode_normalization-ddbc5e3edd10896b.rlib" "/tmp/cargo-installJlrhXh/release/deps/libtinyvec-955847b5f37639b2.rlib" "/tmp/cargo-installJlrhXh/release/deps/libunicode_bidi-f70b1d5bae5305dd.rlib" "/tmp/cargo-installJlrhXh/release/deps/libmatches-00a9da1690089f34.rlib" "/tmp/cargo-installJlrhXh/release/deps/libcrossbeam_utils-490be52ff7a8bc43.rlib" "/tmp/cargo-installJlrhXh/release/deps/liblazy_static-53201e5af8cd3135.rlib" "/tmp/cargo-installJlrhXh/release/deps/liblazycell-90f274e3320ca1f1.rlib" "/tmp/cargo-installJlrhXh/release/deps/libjobserver-49da11ed1cb22a1c.rlib" "/tmp/cargo-installJlrhXh/release/deps/libfiletime-ebf7055f8bcc7d77.rlib" "/tmp/cargo-installJlrhXh/release/deps/liblibc-53f383edf340e4c8.rlib" "/tmp/cargo-installJlrhXh/release/deps/libsemver-0ff6f0d850b1b763.rlib" "/tmp/cargo-installJlrhXh/release/deps/libsemver_parser-73563d397a1dfb24.rlib" "/tmp/cargo-installJlrhXh/release/deps/libcargo_platform-0393f88083d8a8f5.rlib" "/tmp/cargo-installJlrhXh/release/deps/libserde-7e2cd3ba2610b189.rlib" "/tmp/cargo-installJlrhXh/release/deps/liblog-e2193921fa6fc243.rlib" "/tmp/cargo-installJlrhXh/release/deps/libcfg_if-0550b692bf420f09.rlib" "/tmp/cargo-installJlrhXh/release/deps/libanyhow-72ef736a84ae5634.rlib" "-Wl,--start-group" "/home/linusb/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-faa3fd6c69b73b7d.rlib" "/home/linusb/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-a9e48811766e19b7.rlib" "/home/linusb/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libminiz_oxide-dec35b3159638863.rlib" "/home/linusb/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libadler-54ba75ba19df3515.rlib" "/home/linusb/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libobject-b4e081b17e50a5f3.rlib" "/home/linusb/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libaddr2line-e696cf3aebf90283.rlib" "/home/linusb/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libgimli-c9508c34f45c1407.rlib" "/home/linusb/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-fe83234631186fa0.rlib" "/home/linusb/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libhashbrown-ce3ade83fc902949.rlib" "/home/linusb/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_alloc-2c834b52f045959b.rlib" "/home/linusb/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-c2f088360802c114.rlib" "/home/linusb/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcfg_if-4a28d8f1751385f2.rlib" "/home/linusb/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-ca9410ae33b10c13.rlib" "/home/linusb/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-d74f3c28111d31b0.rlib" "/home/linusb/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-c52e5d6301e1bd59.rlib" "/home/linusb/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-2675a9a46b5cec89.rlib" "-Wl,--end-group" "/home/linusb/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-f6fccc8824a0c5ae.rlib" "-Wl,-Bdynamic" "-lgit2" "-lz" "-lssl" "-lcrypto" "-lcurl" "-ldl" "-lrt" "-lpthread" "-lgcc_s" "-lc" "-lm" "-lrt" "-lpthread" "-lutil" "-ldl" "-lutil"
  = note: /usr/bin/ld: /tmp/cargo-installJlrhXh/release/deps/libopenssl-87fe2bf9690c6b2e.rlib(openssl-87fe2bf9690c6b2e.openssl.6wre5yi0-cgu.2.rcgu.o): in function `core::ptr::drop_in_place':
          openssl.6wre5yi0-cgu.2:(.text._ZN4core3ptr13drop_in_place17h4dd8e6ab0185ae5cE+0xb2): undefined reference to `EVP_MD_CTX_destroy'
          /usr/bin/ld: /tmp/cargo-installJlrhXh/release/deps/libopenssl-87fe2bf9690c6b2e.rlib(openssl-87fe2bf9690c6b2e.openssl.6wre5yi0-cgu.2.rcgu.o): in function `openssl::hash::Hasher::new':
          openssl.6wre5yi0-cgu.2:(.text._ZN7openssl4hash6Hasher3new17h128f04ef0fa3b360E+0x17): undefined reference to `EVP_MD_CTX_create'
          /usr/bin/ld: openssl.6wre5yi0-cgu.2:(.text._ZN7openssl4hash6Hasher3new17h128f04ef0fa3b360E+0xc7): undefined reference to `EVP_MD_CTX_destroy'
          /usr/bin/ld: /tmp/cargo-installJlrhXh/release/deps/libopenssl-87fe2bf9690c6b2e.rlib(openssl-87fe2bf9690c6b2e.openssl.6wre5yi0-cgu.2.rcgu.o): in function `<openssl::hash::Hasher as core::ops::drop::Drop>::drop':
          openssl.6wre5yi0-cgu.2:(.text._ZN63_$LT$openssl..hash..Hasher$u20$as$u20$core..ops..drop..Drop$GT$4drop17ha984604a97a1807fE+0xb2): undefined reference to `EVP_MD_CTX_destroy'
          /usr/bin/ld: /tmp/cargo-installJlrhXh/release/deps/liblibssh2_sys-b63aa527293ffb5e.rlib(openssl.o): in function `_libssh2_cipher_init':
          openssl.c:(.text._libssh2_cipher_init+0x18): undefined reference to `EVP_CIPHER_CTX_init'
          /usr/bin/ld: /tmp/cargo-installJlrhXh/release/deps/liblibssh2_sys-b63aa527293ffb5e.rlib(openssl.o): in function `_libssh2_openssl_crypto_init':
          openssl.c:(.text._libssh2_openssl_crypto_init+0x5): undefined reference to `OPENSSL_add_all_algorithms_noconf'
          /usr/bin/ld: openssl.c:(.text._libssh2_openssl_crypto_init+0xa): undefined reference to `OpenSSL_add_all_ciphers'
          /usr/bin/ld: openssl.c:(.text._libssh2_openssl_crypto_init+0xf): undefined reference to `OpenSSL_add_all_digests'
          /usr/bin/ld: /tmp/cargo-installJlrhXh/release/deps/liblibssh2_sys-b63aa527293ffb5e.rlib(crypt.o): in function `crypt_dtor':
          crypt.c:(.text.crypt_dtor+0x1e): undefined reference to `EVP_CIPHER_CTX_cleanup'
          /usr/bin/ld: /tmp/cargo-installJlrhXh/release/deps/libopenssl_sys-25de0af3bd09c6e2.rlib(openssl_sys-25de0af3bd09c6e2.openssl_sys.b3gyrhw5-cgu.8.rcgu.o): in function `_ZN3std4sync4once4Once9call_once28_$u7b$$u7b$closure$u7d$$u7d$17hb1c55aede3dc2b46E.llvm.14332668503325837102':
          openssl_sys.b3gyrhw5-cgu.8:(.text._ZN3std4sync4once4Once9call_once28_$u7b$$u7b$closure$u7d$$u7d$17hb1c55aede3dc2b46E.llvm.14332668503325837102+0x1b): undefined reference to `SSL_library_init'
          /usr/bin/ld: openssl_sys.b3gyrhw5-cgu.8:(.text._ZN3std4sync4once4Once9call_once28_$u7b$$u7b$closure$u7d$$u7d$17hb1c55aede3dc2b46E.llvm.14332668503325837102+0x21): undefined reference to `SSL_load_error_strings'
          /usr/bin/ld: openssl_sys.b3gyrhw5-cgu.8:(.text._ZN3std4sync4once4Once9call_once28_$u7b$$u7b$closure$u7d$$u7d$17hb1c55aede3dc2b46E.llvm.14332668503325837102+0x27): undefined reference to `OPENSSL_add_all_algorithms_noconf'
          /usr/bin/ld: openssl_sys.b3gyrhw5-cgu.8:(.text._ZN3std4sync4once4Once9call_once28_$u7b$$u7b$closure$u7d$$u7d$17hb1c55aede3dc2b46E.llvm.14332668503325837102+0x2d): undefined reference to `CRYPTO_num_locks'
          /usr/bin/ld: openssl_sys.b3gyrhw5-cgu.8:(.text._ZN3std4sync4once4Once9call_once28_$u7b$$u7b$closure$u7d$$u7d$17hb1c55aede3dc2b46E.llvm.14332668503325837102+0x1aa): undefined reference to `CRYPTO_set_locking_callback'
          /usr/bin/ld: openssl_sys.b3gyrhw5-cgu.8:(.text._ZN3std4sync4once4Once9call_once28_$u7b$$u7b$closure$u7d$$u7d$17hb1c55aede3dc2b46E.llvm.14332668503325837102+0x1c1): undefined reference to `CRYPTO_set_id_callback'
          collect2: error: ld returned 1 exit status


error: aborting due to previous error

error: failed to compile `cargo-udeps v0.1.15`, intermediate artifacts can be found at `/tmp/cargo-installJlrhXh`

Caused by:
  could not compile `cargo-udeps`.

To learn more, run the command again with --verbose.

Rustc panics when running on a workspace

I am not really sure what is causing this so I'm going to provide as much detail as I can. I'm using cargo-udeps in a workspace with ~15 crates on 1.44 nightly. The workspace contains 3 proc macro crates. All three of those proc macro crates fail to compile in cargo-udeps, but not with a regular cargo build, with this error:

error: internal compiler error: cannot lex `source_file` without source: /home/alex/.cargo/registry/src/github.com-1ecc6299db9ec823/quote-1.0.3/src/lib.rs

thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:880:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.44.0-nightly (f509b26a7 2020-03-18) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z save-analysis -C prefer-dynamic -C debuginfo=2 -C incremental --crate-type proc-macro

note: some of the compiler flags provided by cargo are hidden

error: aborting due to previous error


So, it seems that perhaps the quote dependency inside of the proc macros in the workspace is triggering it?

Anyway, if I can provide any more detail, please let me know. This tool is great and I am torn by temporarily not being able to use it. 😄

Canno open shared object file: libgit2.so.1.0

I fixed the below error by doing sudo ln -s /usr/lib/libgit2.so.1.1 /usr/lib/libgit2.so.1.0

❯ cargo +nightly udeps
/home/xxx/.cargo/bin/cargo-udeps: error while loading shared libraries: libgit2.so.1.0: cannot open shared object file: N
o such file or directory

error message accidentally debug printed?

When checking clippy:

Error: StrErr("current implementation cannot handle multiple crates with the same `lib` name:\n`clippy v0.0.212 (/home/matthias/vcs/github/rust-clippy)`\n├── \"rustc_tools_util\" → \"rustc_tools_util\"\n├── \"rustc_tools_util\" → \"rustc_tools_util\"\n└── ..")

Is this some accidental debug print which should be a normal print?

False positive in tokio

On tokio-rs/tokio#1656 with the -Z minimum-versions and commenting out the build-tests crate, I get this false positive report:

unused dependencies:
`tokio-net v0.2.0-alpha.6 (/home/boeckb/code/depot/lang-rust/proj-tokio/tokio/src/tokio-net)`
└─── (dev-)dependencies
     └─── "tokio-net"

Or at least it appears to be a false positive since there's no tokio-net dependency in…itself (not even an older version).

Attaching the save-analysis directory generated from the run.

cargo-udeps-tokio-false-positive.tar.gz

Number of own pulled in dependencies

The goal of the project is very laudable but I have the feeling it's falling a bit short by having one of the longest depedencies sets of all projects I've worked with (including really big ones) with 172 crates...

can't find crates

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.

json output: `unused_deps` may be non-empty even if all dependencies are used

{"success":true,"unused_deps":{"some crate":{"manifest_path":"/some/location","normal":[],"development":[],"build":[]}},"note":null}

is what I see when I build a workspace with many crates. The unused_deps map gets populated with further crates if and when they contain unused crates.

I think it might be because the some_crate is the only crate that has cargo-udeps.ignore specified in it.

Less verbose output

Right now the output is reminiscent of cargo check --verbose. It would be prefferable if the output would be more like cargo check. I'm not sure how to get the cargo library to output at that verbosity.

Panic when used with complex dependency graph

To reproduce, check out noria (specifically mit-pdos/noria@fb1da75) and run cargo udeps in the root:

cargo udeps
    Blocking waiting for file lock on build directory
    Checking nix v0.16.1
    Checking noria v0.3.0 (/home/jon/dev/projects/noria/noria)
    Checking trawler-mysql v0.3.0 (/home/jon/dev/projects/noria/noria-benchmarks/lobsters)
thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', src/librustc_typeck/check/mod.rs:840:14
stack backtrace:
   0: backtrace::backtrace::libunwind::trace
             at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.40/src/backtrace/libunwind.rs:88
   1: backtrace::backtrace::trace_unsynchronized
             at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.40/src/backtrace/mod.rs:66
   2: std::sys_common::backtrace::_print_fmt
             at src/libstd/sys_common/backtrace.rs:77
   3: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
             at src/libstd/sys_common/backtrace.rs:59
   4: core::fmt::write
             at src/libcore/fmt/mod.rs:1052
   5: std::io::Write::write_fmt
             at src/libstd/io/mod.rs:1426
   6: std::sys_common::backtrace::_print
             at src/libstd/sys_common/backtrace.rs:62
   7: std::sys_common::backtrace::print
             at src/libstd/sys_common/backtrace.rs:49
   8: std::panicking::default_hook::{{closure}}
             at src/libstd/panicking.rs:204
   9: std::panicking::default_hook
             at src/libstd/panicking.rs:224
  10: rustc_driver::report_ice
  11: <alloc::boxed::Box<F> as core::ops::function::Fn<A>>::call
             at /rustc/698fcd38fa9548e64a2092ff48c9d15ceb57d40c/src/liballoc/boxed.rs:1029
  12: proc_macro::bridge::client::<impl proc_macro::bridge::Bridge>::enter::{{closure}}::{{closure}}
             at /rustc/698fcd38fa9548e64a2092ff48c9d15ceb57d40c/src/libproc_macro/bridge/client.rs:305
  13: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:476
  14: rust_begin_unwind
             at src/libstd/panicking.rs:380
  15: core::panicking::panic_fmt
             at src/libcore/panicking.rs:85
  16: core::panicking::panic
             at src/libcore/panicking.rs:52
  17: rustc_typeck::check::has_typeck_tables
  18: rustc::ty::query::__query_compute::has_typeck_tables
  19: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors for rustc::ty::query::queries::has_typeck_tables>::compute
  20: rustc::dep_graph::graph::DepGraph::with_task_impl
  21: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::get_query
  22: <rustc_save_analysis::dump_visitor::DumpVisitor as syntax::visit::Visitor>::visit_ty
  23: <rustc_save_analysis::dump_visitor::DumpVisitor as syntax::visit::Visitor>::visit_item
  24: <rustc_save_analysis::dump_visitor::DumpVisitor as syntax::visit::Visitor>::visit_item
  25: <rustc_save_analysis::dump_visitor::DumpVisitor as syntax::visit::Visitor>::visit_mod
  26: rustc::dep_graph::graph::DepGraph::with_ignore
  27: rustc::ty::context::tls::enter_global
  28: rustc_interface::interface::run_compiler_in_existing_thread_pool
  29: scoped_tls::ScopedKey<T>::set
  30: syntax::with_globals
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.42.0-nightly (698fcd38f 2020-01-26) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z save-analysis -C debuginfo=2 -C incremental -C target-cpu=native --crate-type lib

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
#0 [has_typeck_tables] processing `<controller::Controller<A> as tower_service::Service<controller::ControllerRequest>>::Future::{{opaque}}#0`
end of query stack
error: could not compile `noria`.

Note that this also happens if you run it in a particular sub-crate's root (like noria/).

use nightly on install also?

Could be just me (:

but i had to use nightly on my install also.

This fails to build

cargo install cargo-udeps --locked

No issues

cargo +nightly install cargo-udeps --locked

Segmentation fault when running on nightly-x86_64-unknown-linux-musl

My environment:

+ rustup --version
rustup 1.23.1 (2020-11-30)
...
cargo 1.50.0 (f04e7fab7 2021-02-04)

The output from the command when running in a workspace with ~15 crates:

$ rustup show
Default host: x86_64-unknown-linux-musl
rustup home:  /usr/local/rustup
installed toolchains
--------------------
nightly-x86_64-unknown-linux-musl
1.50.0-x86_64-unknown-linux-musl (default)
active toolchain
----------------
1.50.0-x86_64-unknown-linux-musl (default)
rustc 1.50.0 (cb75ad5db 2021-02-10)

$ cargo +nightly udeps --release --all-targets
/bin/bash: line 147:    26 Segmentation fault      (core dumped) cargo +nightly udeps --release --all-targets

Any advice on how to resolve this issue? Thanks.

Add option to fail silently

It would be great to add an option to make udeps finish with exit code 0 if there is an unused dependency.

Let me know if you think that you would accept this feature and I could try to give it a shoot.

False positive when `-` in crate name

We use iso639-1 in our tool.
But this is flagged as unused. This is most likely because of the - in the crate name.
The actual use is iso639_1::something()

So the - is replaced with a _ in the code.
If this is a common problem maybe there can a special case for all the crates that have a - in there name.

For now I just added it to the ignore list:

[package.metadata.cargo-udeps.ignore]
normal = ["iso639-1"]

cargo-udeps.toml

Like this.

[ignore.foo]
normal_dev = []
build = ["cargo-lipo"]

doctest dependencies don't seem to be taken into account

I believe this is the case. In particular I have a crate with a doctest that uses serde_json:

/// ```
/// use serde_json;
/// ... (use serde_json here)

and cargo udeps reports the crate as not being used:

my_crate v0.1.0 (/path/to/my_crate)`
└─── (dev-)dependencies
     └─── "serde_json"

However cargo test (correctly) fails if I remove the crate.

(note: I'm running cargo udeps --all-targets).

Show unused dependencies that gets used transitively by other dependecies

Currently, cargo +nightly udeps shows All deps seem to have been used. for below:

[dependencies]
chrono = "0.4"
time = "0.1"
fn main() {
    println!("{:?}", chrono::Local::now());
}

I expect it to show time dependency as unused since we can remove it from Cargo.toml. I am not sure whether this should be a bug issue or a feature request though.

Very useful tool by the way!

How to launch cargo-udeps?

Hello,

When I run the installed version of cargo-udeps (from archlinux package) it fails:

~/sources/cargo-udeps ((v0.1.16))$ cargo +nightly udeps
Error: StrErr("failed to parse lock file at: /home/sanpi/sources/cargo-udeps/Cargo.lock")

But it works when I run the same version from sources:

~/sources/cargo-udeps ((v0.1.16))$ cargo +nightly run --locked --release -- udeps
    Finished release [optimized] target(s) in 0.06s
     Running `target/release/cargo-udeps udeps`
    Checking cargo-udeps v0.1.16 (/home/sanpi/sources/cargo-udeps)
    Finished dev [unoptimized] target(s) in 0.52s
info: Loading save analysis from "/home/sanpi/sources/cargo-udeps/target/debug/deps/save-analysis/libcargo_udeps-1d37ace45aeb7ff4.json"
info: Loading save analysis from "/home/sanpi/sources/cargo-udeps/target/debug/deps/save-analysis/cargo_udeps-cc9723783a4a9ea9.json"
All deps seem to have been used.
$ cargo --version
cargo 1.49.0 (d00d64df9 2020-12-05)

What did I miss?

Machine readable output

I am thinking of writing a GitHub action that runs cargo-udeps against a repository and opens a PR that removes the unused dependencies.

To achieve this, it would be nice if the command would have a flag to produce machine-readable output (JSON?).

Why must this crate compile with nightly?

I find it strange that a crate can be installed with stable, but must use nightly to run.

Trying to compile with stable gives the following error

the option Z is only accepted on the nightly compiler

Has the source of this error been tracked down? I do not see anything in this repository explicitly so it must be in one of the dependencies.

distinguish between normal dependency and dev-dependency

I use libc in unit test and doc example, but not use in codes. When I let libc under [dependencies], udeps doesn't realize it is unnecessary.

Could you make udeps distinguish dependency between normal dependency and dev-dependency so we can write [dependencies] more precisely.

CargoMetadata doesn't work when udeps is building code

I am trying to run udeps on a workspace with many crates, and I see this error below:

The build.rs file line 2 where the stack trace points to doesn't have anything. I think it's probably a function call injected into the build script by cargo that's looking for project metadata?

I can't --exclude this crate because it's a common dependency across other crates in the workspace.

Any thoughts on what could be the issue?

error: failed to run custom build command for `proto-helpers v0.1.0 (proto-helpers)`

Caused by:
  process didn't exit successfully: `/Users/jvimal/.cargo/target/debug/build/proto-helpers-785ed3443d96513f/build-script-build` (exit code: 101)
  --- stdout
  cargo:rerun-if-changed=Cargo.toml
  cargo:rerun-if-changed=../Cargo.lock
  cargo:rerun-if-changed=build.rs
  cargo:rerun-if-changed=src/lib.rs

  --- stderr
  thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: CargoMetadata { stderr: "error: Found argument 'metadata' which wasn't expected, or isn't valid in this context\n\nUSAGE:\n    cargo <SUBCOMMAND>\n\nFor more information try --help\n" }', /Users/jvimal/.cargo/registry/src/github.com-1ecc6299db9ec823/build-info-build-0.0.23/src/build_script_options/crate_info.rs:37:10
  stack backtrace:
     0: rust_begin_unwind
               at /rustc/40d23020470db06903589e210c83a4936f22d52a/library/std/src/panicking.rs:515:5
     1: core::panicking::panic_fmt
               at /rustc/40d23020470db06903589e210c83a4936f22d52a/library/core/src/panicking.rs:92:14
     2: core::result::unwrap_failed
               at /rustc/40d23020470db06903589e210c83a4936f22d52a/library/core/src/result.rs:1355:5
     3: core::result::Result<T,E>::unwrap
               at /rustc/40d23020470db06903589e210c83a4936f22d52a/library/core/src/result.rs:1037:23
     4: build_info_build::build_script_options::crate_info::read_manifest
               at /Users/jvimal/.cargo/registry/src/github.com-1ecc6299db9ec823/build-info-build-0.0.23/src/build_script_options/crate_info.rs:31:13
     5: build_info_build::build_script_options::BuildScriptOptions::drop_to_build_info
               at /Users/jvimal/.cargo/registry/src/github.com-1ecc6299db9ec823/build-info-build-0.0.23/src/build_script_options/mod.rs:49:20
     6: <build_info_build::build_script_options::BuildScriptOptions as core::ops::drop::Drop>::drop
               at /Users/jvimal/.cargo/registry/src/github.com-1ecc6299db9ec823/build-info-build-0.0.23/src/build_script_options/mod.rs:106:22
     7: core::ptr::drop_in_place<build_info_build::build_script_options::BuildScriptOptions>
               at /rustc/40d23020470db06903589e210c83a4936f22d52a/library/core/src/ptr/mod.rs:192:1
     8: build_script_build::main
               at ./build.rs:2:37
     9: core::ops::function::FnOnce::call_once
               at /rustc/40d23020470db06903589e210c83a4936f22d52a/library/core/src/ops/function.rs:227:5
  note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
warning: build failed, waiting for other jobs to finish...
error: build failed

Running multiple times

If I have a project with an unused dependency, the first run reports:

unused crates: [...]

But running cargo +nightly udeps again reports:

All deps seem to have been used.

Is there a way to cache the results or something, so they can be reported again from subsequent runs?

Lockfile v2

When I tried switch my project to Cargo.lock v2, I got error:
Error: StrErr("failed to parse lock file at: /home/runner/work/jjs/jjs/Cargo.lock")

proc-macro crates support

When I run cargo +nightly udeps at https://github.com/nervosnetwork/ckb/tree/510c035326e5f01d6d6917243364e51a0a74f3cc, it failed.

     Running `rustc --crate-name rand /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.5.6/src/lib.rs --color always --crate-type lib --emit=dep-info,metadata -C debuginfo=2 --cfg 'feature="alloc"' --cfg 'feature="cloudabi"' --cfg 'feature="default"' --cfg 'feature="fuchsia-cprng"' --cfg 'feature="libc"' --cfg 'feature="std"' --cfg 'feature="winapi"' -C metadata=4b751c13fedfbc11 -C extra-filename=-4b751c13fedfbc11 --out-dir /home/u2/nervos/ckb/target/debug/deps -L dependency=/home/u2/nervos/ckb/target/debug/deps --extern libc=/home/u2/nervos/ckb/target/debug/deps/liblibc-59f8650e32f6ca19.rmeta --extern rand_core=/home/u2/nervos/ckb/target/debug/deps/librand_core-d11db9b2a88250dd.rmeta --cap-lints allow`
     Running `rustc --edition=2018 --crate-name getrandom /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/getrandom-0.1.6/src/lib.rs --color always --crate-type lib --emit=dep-info,metadata -C debuginfo=2 --cfg 'feature="std"' -C metadata=ac566010c4ddda1e -C extra-filename=-ac566010c4ddda1e --out-dir /home/u2/nervos/ckb/target/debug/deps -L dependency=/home/u2/nervos/ckb/target/debug/deps --extern lazy_static=/home/u2/nervos/ckb/target/debug/deps/liblazy_static-5fefc83a5e3bdd86.rmeta --extern libc=/home/u2/nervos/ckb/target/debug/deps/liblibc-59f8650e32f6ca19.rmeta --cap-lints allow`
error[E0658]: imports can only refer to extern crate names passed with `--extern` on stable channel (see issue #53130)
  --> /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/getrandom-0.1.6/src/error_impls.rs:13:5
   |
8  | extern crate std;
   | ----------------- not an extern crate passed with `--extern`
...
13 | use std::{error, io};
   |     ^^^
   |
   = help: add #![feature(uniform_paths)] to the crate attributes to enable
note: this import refers to the extern crate imported here
  --> /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/getrandom-0.1.6/src/error_impls.rs:8:1
   |
8  | extern crate std;
   | ^^^^^^^^^^^^^^^^^

error[E0658]: imports can only refer to extern crate names passed with `--extern` on stable channel (see issue #53130)
  --> /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/getrandom-0.1.6/src/use_file.rs:15:5
   |
10 | extern crate std;
   | ----------------- not an extern crate passed with `--extern`
...
15 | use std::{fs::File, io::Read};
   |     ^^^
   |
   = help: add #![feature(uniform_paths)] to the crate attributes to enable
note: this import refers to the extern crate imported here
  --> /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/getrandom-0.1.6/src/use_file.rs:10:1
   |
10 | extern crate std;
   | ^^^^^^^^^^^^^^^^^

error[E0658]: imports can only refer to extern crate names passed with `--extern` on stable channel (see issue #53130)
  --> /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/getrandom-0.1.6/src/linux_android.rs:15:5
   |
10 | extern crate std;
   | ----------------- not an extern crate passed with `--extern`
...
15 | use std::io;
   |     ^^^
   |
   = help: add #![feature(uniform_paths)] to the crate attributes to enable
note: this import refers to the extern crate imported here
  --> /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/getrandom-0.1.6/src/linux_android.rs:10:1
   |
10 | extern crate std;
   | ^^^^^^^^^^^^^^^^^

     Running `rustc --crate-name atty /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/atty-0.2.11/src/lib.rs --color always --crate-type lib --emit=dep-info,metadata -C debuginfo=2 -C metadata=044a29f0b0861155 -C extra-filename=-044a29f0b0861155 --out-dir /home/u2/nervos/ckb/target/debug/deps -L dependency=/home/u2/nervos/ckb/target/debug/deps --extern libc=/home/u2/nervos/ckb/target/debug/deps/liblibc-59f8650e32f6ca19.rmeta --cap-lints allow`
    Checking hostname v0.1.5
     Running `rustc --crate-name hostname /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/hostname-0.1.5/src/lib.rs --color always --crate-type lib --emit=dep-info,metadata -C debuginfo=2 -C metadata=ef5d06ce2c0f483b -C extra-filename=-ef5d06ce2c0f483b --out-dir /home/u2/nervos/ckb/target/debug/deps -L dependency=/home/u2/nervos/ckb/target/debug/deps --extern libc=/home/u2/nervos/ckb/target/debug/deps/liblibc-59f8650e32f6ca19.rmeta --cap-lints allow`
    Checking uname v0.1.1
     Running `rustc --crate-name uname /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/uname-0.1.1/src/lib.rs --color always --crate-type lib --emit=dep-info,metadata -C debuginfo=2 -C metadata=b20ad82947337033 -C extra-filename=-b20ad82947337033 --out-dir /home/u2/nervos/ckb/target/debug/deps -L dependency=/home/u2/nervos/ckb/target/debug/deps --extern libc=/home/u2/nervos/ckb/target/debug/deps/liblibc-59f8650e32f6ca19.rmeta --cap-lints allow`
    Checking memmap v0.7.0
     Running `rustc --crate-name memmap /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/memmap-0.7.0/src/lib.rs --color always --crate-type lib --emit=dep-info,metadata -C debuginfo=2 -C metadata=bd2ff151b28dd074 -C extra-filename=-bd2ff151b28dd074 --out-dir /home/u2/nervos/ckb/target/debug/deps -L dependency=/home/u2/nervos/ckb/target/debug/deps --extern libc=/home/u2/nervos/ckb/target/debug/deps/liblibc-59f8650e32f6ca19.rmeta --cap-lints allow`
error: aborting due to 3 previous errors

For more information about this error, try `rustc --explain E0658`.
    Checking rand v0.4.6
error: Could not compile `getrandom`.

Caused by:
  process didn't exit successfully: `rustc --edition=2018 --crate-name getrandom /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/getrandom-0.1.6/src/lib.rs --color always --crate-type lib --emit=dep-info,metadata -C debuginfo=2 --cfg 'feature="std"' -C metadata=ac566010c4ddda1e -C extra-filename=-ac566010c4ddda1e --out-dir /home/u2/nervos/ckb/target/debug/deps -L dependency=/home/u2/nervos/ckb/target/debug/deps --extern lazy_static=/home/u2/nervos/ckb/target/debug/deps/liblazy_static-5fefc83a5e3bdd86.rmeta --extern libc=/home/u2/nervos/ckb/target/debug/deps/liblibc-59f8650e32f6ca19.rmeta --cap-lints allow` (exit code: 1)
warning: build failed, waiting for other jobs to finish...
     Running `rustc --crate-name rand /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.4.6/src/lib.rs --color always --crate-type lib --emit=dep-info,metadata -C debuginfo=2 --cfg 'feature="default"' --cfg 'feature="libc"' --cfg 'feature="std"' -C metadata=1e673425e5078c64 -C extra-filename=-1e673425e5078c64 --out-dir /home/u2/nervos/ckb/target/debug/deps -L dependency=/home/u2/nervos/ckb/target/debug/deps --extern libc=/home/u2/nervos/ckb/target/debug/deps/liblibc-59f8650e32f6ca19.rmeta --cap-lints allow`
Error: StrErr("build failed")

Tests are failing in a clean chroot

Hey,
I'm trying to build cargo-udeps in a clean chroot. I will package it for the Arch Linux community repository afterwards.

Unfortunately I'm getting the following error(s) while running the tests:

[root@orhun cargo-udeps-0.1.17]# cargo test --no-fail-fast
    Finished test [unoptimized] target(s) in 0.29s
     Running target/debug/deps/cargo_udeps-0e5cb73693edb719

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

     Running target/debug/deps/cargo_udeps-55a0336dd6431257

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

     Running target/debug/deps/ignore-6df070b5d2e170ba

running 2 tests
test ignore_all ... FAILED
test ignore_if_chain ... FAILED

failures:

---- ignore_all stdout ----
Error: No such file or directory (os error 2)
thread 'ignore_all' panicked at 'assertion failed: `(left == right)`
  left: `1`,
 right: `0`: the test returned a termination value with a non-zero status code (1) which indicates a failure', /build/rust/src/rustc-1.49.0-src/library/test/src/lib.rs:193:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

---- ignore_if_chain stdout ----
Error: build failed
thread 'ignore_if_chain' panicked at 'assertion failed: `(left == right)`
  left: `1`,
 right: `0`: the test returned a termination value with a non-zero status code (1) which indicates a failure', /build/rust/src/rustc-1.49.0-src/library/test/src/lib.rs:193:5


failures:
    ignore_all
    ignore_if_chain

test result: FAILED. 0 passed; 2 failed; 0 ignored; 0 measured; 0 filtered out

     Running target/debug/deps/non_lib_build_dep-137239edea01881b

running 2 tests
test with_all_targets ... FAILED
test without_all_targets ... FAILED

failures:

---- with_all_targets stdout ----
Error: No such file or directory (os error 2)
thread 'with_all_targets' panicked at 'assertion failed: `(left == right)`
  left: `1`,
 right: `0`: the test returned a termination value with a non-zero status code (1) which indicates a failure', /build/rust/src/rustc-1.49.0-src/library/test/src/lib.rs:193:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

---- without_all_targets stdout ----
Error: could not compile `non_lib_build_dep`

Caused by:
    process didn't exit successfully: `rustc --crate-name non_lib_build_dep src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata -C embed-bitcode=no -C debuginfo=2 -C metadata=3af69da90063ed9c -C extra-filename=-3af69da90063ed9c --out-dir /tmp/cargo_udeps_test_non_lib_build_dep_without_all_targetsQ7Dlqf/target/debug/deps -C incremental=/tmp/cargo_udeps_test_non_lib_build_dep_without_all_targetsQ7Dlqf/target/debug/incremental -L dependency=/tmp/cargo_udeps_test_non_lib_build_dep_without_all_targetsQ7Dlqf/target/debug/deps -Z binary-dep-depinfo -Z save-analysis` (exit code: 1)
thread 'without_all_targets' panicked at 'assertion failed: `(left == right)`
  left: `1`,
 right: `0`: the test returned a termination value with a non-zero status code (1) which indicates a failure', /build/rust/src/rustc-1.49.0-src/library/test/src/lib.rs:193:5


failures:
    with_all_targets
    without_all_targets

test result: FAILED. 0 passed; 2 failed; 0 ignored; 0 measured; 0 filtered out

     Running target/debug/deps/normal_dev_build-04fcb6cd2731c255

running 2 tests
test with_all_targets ... FAILED
test without_all_targets ... FAILED

failures:

---- with_all_targets stdout ----
Error: No such file or directory (os error 2)
thread 'with_all_targets' panicked at 'assertion failed: `(left == right)`
  left: `1`,
 right: `0`: the test returned a termination value with a non-zero status code (1) which indicates a failure', /build/rust/src/rustc-1.49.0-src/library/test/src/lib.rs:193:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

---- without_all_targets stdout ----
Error: build failed
thread 'without_all_targets' panicked at 'assertion failed: `(left == right)`
  left: `1`,
 right: `0`: the test returned a termination value with a non-zero status code (1) which indicates a failure', /build/rust/src/rustc-1.49.0-src/library/test/src/lib.rs:193:5


failures:
    with_all_targets
    without_all_targets

test result: FAILED. 0 passed; 2 failed; 0 ignored; 0 measured; 0 filtered out

     Running target/debug/deps/unused_byteorder-889aecdede1cfe24

running 2 tests
test with_all_targets ... FAILED
test without_all_targets ... FAILED

failures:

---- with_all_targets stdout ----
Error: No such file or directory (os error 2)
thread 'with_all_targets' panicked at 'assertion failed: `(left == right)`
  left: `1`,
 right: `0`: the test returned a termination value with a non-zero status code (1) which indicates a failure', /build/rust/src/rustc-1.49.0-src/library/test/src/lib.rs:193:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

---- without_all_targets stdout ----
Error: could not compile `byteorder`

Caused by:
    process didn't exit successfully: `rustc --crate-name byteorder --edition=2018 /root/.cargo/registry/src/github.com-1ecc6299db9ec823/byteorder-1.4.2/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata -C embed-bitcode=no -C debuginfo=2 --cfg 'feature="default"' --cfg 'feature="std"' -C metadata=e6cb78bee3e3a9e7 -C extra-filename=-e6cb78bee3e3a9e7 --out-dir /tmp/cargo_udeps_test_unused_byteorder_without_all_targetseDd9Kl/target/debug/deps -L dependency=/tmp/cargo_udeps_test_unused_byteorder_without_all_targetseDd9Kl/target/debug/deps --cap-lints allow -Z binary-dep-depinfo` (exit code: 1)
thread 'without_all_targets' panicked at 'assertion failed: `(left == right)`
  left: `1`,
 right: `0`: the test returned a termination value with a non-zero status code (1) which indicates a failure', /build/rust/src/rustc-1.49.0-src/library/test/src/lib.rs:193:5


failures:
    with_all_targets
    without_all_targets

test result: FAILED. 0 passed; 2 failed; 0 ignored; 0 measured; 0 filtered out

   Doc-tests cargo-udeps

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

error: test failed.

Error: No such file or directory (os error 2)

I suspect that it might be about the temp file being dropped early. (tempfile#115)

Any ideas about what might cause this?

Current implementation cannot handle multiple crates with the same `lib` name

When running cargo +nightly udeps against https://github.com/habitat-sh/habitat:

➤ cargo +nightly udeps
  Downloaded arc-swap v0.4.2
  Downloaded chrono v0.4.9
…
  Downloaded 34 crates (4.0 MB) in 8.13s (largest was `encoding_rs` at 1.4 MB)
Error: StrErr("current implementation cannot handle multiple crates with the same `lib` name:
`habitat_core v0.0.0 (/home/jbauman/habitat/components/core)`
├── "base64" → "base64"
├── "base64" → "base64"
└── ..")

I know

Crates are currently only handled on a per name basis. Two crates with the same name but different versions would be a problem.

is listed as a known bug in https://github.com/est31/cargo-udeps/blob/master/README.md#known-bugs, but I couldn't find an issue that's tracking it. Since the project I work on won't be able to make use of udeps until this is resolved, having an issue I can subscribe to will help ensure that I can use it when that bug is fixed.

panic and hang when using --all-targets

git clone https://github.com/oconnor663/shared_child.rs
cd shared_child.rs
cargo +nightly udeps --all-targets

In the build output of the last command, I see this panic:

thread '<unnamed>' panicked at 'called `Option::unwrap()` on a `None` value', src/libcore/option.rs:347:21

The build then hangs until I kill it with Ctrl-C.

This issue seems to repro in all the projects I've tried. Everything works fine if I don't use --all-targets though.

thread '<unnamed>' panicked at 'invalid format for extern arg: proc_macro'

Steps to replicate:

$ mkdir thiserror-example
$ cd thiserror-example
$ cargo init
$ echo 'thiserror = "1"' >> Cargo.toml
$ RUST_BACKTRACE=1 cargo udeps
   Compiling thiserror-impl v1.0.11
thread '<unnamed>' panicked at 'invalid format for extern arg: proc_macro', /home/joshua/.local/lib/cargo/registry/src/github.com-1ecc6299db9ec823/cargo-udeps-0.1.9/src/lib.rs:580:25
stack backtrace:
   0: backtrace::backtrace::libunwind::trace
             at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.40/src/backtrace/libunwind.rs:88
   1: backtrace::backtrace::trace_unsynchronized
             at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.40/src/backtrace/mod.rs:66
   2: std::sys_common::backtrace::_print_fmt
             at src/libstd/sys_common/backtrace.rs:77
   3: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
             at src/libstd/sys_common/backtrace.rs:59
   4: core::fmt::write
             at src/libcore/fmt/mod.rs:1052
   5: std::io::Write::write_fmt
             at src/libstd/io/mod.rs:1426
   6: std::sys_common::backtrace::_print
             at src/libstd/sys_common/backtrace.rs:62
   7: std::sys_common::backtrace::print
             at src/libstd/sys_common/backtrace.rs:49
   8: std::panicking::default_hook::{{closure}}
             at src/libstd/panicking.rs:204
   9: std::panicking::default_hook
             at src/libstd/panicking.rs:224
  10: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:472
  11: rust_begin_unwind
             at src/libstd/panicking.rs:380
  12: std::panicking::begin_panic_fmt
             at src/libstd/panicking.rs:334
  13: <cargo_udeps::Exec as cargo::core::compiler::Executor>::exec
  14: core::ops::function::FnOnce::call_once{{vtable.shim}}
  15: <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once
  16: core::ops::function::FnOnce::call_once{{vtable.shim}}
  17: <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once
  18: core::ops::function::FnOnce::call_once{{vtable.shim}}
  19: <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once
  20: crossbeam_utils::thread::ScopedThreadBuilder::spawn::{{closure}}
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
thread 'main' panicked at 'child threads shouldn't panic: Any', /home/joshua/.local/lib/cargo/registry/src/github.com-1ecc6299db9ec823/cargo-0.43.0/src/cargo/core/compiler/job_queue.rs:388:9
stack backtrace:
   0: backtrace::backtrace::libunwind::trace
             at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.40/src/backtrace/libunwind.rs:88
   1: backtrace::backtrace::trace_unsynchronized
             at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.40/src/backtrace/mod.rs:66
   2: std::sys_common::backtrace::_print_fmt
             at src/libstd/sys_common/backtrace.rs:77
   3: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
             at src/libstd/sys_common/backtrace.rs:59
   4: core::fmt::write
             at src/libcore/fmt/mod.rs:1052
   5: std::io::Write::write_fmt
             at src/libstd/io/mod.rs:1426
   6: std::sys_common::backtrace::_print
             at src/libstd/sys_common/backtrace.rs:62
   7: std::sys_common::backtrace::print
             at src/libstd/sys_common/backtrace.rs:49
   8: std::panicking::default_hook::{{closure}}
             at src/libstd/panicking.rs:204
   9: std::panicking::default_hook
             at src/libstd/panicking.rs:224
  10: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:472
  11: rust_begin_unwind
             at src/libstd/panicking.rs:380
  12: core::panicking::panic_fmt
             at src/libcore/panicking.rs:85
  13: core::option::expect_none_failed
             at src/libcore/option.rs:1199
  14: cargo::core::compiler::job_queue::JobQueue::execute
  15: cargo::core::compiler::context::Context::compile
  16: cargo::ops::cargo_compile::compile_ws
  17: cargo::ops::cargo_compile::compile_with_exec
  18: cargo_udeps::OptUdeps::run
  19: cargo_udeps::run
  20: cargo_udeps::main
  21: std::rt::lang_start::{{closure}}
  22: std::rt::lang_start_internal::{{closure}}
             at src/libstd/rt.rs:52
  23: std::panicking::try::do_call
             at src/libstd/panicking.rs:305
  24: __rust_maybe_catch_panic
             at src/libpanic_unwind/lib.rs:86
  25: std::panicking::try
             at src/libstd/panicking.rs:281
  26: std::panic::catch_unwind
             at src/libstd/panic.rs:394
  27: std::rt::lang_start_internal
             at src/libstd/rt.rs:51
  28: main
  29: __libc_start_main
  30: _start
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Build error on stable

Command:

cargo install cargo-udeps --force

fails with error:

error: unsupported expression; enable syn\'s features=[\"full\"]
   --> /home/mb/.cargo/registry/src/github.com-1ecc6299db9ec823/cargo-udeps-0.1.7/src/lib.rs:194:19
    |
194 |         possible_values(&["human", "json", "short"]),
    |                         ^

This also reproduces on CI: https://github.com/jjs-dev/jjs/pull/262/checks?check_run_id=476888019#step:3:398

Command to build syn looks like:

rustc --edition=2018 --crate-name syn /home/mb/.cargo/registry/src/github.com-1ecc6299db9ec823/syn-1.0.16/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 --cfg 'feature="clone-impls"' --cfg 'feature="default"' --cfg 'feature="derive"' --cfg 'feature="extra-traits"' --cfg 'feature="parsing"' --cfg 'feature="printing"' --cfg 'feature="proc-macro"' --cfg 'feature="quote"' --cfg 'feature="visit"' -C metadata=a6e633c5c00a1fe7 -C extra-filename=-a6e633c5c00a1fe7 --out-dir /tmp/cargo-installTSKC0Y/release/deps -L dependency=/tmp/cargo-installTSKC0Y/release/deps --extern proc_macro2=/tmp/cargo-installTSKC0Y/release/deps/libproc_macro2-a3069c7ac662c1f8.rmeta --extern quote=/tmp/cargo-installTSKC0Y/release/deps/libquote-a1723bc5a5d8fc45.rmeta --extern unicode_xid=/tmp/cargo-installTSKC0Y/release/deps/libunicode_xid-d0c8361b0afb9c55.rmeta --cap-lints allow --cfg syn_disable_nightly_tests

Command to build cargo-udeps looks like:

rustc --edition=2018 --crate-name cargo_udeps /home/mb/.cargo/registry/src/github.com-1ecc6299db9ec823/cargo-udeps-0.1.7/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C metadata=0ac0c05e5495504f -C extra-filename=-0ac0c05e5495504f --out-dir /tmp/cargo-installTSKC0Y/release/deps -L dependency=/tmp/cargo-installTSKC0Y/release/deps --extern ansi_term=/tmp/cargo-installTSKC0Y/release/deps/libansi_term-71bbe583c380e991.rmeta --extern cargo=/tmp/cargo-installTSKC0Y/release/deps/libcargo-340f2e91cf127365.rmeta --extern failure=/tmp/cargo-installTSKC0Y/release/deps/libfailure-4c2aa744f50822db.rmeta --extern serde=/tmp/cargo-installTSKC0Y/release/deps/libserde-430505ed9b89d689.rmeta --extern serde_json=/tmp/cargo-installTSKC0Y/release/deps/libserde_json-79bd17e09973d55a.rmeta --extern structopt=/tmp/cargo-installTSKC0Y/release/deps/libstructopt-bc4d30492e2c5942.rmeta --cap-lints allow -L native=/usr/lib/x86_64-linux-gnu -L native=/tmp/cargo-installTSKC0Y/release/build/libnghttp2-sys-fd029bbaf17bc55d/out/i/lib -L native=/usr/lib/x86_64-linux-gnu -L native=/tmp/cargo-installTSKC0Y/release/build/backtrace-sys-071d1247008507ba/out -L native=/tmp/cargo-installTSKC0Y/release/build/libgit2-sys-05494346cf6a118a/out/build -L native=/tmp/cargo-installTSKC0Y/release/build/libssh2-sys-205529daa70e2991/out/build

Git master version builds fine.

I'm using rustc 1.41.0 (5e1a79984 2020-01-27).

Cargo build plans

cargo-udeps could maybe use cargo build plans instead of using cargo as a library in order to generate the save-analysis info it needs. This means we could re-run build plan generation each time and have better rerun capabilities (#5) and in a later step could even get rid of depending on the cargo library (#13).

Some links to upstream issues:

confusing error message about nightly compiler

Hi,

I've read about your tool and wanted to see what it can do on my project. (It's this repo, the branch name is 3.x) Got this error message:

error: the option 'Z' is only accepted on the nightly compiler

The project is using stable (and not the nightly) compiler. Could not find how to run more verbose this tool. Any hint what could be the problem?

udeps crashes when running

I just wanted to try your program out but it keeps crashing for some reason and I have no clue what is happening.

> cargo +nightly-2019-09-05 udeps
  thread 'main' panicked at 'could not find "rust-ini 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)"', /Users/me/.cargo/registry/src/github.com-1ecc6299db9ec823/cargo-udeps-0.1.2/src/main.rs:349:25
  stack backtrace:
   0: std::panicking::default_hook::{{closure}}
   1: std::panicking::default_hook
   2: std::panicking::rust_panic_with_hook
   3: std::panicking::continue_panic_fmt
   4: std::panicking::begin_panic_fmt
   5: cargo_udeps::main::{{closure}}
   6: cargo_udeps::main
   7: std::rt::lang_start::{{closure}}
   8: std::panicking::try::do_call
   9: __rust_maybe_catch_panic
  10: std::rt::lang_start_internal
  11: main

Error when building a project

When trying this, I get:

% cargo udeps
   Compiling semver-parser v0.7.0
   Compiling unicode-xid v0.1.0
   Compiling unicode-xid v0.2.0
    Checking rustc-demangle v0.1.16
    Checking nodrop v0.1.13
    Checking percent-encoding v1.0.1
   Compiling lazy_static v1.4.0
   Compiling version_check v0.1.5
error: Unrecognized option: 'json-rendered'
error: Unrecognized option: 'json-rendered'


error: Could not compile `unicode-xid`.
warning: build failed, waiting for other jobs to finish...
error: Unrecognized option: 'json-rendered'

error: Could not compile `unicode-xid`.
warning: build failed, waiting for other jobs to finish...
error: Could not compile `semver-parser`.
warning: build failed, waiting for other jobs to finish...
error: Unrecognized option: 'json-rendered'

error: Could not compile `lazy_static`.
warning: build failed, waiting for other jobs to finish...
Error: StrErr("build failed")

How I can help to find the cause?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.