From fc8e4f43f20e62ed1bcc249f8fd26d9e48f17f0d Mon Sep 17 00:00:00 2001 From: Steven Fackler Date: Sat, 28 Dec 2019 19:50:50 -0500 Subject: [PATCH] Switch to using cargo-metadata This both makes the crate compile way faster and avoids having to touch tons of unstable, undocumented cargo internals. This requires Rust 1.41 (the current beta) for some cargo-metadata features. There are some subtle differences in the new output (particularly in handling dependencies between crates in workspaces), but they're pretty minor. Closes #73 Closes #69 Closes #66 Closes #65 Closes #63 Closes #61 Closes #57 Closes #20 --- Cargo.lock | 1143 ++++----------------------------------------- Cargo.toml | 8 +- src/args.rs | 109 +++++ src/format/mod.rs | 45 +- src/graph.rs | 77 +++ src/main.rs | 594 +---------------------- src/metadata.rs | 97 ++++ src/tree.rs | 302 ++++++++++++ 8 files changed, 702 insertions(+), 1673 deletions(-) create mode 100644 src/args.rs create mode 100644 src/graph.rs create mode 100644 src/metadata.rs create mode 100644 src/tree.rs diff --git a/Cargo.lock b/Cargo.lock index 2b93545..1a267e2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,697 +1,95 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -[[package]] -name = "adler32" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "aho-corasick" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "ansi_term" version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "atty" -version = "0.2.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "autocfg" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "backtrace" -version = "0.3.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "backtrace-sys 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-demangle 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "backtrace-sys" -version = "0.1.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "cc 1.0.48 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "bitflags" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "bstr" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "bytesize" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "c2-chacha" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "ppv-lite86 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "cargo" -version = "0.41.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", - "bytesize 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "cargo-platform 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)", - "core-foundation 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", - "crates-io 0.29.0 (registry+https://github.com/rust-lang/crates.io-index)", - "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", - "crypto-hash 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "curl 0.4.25 (registry+https://github.com/rust-lang/crates.io-index)", - "curl-sys 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)", - "env_logger 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", - "failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "filetime 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", - "flate2 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", - "fs2 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", - "fwdansi 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "git2 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)", - "git2-curl 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "glob 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "hex 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "home 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "humantime 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ignore 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", - "im-rc 13.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "jobserver 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "lazycell 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", - "libgit2-sys 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "miow 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "num_cpus 1.11.1 (registry+https://github.com/rust-lang/crates.io-index)", - "opener 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", - "percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "remove_dir_all 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-workspace-hack 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rustfix 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", - "same-file 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", - "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_ignored 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", - "shell-escape 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "strip-ansi-escapes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "tar 0.4.26 (registry+https://github.com/rust-lang/crates.io-index)", - "tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "termcolor 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", - "toml 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-width 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", - "url 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "walkdir 2.2.9 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "cargo-platform" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "cargo-tree" -version = "0.28.0" -dependencies = [ - "cargo 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)", - "cargo-platform 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "env_logger 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", - "failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "petgraph 0.4.13 (registry+https://github.com/rust-lang/crates.io-index)", - "structopt 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "cc" -version = "1.0.48" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "jobserver 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", - "num_cpus 1.11.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "clap" -version = "2.33.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", - "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", - "textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-width 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", - "vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "commoncrypto" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "commoncrypto-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "commoncrypto-sys" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "core-foundation" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "core-foundation-sys 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "core-foundation-sys" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "crates-io" -version = "0.29.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "curl 0.4.25 (registry+https://github.com/rust-lang/crates.io-index)", - "failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", - "url 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "crc32fast" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "crossbeam-channel" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "crossbeam-utils" -version = "0.6.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "crypto-hash" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "commoncrypto 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "openssl 0.10.26 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "curl" -version = "0.4.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "curl-sys 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", - "openssl-probe 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "openssl-sys 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)", - "schannel 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", - "socket2 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "curl-sys" -version = "0.4.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "cc 1.0.48 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", - "libnghttp2-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libz-sys 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)", - "openssl-sys 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)", - "pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)", - "vcpkg 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "env_logger" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", - "humantime 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "termcolor 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "failure" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "backtrace 0.3.40 (registry+https://github.com/rust-lang/crates.io-index)", - "failure_derive 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "failure_derive" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", - "synstructure 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "filetime" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", - "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "fixedbitset" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "flate2" -version = "1.0.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "crc32fast 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", - "libz-sys 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)", - "miniz_oxide 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "fnv" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "foreign-types-shared 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "fs2" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "fwdansi" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "termcolor 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "getrandom" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", - "wasi 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "git2" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", - "libgit2-sys 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "openssl-probe 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "openssl-sys 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)", - "url 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "git2-curl" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "curl 0.4.25 (registry+https://github.com/rust-lang/crates.io-index)", - "git2 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "url 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "glob" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "globset" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "aho-corasick 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)", - "bstr 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", - "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "heck" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "unicode-segmentation 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "hermit-abi" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "hex" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "hex" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "home" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "scopeguard 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "humantime" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "idna" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-normalization 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "ignore" -version = "0.4.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "crossbeam-channel 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", - "globset 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "same-file 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", - "thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", - "walkdir 2.2.9 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi-util 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "im-rc" -version = "13.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "sized-chunks 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "typenum 1.11.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "itoa" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "jobserver" -version = "0.1.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "getrandom 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "lazycell" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "libc" -version = "0.2.66" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "libgit2-sys" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "cc 1.0.48 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", - "libssh2-sys 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", - "libz-sys 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)", - "openssl-sys 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)", - "pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "libnghttp2-sys" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "cc 1.0.48 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "libssh2-sys" -version = "0.2.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "cc 1.0.48 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", - "libz-sys 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)", - "openssl-sys 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)", - "pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)", - "vcpkg 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "libz-sys" -version = "1.0.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "cc 1.0.48 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", - "pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)", - "vcpkg 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "log" -version = "0.4.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "matches" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", +] [[package]] -name = "memchr" -version = "2.2.1" +name = "anyhow" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] -name = "miniz_oxide" -version = "0.3.5" +name = "atty" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "adler32 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "miow" -version = "0.3.3" +name = "bitflags" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "socket2 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", -] [[package]] -name = "num_cpus" -version = "1.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" +name = "cargo-tree" +version = "0.28.0" dependencies = [ - "hermit-abi 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", + "anyhow 1.0.26 (registry+https://github.com/rust-lang/crates.io-index)", + "cargo_metadata 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", + "petgraph 0.4.13 (registry+https://github.com/rust-lang/crates.io-index)", + "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", + "structopt 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "opener" -version = "0.4.1" +name = "cargo_metadata" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", + "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "openssl" -version = "0.10.26" +name = "clap" +version = "2.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ + "ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", - "openssl-sys 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)", + "strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-width 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "openssl-probe" -version = "0.1.2" +name = "fixedbitset" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] -name = "openssl-sys" -version = "0.9.53" +name = "heck" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", - "cc 1.0.48 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", - "pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)", - "vcpkg 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-segmentation 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "ordermap" -version = "0.3.5" +name = "itoa" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "libc" +version = "0.2.66" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] -name = "percent-encoding" -version = "2.1.0" +name = "ordermap" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -704,23 +102,27 @@ dependencies = [ ] [[package]] -name = "pkg-config" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "ppv-lite86" -version = "0.2.6" +name = "proc-macro-error" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro-error-attr 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "rustversion 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", +] [[package]] -name = "proc-macro-error" -version = "0.2.6" +name = "proc-macro-error-attr" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "rustversion 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "syn 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", + "syn-mid 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -731,11 +133,6 @@ dependencies = [ "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "quick-error" -version = "1.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "quote" version = "1.0.2" @@ -745,98 +142,13 @@ dependencies = [ ] [[package]] -name = "rand" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "getrandom 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_chacha 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_hc 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "rand_chacha" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "c2-chacha 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "rand_core" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "getrandom 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "rand_hc" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "redox_syscall" -version = "0.1.56" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "regex" -version = "1.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "aho-corasick 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)", - "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "regex-syntax 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", - "thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "regex-syntax" -version = "0.6.12" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "remove_dir_all" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "rustc-demangle" -version = "0.1.16" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "rustc-workspace-hack" +name = "rustversion" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "rustc_version" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "rustfix" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -844,28 +156,6 @@ name = "ryu" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "same-file" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "winapi-util 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "schannel" -version = "0.1.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "scopeguard" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "semver" version = "0.9.0" @@ -884,9 +174,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" name = "serde" version = "1.0.104" source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", -] [[package]] name = "serde_derive" @@ -898,14 +185,6 @@ dependencies = [ "syn 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "serde_ignored" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "serde_json" version = "1.0.44" @@ -916,43 +195,6 @@ dependencies = [ "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "shell-escape" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "sized-chunks" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "typenum 1.11.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "smallvec" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "socket2" -version = "0.3.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", - "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "strip-ansi-escapes" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "vte 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "strsim" version = "0.8.0" @@ -960,20 +202,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "structopt" -version = "0.3.5" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)", - "structopt-derive 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "structopt-derive 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "structopt-derive" -version = "0.3.5" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "proc-macro-error 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro-error 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "syn 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", @@ -990,45 +232,13 @@ dependencies = [ ] [[package]] -name = "synstructure" -version = "0.12.3" +name = "syn-mid" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "syn 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "tar" -version = "0.4.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "filetime 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", - "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "tempfile" -version = "3.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", - "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", - "remove_dir_all 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "termcolor" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "wincolor 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1039,43 +249,6 @@ dependencies = [ "unicode-width 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "thread_local" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "toml" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "typenum" -version = "1.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "unicode-bidi" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "unicode-normalization" -version = "0.1.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "smallvec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "unicode-segmentation" version = "1.6.0" @@ -1091,54 +264,11 @@ name = "unicode-xid" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "url" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "idna 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", - "percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "utf8parse" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "vcpkg" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "vec_map" version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "vte" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "utf8parse 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "walkdir" -version = "2.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "same-file 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi-util 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "wasi" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "winapi" version = "0.3.8" @@ -1153,162 +283,45 @@ name = "winapi-i686-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "winapi-util" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "wincolor" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi-util 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - [metadata] -"checksum adler32 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "5d2e7343e7fc9de883d1b0341e0b13970f764c14101234857d2ddafa1cb1cac2" -"checksum aho-corasick 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)" = "58fb5e95d83b38284460a5fda7d6470aa0b8844d283a0b614b8535e880800d2d" "checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" +"checksum anyhow 1.0.26 (registry+https://github.com/rust-lang/crates.io-index)" = "7825f6833612eb2414095684fcf6c635becf3ce97fe48cf6421321e93bfbd53c" "checksum atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)" = "1803c647a3ec87095e7ae7acfca019e98de5ec9a7d01343f611cf3152ed71a90" -"checksum autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2" -"checksum backtrace 0.3.40 (registry+https://github.com/rust-lang/crates.io-index)" = "924c76597f0d9ca25d762c25a4d369d51267536465dc5064bdf0eb073ed477ea" -"checksum backtrace-sys 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)" = "5d6575f128516de27e3ce99689419835fce9643a9b215a14d2b5b685be018491" "checksum bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" -"checksum bstr 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8d6c2c5b58ab920a4f5aeaaca34b4488074e8cc7596af94e6f8c6ff247c60245" -"checksum bytesize 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "716960a18f978640f25101b5cbf1c6f6b0d3192fab36a2d98ca96f0ecbe41010" -"checksum c2-chacha 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "214238caa1bf3a496ec3392968969cab8549f96ff30652c9e56885329315f6bb" -"checksum cargo 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2737475f76ce9681e230a4e5cb2476fb133875f28fd84a834a6b5aefd83d3741" -"checksum cargo-platform 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e78cce7683c0998d7a11405dcd13e31b23a930d4b5bba9e4245bdfba6bcd462c" -"checksum cc 1.0.48 (registry+https://github.com/rust-lang/crates.io-index)" = "f52a465a666ca3d838ebbf08b241383421412fe7ebb463527bba275526d89f76" -"checksum cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" +"checksum cargo_metadata 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "46e3374c604fb39d1a2f35ed5e4a4e30e60d01fab49446e08f1b3e9a90aef202" "checksum clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5067f5bb2d80ef5d68b4c87db81601f0b75bca627bc2ef76b141d7b846a3c6d9" -"checksum commoncrypto 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d056a8586ba25a1e4d61cb090900e495952c7886786fc55f909ab2f819b69007" -"checksum commoncrypto-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1fed34f46747aa73dfaa578069fd8279d2818ade2b55f38f22a9401c7f4083e2" -"checksum core-foundation 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "25b9e03f145fd4f2bf705e07b900cd41fc636598fe5dc452fd0db1441c3f496d" -"checksum core-foundation-sys 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e7ca8a5221364ef15ce201e8ed2f609fc312682a8f4e0e3d4aa5879764e0fa3b" -"checksum crates-io 0.29.0 (registry+https://github.com/rust-lang/crates.io-index)" = "54a5db4b026e2d3bad49a9775b01722035ebc6976b95ec556716852d640f3ad5" -"checksum crc32fast 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ba125de2af0df55319f41944744ad91c71113bf74a4646efff39afe1f6842db1" -"checksum crossbeam-channel 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "c8ec7fcd21571dc78f96cc96243cab8d8f035247c3efd16c687be154c3fa9efa" -"checksum crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)" = "04973fa96e96579258a5091af6003abde64af786b860f18622b82e026cca60e6" -"checksum crypto-hash 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8a77162240fd97248d19a564a565eb563a3f592b386e4136fb300909e67dddca" -"checksum curl 0.4.25 (registry+https://github.com/rust-lang/crates.io-index)" = "06aa71e9208a54def20792d877bc663d6aae0732b9852e612c4a933177c31283" -"checksum curl-sys 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)" = "f659f3ffac9582d6177bb86d1d2aa649f4eb9d0d4de9d03ccc08b402832ea340" -"checksum env_logger 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "44533bbbb3bb3c1fa17d9f2e4e38bbbaf8396ba82193c4cb1b6445d711445d36" -"checksum failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "f8273f13c977665c5db7eb2b99ae520952fe5ac831ae4cd09d80c4c7042b5ed9" -"checksum failure_derive 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0bc225b78e0391e4b8683440bf2e63c2deeeb2ce5189eab46e2b68c6d3725d08" -"checksum filetime 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "1ff6d4dab0aa0c8e6346d46052e93b13a16cf847b54ed357087c35011048cc7d" "checksum fixedbitset 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "86d4de0081402f5e88cdac65c8dcdcc73118c1a7a465e2a05f0da05843a8ea33" -"checksum flate2 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)" = "6bd6d6f4752952feb71363cffc9ebac9411b75b87c6ab6058c40c8900cf43c0f" -"checksum fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2fad85553e09a6f881f739c29f0b00b0f01357c743266d478b68951ce23285f3" -"checksum foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -"checksum foreign-types-shared 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" -"checksum fs2 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "9564fc758e15025b46aa6643b1b77d047d1a56a1aea6e01002ac0c7026876213" -"checksum fwdansi 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "08c1f5787fe85505d1f7777268db5103d80a7a374d2316a7ce262e57baf8f208" -"checksum getrandom 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "e7db7ca94ed4cd01190ceee0d8a8052f08a247aa1b469a7f68c6a3b71afcf407" -"checksum git2 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7c1af51ea8a906616af45a4ce78eacf25860f7a13ae7bf8a814693f0f4037a26" -"checksum git2-curl 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cd6527e480187ce19aaf4fa6acfb7657b25628ce31cb8ffabdfca3bf731524c5" -"checksum glob 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" -"checksum globset 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "925aa2cac82d8834e2b2a4415b6f6879757fb5c0928fc445ae76461a12eed8f2" "checksum heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "20564e78d53d2bb135c343b3f47714a56af2061f1c928fdb541dc7b9fdd94205" -"checksum hermit-abi 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "f629dc602392d3ec14bfc8a09b5e644d7ffd725102b48b81e59f90f2633621d7" -"checksum hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "805026a5d0141ffc30abb3be3173848ad46a1b1664fe632428479619a3644d77" -"checksum hex 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "023b39be39e3a2da62a94feb433e91e8bcd37676fbc8bea371daf52b7a769a3e" -"checksum home 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a3753954f7bd71f0e671afb8b5a992d1724cf43b7f95a563cd4a0bde94659ca8" -"checksum humantime 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "df004cfca50ef23c36850aaaa59ad52cc70d0e90243c3c7737a4dd32dc7a3c4f" -"checksum idna 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "02e2673c30ee86b5b96a9cb52ad15718aa1f966f5ab9ad54a8b95d5ca33120a9" -"checksum ignore 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)" = "0ec16832258409d571aaef8273f3c3cc5b060d784e159d1a0f3b0017308f84a7" -"checksum im-rc 13.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0a0197597d095c0d11107975d3175173f810ee572c2501ff4de64f4f3f119806" "checksum itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "501266b7edd0174f8530248f87f99c88fbe60ca4ef3dd486835b8d8d53136f7f" -"checksum jobserver 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)" = "f2b1d42ef453b30b7387e113da1c83ab1605d90c5b4e0eb8e96d016ed3b8c160" -"checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" -"checksum lazycell 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b294d6fa9ee409a054354afc4352b0b9ef7ca222c69b8812cbea9e7d2bf3783f" "checksum libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)" = "d515b1f41455adea1313a4a2ac8a8a477634fbae63cc6100e3aebb207ce61558" -"checksum libgit2-sys 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4870c781f6063efb83150cd22c1ddf6ecf58531419e7570cdcced46970f64a16" -"checksum libnghttp2-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "02254d44f4435dd79e695f2c2b83cd06a47919adea30216ceaf0c57ca0a72463" -"checksum libssh2-sys 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)" = "5fcd5a428a31cbbfe059812d74f4b6cd3b9b7426c2bdaec56993c5365da1c328" -"checksum libz-sys 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)" = "2eb5e43362e38e2bca2fd5f5134c4d4564a23a5c28e9b95411652021a8675ebe" -"checksum log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" -"checksum matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" -"checksum memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "88579771288728879b57485cc7d6b07d648c9f0141eb955f8ab7f9d45394468e" -"checksum miniz_oxide 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "6f3f74f726ae935c3f514300cc6773a0c9492abc5e972d42ba0c0ebb88757625" -"checksum miow 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "396aa0f2003d7df8395cb93e09871561ccc3e785f0acb369170e8cc74ddf9226" -"checksum num_cpus 1.11.1 (registry+https://github.com/rust-lang/crates.io-index)" = "76dac5ed2a876980778b8b85f75a71b6cbf0db0b1232ee12f826bccb00d09d72" -"checksum opener 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "13117407ca9d0caf3a0e74f97b490a7e64c0ae3aa90a8b7085544d0c37b6f3ae" -"checksum openssl 0.10.26 (registry+https://github.com/rust-lang/crates.io-index)" = "3a3cc5799d98e1088141b8e01ff760112bbd9f19d850c124500566ca6901a585" -"checksum openssl-probe 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de" -"checksum openssl-sys 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)" = "465d16ae7fc0e313318f7de5cecf57b2fbe7511fd213978b457e1c96ff46736f" "checksum ordermap 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "a86ed3f5f244b372d6b1a00b72ef7f8876d0bc6a78a4c9985c53614041512063" -"checksum percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" "checksum petgraph 0.4.13 (registry+https://github.com/rust-lang/crates.io-index)" = "9c3659d1ee90221741f65dd128d9998311b0e40c5d3c23a62445938214abce4f" -"checksum pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)" = "05da548ad6865900e60eaba7f589cc0783590a92e940c26953ff81ddbab2d677" -"checksum ppv-lite86 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "74490b50b9fbe561ac330df47c08f3f33073d2d00c150f719147d7c54522fa1b" -"checksum proc-macro-error 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "aeccfe4d5d8ea175d5f0e4a2ad0637e0f4121d63bd99d356fb1f39ab2e7c6097" +"checksum proc-macro-error 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "53c98547ceaea14eeb26fcadf51dc70d01a2479a7839170eae133721105e4428" +"checksum proc-macro-error-attr 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c2bf5d493cf5d3e296beccfd61794e445e830dfc8070a9c248ad3ee071392c6c" "checksum proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "9c9e470a8dc4aeae2dee2f335e8f533e2d4b347e1434e5671afc49b054592f27" -"checksum quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9274b940887ce9addde99c4eee6b5c44cc494b182b97e73dc8ffdcb3397fd3f0" "checksum quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "053a8c8bcc71fcce321828dc897a98ab9760bef03a4fc36693c231e5b3216cfe" -"checksum rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "3ae1b169243eaf61759b8475a998f0a385e42042370f3a7dbaf35246eacc8412" -"checksum rand_chacha 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "03a2a90da8c7523f554344f921aa97283eadf6ac484a6d2a7d0212fa7f8d6853" -"checksum rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" -"checksum rand_hc 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" -"checksum redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)" = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84" -"checksum regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dc220bd33bdce8f093101afe22a037b8eb0e5af33592e6a9caafff0d4cb81cbd" -"checksum regex-syntax 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)" = "11a7e20d1cce64ef2fed88b66d347f88bd9babb82845b2b858f3edbf59a4f716" -"checksum remove_dir_all 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4a83fa3702a688b9359eccba92d153ac33fd2e8462f9e0e3fdf155239ea7792e" -"checksum rustc-demangle 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783" -"checksum rustc-workspace-hack 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc71d2faa173b74b232dedc235e3ee1696581bb132fc116fa3626d6151a1a8fb" -"checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" -"checksum rustfix 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7150ac777a2931a53489f5a41eb0937b84e3092a20cd0e73ad436b65b507f607" +"checksum rustversion 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c48f91977f4ef3be5358c15d131d3f663f6b4d7a112555bf3bf52ad23b6659e5" "checksum ryu 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "bfa8506c1de11c9c4e4c38863ccbe02a305c8188e85a05a784c9e11e1c3910c8" -"checksum same-file 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "585e8ddcedc187886a30fa705c47985c3fa88d06624095856b36ca0b82ff4421" -"checksum schannel 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "87f550b06b6cba9c8b8be3ee73f391990116bf527450d2556e9b9ce263b9a021" -"checksum scopeguard 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b42e15e59b18a828bbf5c58ea01debb36b9b096346de35d941dcb89009f24a0d" "checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" "checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" "checksum serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)" = "414115f25f818d7dfccec8ee535d76949ae78584fc4f79a6f45a904bf8ab4449" "checksum serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)" = "128f9e303a5a29922045a830221b8f78ec74a5f544944f3d5984f8ec3895ef64" -"checksum serde_ignored 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7248fdcbd17d3f2604fc2a02d0ecc844d9a7bf52bf95fc196d9f0a38f6da6a0e" "checksum serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)" = "48c575e0cc52bdd09b47f330f646cf59afc586e9c4e3ccd6fc1f625b8ea1dad7" -"checksum shell-escape 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "170a13e64f2a51b77a45702ba77287f5c6829375b04a69cf2222acd17d0cfab9" -"checksum sized-chunks 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f01db57d7ee89c8e053245deb77040a6cc8508311f381c88749c33d4b9b78785" -"checksum smallvec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "44e59e0c9fa00817912ae6e4e6e3c4fe04455e75699d06eedc7d85917ed8e8f4" -"checksum socket2 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)" = "e8b74de517221a2cb01a53349cf54182acdc31a074727d3079068448c0676d85" -"checksum strip-ansi-escapes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9d63676e2abafa709460982ddc02a3bb586b6d15a49b75c212e06edd3933acee" "checksum strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" -"checksum structopt 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "30b3a3e93f5ad553c38b3301c8a0a0cec829a36783f6a0c467fc4bf553a5f5bf" -"checksum structopt-derive 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "ea692d40005b3ceba90a9fe7a78fa8d4b82b0ce627eebbffc329aab850f3410e" +"checksum structopt 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)" = "884ae79d6aad1e738f4a70dff314203fd498490a63ebc4d03ea83323c40b7b72" +"checksum structopt-derive 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0a97f829a34a0a9d5b353a881025a23b8c9fd09d46be6045df6b22920dbd7a93" "checksum syn 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)" = "dff0acdb207ae2fe6d5976617f887eb1e35a2ba52c13c7234c790960cdad9238" -"checksum synstructure 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)" = "67656ea1dc1b41b1451851562ea232ec2e5a80242139f7e679ceccfb5d61f545" -"checksum tar 0.4.26 (registry+https://github.com/rust-lang/crates.io-index)" = "b3196bfbffbba3e57481b6ea32249fbaf590396a52505a2615adbb79d9d826d3" -"checksum tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" -"checksum termcolor 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "96d6098003bde162e4277c70665bd87c326f5a0c3f3fbfb285787fa482d54e6e" +"checksum syn-mid 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9fd3937748a7eccff61ba5b90af1a20dbf610858923a9192ea0ecb0cb77db1d0" "checksum textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" -"checksum thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c6b53e329000edc2b34dbe8545fd20e55a333362d0a321909685a19bd28c3f1b" -"checksum toml 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "01d1404644c8b12b16bfcffa4322403a91a451584daaaa7c28d3152e6cbc98cf" -"checksum typenum 1.11.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6d2783fe2d6b8c1101136184eb41be8b1ad379e4657050b8aaff0c79ee7575f9" -"checksum unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" -"checksum unicode-normalization 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "b561e267b2326bb4cebfc0ef9e68355c7abe6c6f522aeac2f5bf95d56c59bdcf" "checksum unicode-segmentation 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e83e153d1053cbb5a118eeff7fd5be06ed99153f00dbcd8ae310c5fb2b22edc0" "checksum unicode-width 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "caaa9d531767d1ff2150b9332433f32a24622147e5ebb1f26409d5da67afd479" "checksum unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" -"checksum url 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "75b414f6c464c879d7f9babf951f23bc3743fb7313c081b2e6ca719067ea9d61" -"checksum utf8parse 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8772a4ccbb4e89959023bc5b7cb8623a795caa7092d99f3aa9501b9484d4557d" -"checksum vcpkg 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "3fc439f2794e98976c88a2a2dafce96b930fe8010b0a256b3c2199a773933168" "checksum vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05c78687fb1a80548ae3250346c3db86a80a7cdd77bda190189f2d0a0987c81a" -"checksum vte 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "4f42f536e22f7fcbb407639765c8fd78707a33109301f834a594758bedd6e8cf" -"checksum walkdir 2.2.9 (registry+https://github.com/rust-lang/crates.io-index)" = "9658c94fa8b940eab2250bd5a457f9c48b748420d71293b165c8cdbe2f55f71e" -"checksum wasi 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b89c3ce4ce14bdc6fb6beaf9ec7928ca331de5df7e5ea278375642a2f478570d" "checksum winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" "checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" -"checksum winapi-util 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7168bab6e1daee33b4557efd0e95d5ca70a03706d39fa5f3fe7a236f584b03c9" "checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" -"checksum wincolor 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "96f5016b18804d24db43cebf3c77269e7569b8954a8464501c216cc5e070eaa9" diff --git a/Cargo.toml b/Cargo.toml index 2a795dd..d66c7fb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,9 +9,9 @@ repository = "https://github.com/sfackler/cargo-tree" readme = "README.md" [dependencies] -cargo = "0.41" -cargo-platform = "0.1" -env_logger = "0.7" -failure = "0.1" +anyhow = "1.0" +cargo_metadata = "0.9" petgraph = "0.4" +semver = "0.9" +serde_json = "1.0" structopt = "0.3" diff --git a/src/args.rs b/src/args.rs new file mode 100644 index 0000000..3d27140 --- /dev/null +++ b/src/args.rs @@ -0,0 +1,109 @@ +use std::path::PathBuf; +use std::str::FromStr; +use structopt::clap::AppSettings; +use structopt::StructOpt; + +#[derive(StructOpt)] +#[structopt(bin_name = "cargo")] +pub enum Opts { + #[structopt( + name = "tree", + setting = AppSettings::UnifiedHelpMessage, + setting = AppSettings::DeriveDisplayOrder, + setting = AppSettings::DontCollapseArgsInUsage + )] + /// Display a tree visualization of a dependency graph + Tree(Args), +} + +#[derive(StructOpt)] +pub struct Args { + #[structopt(long = "package", short = "p", value_name = "SPEC")] + /// Package to be used as the root of the tree + pub package: Option, + #[structopt(long = "features", value_name = "FEATURES")] + /// Space-separated list of features to activate + pub features: Option, + #[structopt(long = "all-features")] + /// Activate all available features + pub all_features: bool, + #[structopt(long = "no-default-features")] + /// Do not activate the `default` feature + pub no_default_features: bool, + #[structopt(long = "target", value_name = "TARGET")] + /// Set the target triple + pub target: Option, + #[structopt(long = "all-targets")] + /// Return dependencies for all targets. By default only the host target is matched. + pub all_targets: bool, + #[structopt(long = "no-dev-dependencies")] + /// Skip dev dependencies. + pub no_dev_dependencies: bool, + #[structopt(long = "manifest-path", value_name = "PATH", parse(from_os_str))] + /// Path to Cargo.toml + pub manifest_path: Option, + #[structopt(long = "invert", short = "i")] + /// Invert the tree direction + pub invert: bool, + #[structopt(long = "no-indent")] + /// Display the dependencies as a list (rather than a tree) + pub no_indent: bool, + #[structopt(long = "prefix-depth")] + /// Display the dependencies as a list (rather than a tree), but prefixed with the depth + pub prefix_depth: bool, + #[structopt(long = "all", short = "a")] + /// Don't truncate dependencies that have already been displayed + pub all: bool, + #[structopt(long = "duplicate", short = "d")] + /// Show only dependencies which come in multiple versions (implies -i) + pub duplicates: bool, + #[structopt(long = "charset", value_name = "CHARSET", default_value = "utf8")] + /// Character set to use in output: utf8, ascii + pub charset: Charset, + #[structopt( + long = "format", + short = "f", + value_name = "FORMAT", + default_value = "{p}" + )] + /// Format string used for printing dependencies + pub format: String, + #[structopt(long = "verbose", short = "v", parse(from_occurrences))] + /// Use verbose output (-vv very verbose/build.rs output) + pub verbose: u32, + #[structopt(long = "quiet", short = "q")] + /// No output printed to stdout other than the tree + pub quiet: bool, + #[structopt(long = "color", value_name = "WHEN")] + /// Coloring: auto, always, never + pub color: Option, + #[structopt(long = "frozen")] + /// Require Cargo.lock and cache are up to date + pub frozen: bool, + #[structopt(long = "locked")] + /// Require Cargo.lock is up to date + pub locked: bool, + #[structopt(long = "offline")] + /// Do not access the network + pub offline: bool, + #[structopt(short = "Z", value_name = "FLAG")] + /// Unstable (nightly-only) flags to Cargo + pub unstable_flags: Vec, +} + +pub enum Charset { + Utf8, + Ascii, +} + +impl FromStr for Charset { + type Err = &'static str; + + fn from_str(s: &str) -> Result { + match s { + "utf8" => Ok(Charset::Utf8), + "ascii" => Ok(Charset::Ascii), + _ => Err("invalid charset"), + } + } +} diff --git a/src/format/mod.rs b/src/format/mod.rs index ccb0c7e..e8841d8 100644 --- a/src/format/mod.rs +++ b/src/format/mod.rs @@ -1,9 +1,7 @@ -use cargo::core::manifest::ManifestMetadata; -use cargo::core::PackageId; -use std::error::Error; -use std::fmt; - use crate::format::parse::{Parser, RawChunk}; +use anyhow::{anyhow, Error}; +use cargo_metadata::Package; +use std::fmt; mod parse; @@ -17,7 +15,7 @@ enum Chunk { pub struct Pattern(Vec); impl Pattern { - pub fn new(format: &str) -> Result> { + pub fn new(format: &str) -> Result { let mut chunks = vec![]; for raw in Parser::new(format) { @@ -27,9 +25,9 @@ impl Pattern { RawChunk::Argument("l") => Chunk::License, RawChunk::Argument("r") => Chunk::Repository, RawChunk::Argument(ref a) => { - return Err(format!("unsupported pattern `{}`", a).into()); + return Err(anyhow!("unsupported pattern `{}`", a).into()); } - RawChunk::Error(err) => return Err(err.into()), + RawChunk::Error(err) => return Err(anyhow!("{}", err)), }; chunks.push(chunk); } @@ -37,23 +35,17 @@ impl Pattern { Ok(Pattern(chunks)) } - pub fn display<'a>( - &'a self, - package: &'a PackageId, - metadata: &'a ManifestMetadata, - ) -> Display<'a> { + pub fn display<'a>(&'a self, package: &'a Package) -> Display<'a> { Display { pattern: self, - package: package, - metadata: metadata, + package, } } } pub struct Display<'a> { pattern: &'a Pattern, - package: &'a PackageId, - metadata: &'a ManifestMetadata, + package: &'a Package, } impl<'a> fmt::Display for Display<'a> { @@ -61,14 +53,27 @@ impl<'a> fmt::Display for Display<'a> { for chunk in &self.pattern.0 { match *chunk { Chunk::Raw(ref s) => fmt.write_str(s)?, - Chunk::Package => write!(fmt, "{}", self.package)?, + Chunk::Package => { + write!(fmt, "{} v{}", self.package.name, self.package.version)?; + + match &self.package.source { + Some(source) if !source.is_crates_io() => write!(fmt, " ({})", source)?, + // https://github.com/rust-lang/cargo/issues/7483 + None => write!( + fmt, + " ({})", + self.package.manifest_path.parent().unwrap().display() + )?, + _ => {} + } + } Chunk::License => { - if let Some(ref license) = self.metadata.license { + if let Some(ref license) = self.package.license { write!(fmt, "{}", license)? } } Chunk::Repository => { - if let Some(ref repository) = self.metadata.repository { + if let Some(ref repository) = self.package.repository { write!(fmt, "{}", repository)? } } diff --git a/src/graph.rs b/src/graph.rs new file mode 100644 index 0000000..5776773 --- /dev/null +++ b/src/graph.rs @@ -0,0 +1,77 @@ +use crate::args::Args; +use anyhow::{anyhow, Error}; +use cargo_metadata::{DependencyKind, Metadata, Package, PackageId}; +use petgraph::graph::NodeIndex; +use petgraph::stable_graph::StableGraph; +use petgraph::visit::Dfs; +use std::collections::HashMap; + +pub struct Graph { + pub graph: StableGraph, + pub nodes: HashMap, + pub root: Option, +} + +pub fn build(args: &Args, metadata: Metadata) -> Result { + let resolve = metadata.resolve.unwrap(); + + let mut graph = Graph { + graph: StableGraph::new(), + nodes: HashMap::new(), + root: resolve.root, + }; + + for package in metadata.packages { + let id = package.id.clone(); + let index = graph.graph.add_node(package); + graph.nodes.insert(id, index); + } + + for node in resolve.nodes { + if node.deps.len() != node.dependencies.len() { + return Err(anyhow!("cargo tree requires cargo 1.41 or newer")); + } + + let from = graph.nodes[&node.id]; + for dep in node.deps { + if dep.dep_kinds.is_empty() { + return Err(anyhow!("cargo tree requires cargo 1.41 or newer")); + } + + // https://github.com/rust-lang/cargo/issues/7752 + let mut kinds = vec![]; + for kind in dep.dep_kinds { + if !kinds.iter().any(|k| *k == kind.kind) { + kinds.push(kind.kind); + } + } + + let to = graph.nodes[&dep.pkg]; + for kind in kinds { + if args.no_dev_dependencies && kind == DependencyKind::Development { + continue; + } + + graph.graph.add_edge(from, to, kind); + } + } + } + + // prune nodes not reachable from the root package (directionally) + if let Some(root) = &graph.root { + let mut dfs = Dfs::new(&graph.graph, graph.nodes[root]); + while dfs.next(&graph.graph).is_some() {} + + let g = &mut graph.graph; + graph.nodes.retain(|_, idx| { + if !dfs.discovered.contains(idx.index()) { + g.remove_node(*idx); + false + } else { + true + } + }); + } + + Ok(graph) +} diff --git a/src/main.rs b/src/main.rs index 5009656..0f56978 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,592 +1,18 @@ -use cargo::core::dependency::Kind; -use cargo::core::manifest::ManifestMetadata; -use cargo::core::maybe_allow_nightly_features; -use cargo::core::package::PackageSet; -use cargo::core::registry::PackageRegistry; -use cargo::core::resolver::ResolveOpts; -use cargo::core::shell::Shell; -use cargo::core::{Package, PackageId, Resolve, Workspace}; -use cargo::ops; -use cargo::util::{important_paths, CargoResult, Rustc}; -use cargo::{CliResult, Config}; -use cargo_platform::Cfg; -use failure::bail; -use petgraph::graph::NodeIndex; -use petgraph::visit::EdgeRef; -use petgraph::EdgeDirection; - -use std::collections::hash_map::Entry; -use std::collections::{HashMap, HashSet}; -use std::path::PathBuf; -use std::str::{self, FromStr}; -use structopt::clap::AppSettings; +use crate::args::Opts; +use anyhow::Error; use structopt::StructOpt; -use crate::format::Pattern; - +mod args; mod format; +mod graph; +mod metadata; +mod tree; -#[derive(StructOpt)] -#[structopt(bin_name = "cargo")] -enum Opts { - #[structopt( - name = "tree", - setting = AppSettings::UnifiedHelpMessage, - setting = AppSettings::DeriveDisplayOrder, - setting = AppSettings::DontCollapseArgsInUsage - )] - /// Display a tree visualization of a dependency graph - Tree(Args), -} - -#[derive(StructOpt)] -struct Args { - #[structopt(long = "package", short = "p", value_name = "SPEC")] - /// Package to be used as the root of the tree - package: Option, - #[structopt(long = "features", value_name = "FEATURES")] - /// Space-separated list of features to activate - features: Option, - #[structopt(long = "all-features")] - /// Activate all available features - all_features: bool, - #[structopt(long = "no-default-features")] - /// Do not activate the `default` feature - no_default_features: bool, - #[structopt(long = "target", value_name = "TARGET")] - /// Set the target triple - target: Option, - /// Directory for all generated artifacts - #[structopt(long = "target-dir", value_name = "DIRECTORY", parse(from_os_str))] - target_dir: Option, - #[structopt(long = "all-targets")] - /// Return dependencies for all targets. By default only the host target is matched. - all_targets: bool, - #[structopt(long = "no-dev-dependencies")] - /// Skip dev dependencies. - no_dev_dependencies: bool, - #[structopt(long = "manifest-path", value_name = "PATH", parse(from_os_str))] - /// Path to Cargo.toml - manifest_path: Option, - #[structopt(long = "invert", short = "i")] - /// Invert the tree direction - invert: bool, - #[structopt(long = "no-indent")] - /// Display the dependencies as a list (rather than a tree) - no_indent: bool, - #[structopt(long = "prefix-depth")] - /// Display the dependencies as a list (rather than a tree), but prefixed with the depth - prefix_depth: bool, - #[structopt(long = "all", short = "a")] - /// Don't truncate dependencies that have already been displayed - all: bool, - #[structopt(long = "duplicate", short = "d")] - /// Show only dependencies which come in multiple versions (implies -i) - duplicates: bool, - #[structopt(long = "charset", value_name = "CHARSET", default_value = "utf8")] - /// Character set to use in output: utf8, ascii - charset: Charset, - #[structopt( - long = "format", - short = "f", - value_name = "FORMAT", - default_value = "{p}" - )] - /// Format string used for printing dependencies - format: String, - #[structopt(long = "verbose", short = "v", parse(from_occurrences))] - /// Use verbose output (-vv very verbose/build.rs output) - verbose: u32, - #[structopt(long = "quiet", short = "q")] - /// No output printed to stdout other than the tree - quiet: Option, - #[structopt(long = "color", value_name = "WHEN")] - /// Coloring: auto, always, never - color: Option, - #[structopt(long = "frozen")] - /// Require Cargo.lock and cache are up to date - frozen: bool, - #[structopt(long = "locked")] - /// Require Cargo.lock is up to date - locked: bool, - #[structopt(long = "offline")] - /// Do not access the network - offline: bool, - #[structopt(short = "Z", value_name = "FLAG")] - /// Unstable (nightly-only) flags to Cargo - unstable_flags: Vec, -} - -enum Charset { - Utf8, - Ascii, -} - -#[derive(Clone, Copy)] -enum Prefix { - None, - Indent, - Depth, -} - -impl FromStr for Charset { - type Err = &'static str; - - fn from_str(s: &str) -> Result { - match s { - "utf8" => Ok(Charset::Utf8), - "ascii" => Ok(Charset::Ascii), - _ => Err("invalid charset"), - } - } -} - -struct Symbols { - down: &'static str, - tee: &'static str, - ell: &'static str, - right: &'static str, -} - -static UTF8_SYMBOLS: Symbols = Symbols { - down: "│", - tee: "├", - ell: "└", - right: "─", -}; - -static ASCII_SYMBOLS: Symbols = Symbols { - down: "|", - tee: "|", - ell: "`", - right: "-", -}; - -fn main() { - env_logger::init(); - - let mut config = match Config::default() { - Ok(cfg) => cfg, - Err(e) => { - let mut shell = Shell::new(); - cargo::exit_with_error(e.into(), &mut shell) - } - }; - +fn main() -> Result<(), Error> { let Opts::Tree(args) = Opts::from_args(); - - if let Err(e) = real_main(args, &mut config) { - let mut shell = Shell::new(); - cargo::exit_with_error(e, &mut shell) - } -} - -fn real_main(args: Args, config: &mut Config) -> CliResult { - config.configure( - args.verbose, - args.quiet, - &args.color, - args.frozen, - args.locked, - args.offline, - &args.target_dir, - &args.unstable_flags, - )?; - - // Needed to allow nightly features - maybe_allow_nightly_features(); - - let workspace = workspace(config, args.manifest_path)?; - let package = workspace.current()?; - let mut registry = registry(config, &package)?; - let (packages, resolve) = resolve( - &mut registry, - &workspace, - args.features, - args.all_features, - args.no_default_features, - args.no_dev_dependencies, - )?; - let ids = packages.package_ids().collect::>(); - let packages = registry.get(&ids)?; - - let root = match args.package { - Some(ref pkg) => resolve.query(pkg)?, - None => package.package_id(), - }; - - let rustc = config.load_global_rustc(Some(&workspace))?; - - let target = if args.all_targets { - None - } else { - Some(match &args.target { - Some(s) => s, - None => rustc.host.as_str(), - }) - }; - - let format = Pattern::new(&args.format).map_err(|e| failure::err_msg(e.to_string()))?; - - let cfgs = get_cfgs(&rustc, &args.target)?; - let graph = build_graph(&resolve, &packages, package.package_id(), target, &cfgs)?; - - let direction = if args.invert || args.duplicates { - EdgeDirection::Incoming - } else { - EdgeDirection::Outgoing - }; - - let symbols = match args.charset { - Charset::Ascii => &ASCII_SYMBOLS, - Charset::Utf8 => &UTF8_SYMBOLS, - }; - - let prefix = if args.prefix_depth { - Prefix::Depth - } else if args.no_indent { - Prefix::None - } else { - Prefix::Indent - }; - - if args.duplicates { - let dups = find_duplicates(&graph); - for dup in &dups { - print_tree(dup, &graph, &format, direction, symbols, prefix, args.all)?; - println!(); - } - } else { - print_tree(&root, &graph, &format, direction, symbols, prefix, args.all)?; - } + let metadata = metadata::get(&args)?; + let graph = graph::build(&args, metadata)?; + tree::print(&args, &graph)?; Ok(()) } - -fn find_duplicates<'a>(graph: &Graph<'a>) -> Vec { - let mut counts = HashMap::new(); - - // Count by name only. Source and version are irrelevant here. - for package in graph.nodes.keys() { - *counts.entry(package.name()).or_insert(0) += 1; - } - - // Theoretically inefficient, but in practice we're only listing duplicates and - // there won't be enough dependencies for it to matter. - let mut dup_ids = Vec::new(); - for name in counts.drain().filter(|&(_, v)| v > 1).map(|(k, _)| k) { - dup_ids.extend(graph.nodes.keys().filter(|p| p.name() == name)); - } - dup_ids.sort(); - dup_ids -} - -fn get_cfgs(rustc: &Rustc, target: &Option) -> CargoResult> { - let mut process = rustc.process(); - process.arg("--print=cfg").env_remove("RUST_LOG"); - if let Some(ref s) = *target { - process.arg("--target").arg(s); - } - - let output = process.exec_with_output()?; - let stdout = String::from_utf8(output.stdout)?; - let mut out = Vec::new(); - for line in stdout.lines() { - match Cfg::from_str(line) { - Ok(cfg) => out.push(cfg), - Err(err) => return Err(err.into()), - } - } - Ok(out) -} - -fn workspace(config: &Config, manifest_path: Option) -> CargoResult> { - let root = match manifest_path { - Some(path) => path, - None => important_paths::find_root_manifest_for_wd(config.cwd())?, - }; - Workspace::new(&root, config) -} - -fn registry<'a>(config: &'a Config, package: &Package) -> CargoResult> { - let mut registry = PackageRegistry::new(config)?; - registry.add_sources(Some(package.package_id().source_id()))?; - Ok(registry) -} - -fn resolve<'a, 'cfg>( - registry: &mut PackageRegistry<'cfg>, - workspace: &'a Workspace<'cfg>, - features: Option, - all_features: bool, - no_default_features: bool, - no_dev_dependencies: bool, -) -> CargoResult<(PackageSet<'a>, Resolve)> { - let features: Vec = features.into_iter().collect(); - - let (packages, resolve) = ops::resolve_ws(workspace)?; - - let opts = ResolveOpts::new( - !no_dev_dependencies, - &features, - all_features, - !no_default_features, - ); - let specs = ops::Packages::All.to_package_id_specs(workspace)?; - - let resolve = ops::resolve_with_previous( - registry, - workspace, - opts, - Some(&resolve), - None, - &specs, - true, - )?; - Ok((packages, resolve)) -} - -struct Node<'a> { - id: PackageId, - metadata: &'a ManifestMetadata, -} - -struct Graph<'a> { - graph: petgraph::Graph, Kind>, - nodes: HashMap, -} - -fn build_graph<'a>( - resolve: &'a Resolve, - packages: &'a PackageSet<'_>, - root: PackageId, - target: Option<&str>, - cfgs: &[Cfg], -) -> CargoResult> { - let mut graph = Graph { - graph: petgraph::Graph::new(), - nodes: HashMap::new(), - }; - let node = Node { - id: root, - metadata: packages.get_one(root)?.manifest().metadata(), - }; - graph.nodes.insert(root.clone(), graph.graph.add_node(node)); - - let mut pending = vec![root]; - - while let Some(pkg_id) = pending.pop() { - let idx = graph.nodes[&pkg_id]; - let pkg = packages.get_one(pkg_id)?; - - for raw_item in resolve.deps_not_replaced(pkg_id) { - let raw_dep_id = raw_item.0; - let it = pkg - .dependencies() - .iter() - .filter(|d| d.matches_ignoring_source(raw_dep_id)) - .filter(|d| { - d.platform() - .and_then(|p| target.map(|t| p.matches(t, cfgs))) - .unwrap_or(true) - }); - let dep_id = resolve.replacement(raw_dep_id).unwrap_or(raw_dep_id); - for dep in it { - let dep_idx = match graph.nodes.entry(dep_id) { - Entry::Occupied(e) => *e.get(), - Entry::Vacant(e) => { - pending.push(dep_id); - let node = Node { - id: dep_id, - metadata: packages.get_one(dep_id)?.manifest().metadata(), - }; - *e.insert(graph.graph.add_node(node)) - } - }; - graph.graph.add_edge(idx, dep_idx, dep.kind()); - } - } - } - - Ok(graph) -} - -fn print_tree<'a>( - package: &'a PackageId, - graph: &Graph<'a>, - format: &Pattern, - direction: EdgeDirection, - symbols: &Symbols, - prefix: Prefix, - all: bool, -) -> CargoResult<()> { - let mut visited_deps = HashSet::new(); - let mut levels_continue = vec![]; - - let package = match graph.nodes.get(package) { - Some(package) => package, - None => bail!("package {} not found", package), - }; - let node = &graph.graph[*package]; - print_dependency( - node, - &graph, - format, - direction, - symbols, - &mut visited_deps, - &mut levels_continue, - prefix, - all, - ); - Ok(()) -} - -fn print_dependency<'a>( - package: &Node<'a>, - graph: &Graph<'a>, - format: &Pattern, - direction: EdgeDirection, - symbols: &Symbols, - visited_deps: &mut HashSet, - levels_continue: &mut Vec, - prefix: Prefix, - all: bool, -) { - let new = all || visited_deps.insert(package.id); - let star = if new { "" } else { " (*)" }; - - match prefix { - Prefix::Depth => print!("{} ", levels_continue.len()), - Prefix::Indent => { - if let Some((&last_continues, rest)) = levels_continue.split_last() { - for &continues in rest { - let c = if continues { symbols.down } else { " " }; - print!("{} ", c); - } - - let c = if last_continues { - symbols.tee - } else { - symbols.ell - }; - print!("{0}{1}{1} ", c, symbols.right); - } - } - Prefix::None => (), - } - - println!("{}{}", format.display(&package.id, package.metadata), star); - - if !new { - return; - } - - let mut normal = vec![]; - let mut build = vec![]; - let mut development = vec![]; - for edge in graph - .graph - .edges_directed(graph.nodes[&package.id], direction) - { - let dep = match direction { - EdgeDirection::Incoming => &graph.graph[edge.source()], - EdgeDirection::Outgoing => &graph.graph[edge.target()], - }; - match *edge.weight() { - Kind::Normal => normal.push(dep), - Kind::Build => build.push(dep), - Kind::Development => development.push(dep), - } - } - - print_dependency_kind( - Kind::Normal, - normal, - graph, - format, - direction, - symbols, - visited_deps, - levels_continue, - prefix, - all, - ); - print_dependency_kind( - Kind::Build, - build, - graph, - format, - direction, - symbols, - visited_deps, - levels_continue, - prefix, - all, - ); - print_dependency_kind( - Kind::Development, - development, - graph, - format, - direction, - symbols, - visited_deps, - levels_continue, - prefix, - all, - ); -} - -fn print_dependency_kind<'a>( - kind: Kind, - mut deps: Vec<&Node<'a>>, - graph: &Graph<'a>, - format: &Pattern, - direction: EdgeDirection, - symbols: &Symbols, - visited_deps: &mut HashSet, - levels_continue: &mut Vec, - prefix: Prefix, - all: bool, -) { - if deps.is_empty() { - return; - } - - // Resolve uses Hash data types internally but we want consistent output ordering - deps.sort_by_key(|n| n.id); - - let name = match kind { - Kind::Normal => None, - Kind::Build => Some("[build-dependencies]"), - Kind::Development => Some("[dev-dependencies]"), - }; - if let Prefix::Indent = prefix { - if let Some(name) = name { - for &continues in &**levels_continue { - let c = if continues { symbols.down } else { " " }; - print!("{} ", c); - } - - println!("{}", name); - } - } - - let mut it = deps.iter().peekable(); - while let Some(dependency) = it.next() { - levels_continue.push(it.peek().is_some()); - print_dependency( - dependency, - graph, - format, - direction, - symbols, - visited_deps, - levels_continue, - prefix, - all, - ); - levels_continue.pop(); - } -} diff --git a/src/metadata.rs b/src/metadata.rs new file mode 100644 index 0000000..2962520 --- /dev/null +++ b/src/metadata.rs @@ -0,0 +1,97 @@ +use crate::args::Args; +use anyhow::{anyhow, Context, Error}; +use cargo_metadata::Metadata; +use std::env; +use std::ffi::OsString; +use std::process::{Command, Stdio}; + +pub fn get(args: &Args) -> Result { + let cargo = env::var_os("CARGO").unwrap_or_else(|| OsString::from("cargo")); + + let mut command = Command::new(cargo); + command.arg("metadata").arg("--format-version").arg("1"); + + if args.quiet { + command.arg("-q"); + } + + if let Some(features) = &args.features { + command.arg("--features").arg(features); + } + if args.all_features { + command.arg("--all-features"); + } + if args.no_default_features { + command.arg("--no-default-features"); + } + + if !args.all_targets { + command.arg("--filter-platform"); + match &args.target { + Some(target) => { + command.arg(target); + } + None => { + let target = default_target()?; + command.arg(target); + } + } + } + + if let Some(path) = &args.manifest_path { + command.arg("--manifest-path").arg(path); + } + + for _ in 0..args.verbose { + command.arg("-v"); + } + + if let Some(color) = &args.color { + command.arg("--color").arg(color); + } + + if args.frozen { + command.arg("--frozen"); + } + if args.locked { + command.arg("--locked"); + } + if args.offline { + command.arg("--offline"); + } + + for flag in &args.unstable_flags { + command.arg("-Z").arg(flag); + } + + let output = output(&mut command, "cargo metadata")?; + + serde_json::from_str(&output).context("error parsing cargo metadata output") +} + +fn default_target() -> Result { + let rustc = env::var_os("RUSTC").unwrap_or_else(|| OsString::from("rustc")); + let output = output(Command::new(rustc).arg("-Vv"), "rustc")?; + + for line in output.lines() { + let prefix = "host: "; + if line.starts_with(prefix) { + return Ok(line[prefix.len()..].trim().to_string()); + } + } + + Err(anyhow!("host missing from rustc output")) +} + +fn output(command: &mut Command, job: &str) -> Result { + let output = command + .stderr(Stdio::inherit()) + .output() + .with_context(|| format!("error running {}", job))?; + + if !output.status.success() { + return Err(anyhow!("{} returned {}", job, output.status)); + } + + String::from_utf8(output.stdout).with_context(|| format!("error parsing {} output", job)) +} diff --git a/src/tree.rs b/src/tree.rs new file mode 100644 index 0000000..f5d334f --- /dev/null +++ b/src/tree.rs @@ -0,0 +1,302 @@ +use crate::args::{Args, Charset}; +use crate::format::Pattern; +use crate::graph::Graph; +use anyhow::{anyhow, Context, Error}; +use cargo_metadata::{DependencyKind, Package, PackageId}; +use petgraph::visit::EdgeRef; +use petgraph::EdgeDirection; +use semver::Version; +use std::collections::{HashMap, HashSet}; + +#[derive(Clone, Copy)] +enum Prefix { + None, + Indent, + Depth, +} + +struct Symbols { + down: &'static str, + tee: &'static str, + ell: &'static str, + right: &'static str, +} + +static UTF8_SYMBOLS: Symbols = Symbols { + down: "│", + tee: "├", + ell: "└", + right: "─", +}; + +static ASCII_SYMBOLS: Symbols = Symbols { + down: "|", + tee: "|", + ell: "`", + right: "-", +}; + +pub fn print(args: &Args, graph: &Graph) -> Result<(), Error> { + let format = Pattern::new(&args.format)?; + + let direction = if args.invert || args.duplicates { + EdgeDirection::Incoming + } else { + EdgeDirection::Outgoing + }; + + let symbols = match args.charset { + Charset::Utf8 => &UTF8_SYMBOLS, + Charset::Ascii => &ASCII_SYMBOLS, + }; + + let prefix = if args.prefix_depth { + Prefix::Depth + } else if args.no_indent { + Prefix::None + } else { + Prefix::Indent + }; + + if args.duplicates { + for (i, package) in find_duplicates(graph).iter().enumerate() { + if i != 0 { + println!(); + } + + let root = &graph.graph[graph.nodes[*package]]; + print_tree(graph, root, &format, direction, symbols, prefix, args.all); + } + } else { + let root = match &args.package { + Some(package) => find_package(package, graph)?, + None => graph.root.as_ref().ok_or_else(|| { + anyhow!("this command requires running against an actual package in this workspace") + })?, + }; + let root = &graph.graph[graph.nodes[root]]; + + print_tree(graph, root, &format, direction, symbols, prefix, args.all); + } + + Ok(()) +} + +fn find_package<'a>(package: &str, graph: &'a Graph) -> Result<&'a PackageId, Error> { + let mut it = package.split(":"); + let name = it.next().unwrap(); + let version = it + .next() + .map(Version::parse) + .transpose() + .context("error parsing package version")?; + + let mut candidates = vec![]; + for idx in graph.graph.node_indices() { + let package = &graph.graph[idx]; + if package.name != name { + continue; + } + + if let Some(version) = &version { + if package.version != *version { + continue; + } + } + + candidates.push(package); + } + + if candidates.len() == 0 { + Err(anyhow!("no crates found for package `{}`", package)) + } else if candidates.len() > 1 { + let specs = candidates + .iter() + .map(|p| format!("{}:{}", p.name, p.version)) + .collect::>() + .join(", "); + Err(anyhow!( + "multiple crates found for package `{}`: {}", + package, + specs, + )) + } else { + Ok(&candidates[0].id) + } +} + +fn find_duplicates(graph: &Graph) -> Vec<&PackageId> { + let mut packages = HashMap::new(); + + for idx in graph.graph.node_indices() { + let package = &graph.graph[idx]; + packages + .entry(&package.name) + .or_insert_with(Vec::new) + .push(&package.id); + } + + let mut duplicates = vec![]; + for ids in packages.values() { + if ids.len() > 1 { + duplicates.extend(ids.iter().cloned()); + } + } + + duplicates.sort(); + duplicates +} + +fn print_tree<'a>( + graph: &'a Graph, + root: &'a Package, + format: &Pattern, + direction: EdgeDirection, + symbols: &Symbols, + prefix: Prefix, + all: bool, +) { + let mut visited_deps = HashSet::new(); + let mut levels_continue = vec![]; + + print_package( + graph, + root, + format, + direction, + symbols, + prefix, + all, + &mut visited_deps, + &mut levels_continue, + ); +} + +fn print_package<'a>( + graph: &'a Graph, + package: &'a Package, + format: &Pattern, + direction: EdgeDirection, + symbols: &Symbols, + prefix: Prefix, + all: bool, + visited_deps: &mut HashSet<&'a PackageId>, + levels_continue: &mut Vec, +) { + let new = all || visited_deps.insert(&package.id); + + match prefix { + Prefix::Depth => print!("{}", levels_continue.len()), + Prefix::Indent => { + if let Some((last_continues, rest)) = levels_continue.split_last() { + for continues in rest { + let c = if *continues { symbols.down } else { " " }; + print!("{} ", c); + } + + let c = if *last_continues { + symbols.tee + } else { + symbols.ell + }; + print!("{0}{1}{1} ", c, symbols.right); + } + } + Prefix::None => {} + } + + let star = if new { "" } else { " (*)" }; + println!("{}{}", format.display(package), star); + + if !new { + return; + } + + for kind in &[ + DependencyKind::Normal, + DependencyKind::Build, + DependencyKind::Development, + ] { + print_dependencies( + graph, + package, + format, + direction, + symbols, + prefix, + all, + visited_deps, + levels_continue, + *kind, + ); + } +} + +fn print_dependencies<'a>( + graph: &'a Graph, + package: &'a Package, + format: &Pattern, + direction: EdgeDirection, + symbols: &Symbols, + prefix: Prefix, + all: bool, + visited_deps: &mut HashSet<&'a PackageId>, + levels_continue: &mut Vec, + kind: DependencyKind, +) { + let idx = graph.nodes[&package.id]; + let mut deps = vec![]; + for edge in graph.graph.edges_directed(idx, direction) { + if *edge.weight() != kind { + continue; + } + + let dep = match direction { + EdgeDirection::Incoming => &graph.graph[edge.source()], + EdgeDirection::Outgoing => &graph.graph[edge.target()], + }; + deps.push(dep); + } + + if deps.is_empty() { + return; + } + + // ensure a consistent output ordering + deps.sort_by_key(|p| &p.id); + + let name = match kind { + DependencyKind::Normal => None, + DependencyKind::Build => Some("[build-dependencies]"), + DependencyKind::Development => Some("[dev-dependencies]"), + _ => unreachable!(), + }; + + if let Prefix::Indent = prefix { + if let Some(name) = name { + for continues in &**levels_continue { + let c = if *continues { symbols.down } else { " " }; + print!("{} ", c); + } + + println!("{}", name); + } + } + + let mut it = deps.iter().peekable(); + while let Some(dependency) = it.next() { + levels_continue.push(it.peek().is_some()); + print_package( + graph, + dependency, + format, + direction, + symbols, + prefix, + all, + visited_deps, + levels_continue, + ); + levels_continue.pop(); + } +}