make prune-unused-deps more accurate and prune more stuff

This commit is contained in:
Ximin Luo 2020-12-20 14:40:28 +00:00
parent d2688de984
commit 4a65db9846
2 changed files with 82 additions and 8 deletions

77
debian/copyright vendored
View File

@ -40,10 +40,16 @@ Files-Excluded:
# unused dependencies, generated by debian/prune-unused-deps
# DO NOT EDIT below, AUTOGENERATED
vendor/annotate-snippets-0.6.1
vendor/anyhow-1.0.32
vendor/anyhow-1.0.33
vendor/anymap
vendor/ar
vendor/arc-swap
vendor/arrayref
vendor/autocfg-1.0.0
vendor/backtrace
vendor/base64-0.11.0
vendor/base64
vendor/bitmaps
vendor/blake2b_simd
vendor/bytecount
@ -52,8 +58,13 @@ Files-Excluded:
vendor/cargo_metadata-0.11.1
vendor/cargo_metadata-0.8.2
vendor/cargo_metadata
vendor/cc-1.0.59
vendor/cc-1.0.60
vendor/cfg-if
vendor/chalk-derive-0.25.0
vendor/chalk-ir-0.25.0
vendor/chalk-recursive
vendor/chalk-solve-0.25.0
vendor/cloudabi-0.0.3
vendor/colored
vendor/commoncrypto
@ -63,6 +74,16 @@ Files-Excluded:
vendor/const_fn
vendor/core-foundation
vendor/core-foundation-sys
vendor/cranelift-bforest
vendor/cranelift-codegen
vendor/cranelift-codegen-meta
vendor/cranelift-codegen-shared
vendor/cranelift-entity
vendor/cranelift-frontend
vendor/cranelift-module
vendor/cranelift-native
vendor/cranelift-object
vendor/cranelift-simplejit
vendor/crossbeam-queue
vendor/crossbeam-utils
vendor/crypto-hash
@ -73,30 +94,43 @@ Files-Excluded:
vendor/directories
vendor/dirs
vendor/dirs-sys
vendor/drop_bomb
vendor/env_logger-0.6.2
vendor/env_logger
vendor/errno
vendor/errno-dragonfly
vendor/failure
vendor/failure_derive
vendor/flate2-1.0.16
vendor/foreign-types
vendor/foreign-types-shared
vendor/fs-err
vendor/fsevent
vendor/fsevent-sys
vendor/fst-0.3.5
vendor/fst
vendor/fuchsia-zircon
vendor/fuchsia-zircon-sys
vendor/futures
vendor/fwdansi
vendor/gcc
vendor/getrandom
vendor/git2
vendor/git2-curl
vendor/goblin
vendor/hashbrown-0.9.0
vendor/hermit-abi-0.1.15
vendor/hex-0.3.2
vendor/home
vendor/humantime
vendor/idna-0.1.5
vendor/if_chain
vendor/im-rc
vendor/inotify
vendor/inotify-sys
vendor/iovec
vendor/itertools-0.8.2
vendor/jod-thread
vendor/json
vendor/jsonrpc-client-transports
vendor/jsonrpc-core
@ -107,22 +141,34 @@ Files-Excluded:
vendor/jsonrpc-server-utils
vendor/kernel32-sys
vendor/lazycell
vendor/libc-0.2.77
vendor/libgit2-sys
vendor/libloading-0.6.3
vendor/libloading
vendor/libmimalloc-sys
vendor/libnghttp2-sys
vendor/libssh2-sys
vendor/libz-sys
vendor/linked-hash-map
vendor/lock_api-0.3.4
vendor/lsp-codec
vendor/lsp-server
vendor/lsp-types-0.60.0
vendor/lsp-types
vendor/mach
vendor/md-5-0.8.0
vendor/mimalloc
vendor/miniz_oxide-0.4.0
vendor/mio
vendor/mio-extras
vendor/mio-named-pipes
vendor/mio-uds
vendor/miow-0.2.1
vendor/net2-0.2.34
vendor/net2
vendor/notify
vendor/object
vendor/oorandom
vendor/openssl
vendor/openssl-probe
vendor/openssl-src
@ -135,17 +181,27 @@ Files-Excluded:
vendor/parking_lot_core-0.6.2
vendor/parking_lot_core-0.7.2
vendor/percent-encoding-1.0.1
vendor/perf-event
vendor/perf-event-open-sys
vendor/pico-args
vendor/plain
vendor/pretty_env_logger
vendor/proc-macro2-1.0.19
vendor/proc-macro2-1.0.21
vendor/proc-macro-crate
vendor/pulldown-cmark-to-cmark
vendor/quine-mc_cluskey
vendor/racer
vendor/rand_xoshiro
vendor/raw-cpuid
vendor/rayon-1.3.1
vendor/rayon-core-1.7.1
vendor/redox_users
vendor/regalloc
vendor/region
vendor/rls-analysis
vendor/rls-vfs
vendor/rowan
vendor/rust-argon2
vendor/rustc-ap-rustc_arena
vendor/rustc-ap-rustc_ast
@ -159,6 +215,7 @@ Files-Excluded:
vendor/rustc-ap-rustc_fs_util
vendor/rustc-ap-rustc_graphviz
vendor/rustc-ap-rustc_index
vendor/rustc-ap-rustc_lexer-673.0.0
vendor/rustc-ap-rustc_lexer
vendor/rustc-ap-rustc_macros
vendor/rustc-ap-rustc_parse
@ -166,29 +223,43 @@ Files-Excluded:
vendor/rustc-ap-rustc_session
vendor/rustc-ap-rustc_span
vendor/rustc-ap-rustc_target
vendor/rustc-demangle-0.1.16
vendor/rustc_tools_util
vendor/rustc_version
vendor/salsa
vendor/salsa-macros
vendor/schannel
vendor/scroll
vendor/scroll_derive
vendor/semver-0.9.0
vendor/semver
vendor/semver-parser
vendor/serde-1.0.115
vendor/serde_derive-1.0.115
vendor/serde_ignored
vendor/serde_json-1.0.57
vendor/serde_repr
vendor/shell-escape
vendor/signal-hook-registry
vendor/sized-chunks
vendor/slab
vendor/smallvec-0.6.13
vendor/smol_str
vendor/strip-ansi-escapes
vendor/structopt
vendor/structopt-derive
vendor/syn-1.0.38
vendor/syn-1.0.40
vendor/target-lexicon
vendor/term
vendor/tester
vendor/text-size
vendor/thin-dst
vendor/thiserror-1.0.20
vendor/thiserror
vendor/thiserror-impl-1.0.20
vendor/thiserror-impl
vendor/threadpool
vendor/time-0.1.43
vendor/tokio
vendor/tokio-codec
@ -207,6 +278,11 @@ Files-Excluded:
vendor/tokio-timer
vendor/tokio-udp
vendor/tokio-uds
vendor/tracing-core-0.1.16
vendor/tracing-serde-0.1.1
vendor/tracing-subscriber-0.2.11
vendor/tracing-tree-0.1.5
vendor/ungrammar
vendor/unicode_categories
vendor/url-1.7.2
vendor/utf8parse
@ -216,6 +292,7 @@ Files-Excluded:
vendor/vte
vendor/winapi-0.2.8
vendor/winapi-build
vendor/write-json
vendor/ws2_32-sys
vendor/yaml-merge-keys
vendor/yaml-rust

View File

@ -19,13 +19,10 @@ find vendor -name .cargo-checksum.json -execdir "$scriptdir/debian/prune-checksu
sed -i -e 's/dev: 1/#dev: 1/g' src/stage0.txt # allow beta builds
./x.py build nonexistent/path/to/trigger/cargo/metadata src/bootstrap
massage_lock_file() {
sed -z -e 's/\nname = /name = /g' -e 's/\nversion = /version = /g' "$1"
}
not_needed() {
diff -ru <(massage_lock_file Cargo.lock.orig) <(massage_lock_file Cargo.lock) \
| sed -ne 's/-\[\[package\]\]name = "\(.*\)"version = "\(.*\)"/\1 \2/gp'
needed_crates() {
cat Cargo.lock \
| sed -z -e 's/\nname = /name = /g' -e 's/\nversion = /version = /g' \
| sed -ne 's/\[\[package\]\]name = "\(.*\)"version = "\(.*\)"/\1 \2/gp'
}
ghetto_parse_cargo() {
@ -44,7 +41,7 @@ pruned_paths() {
exit 1
fi
echo "$pkgnamever $i"
done | grep -F -f <(not_needed) | cut '-d ' -f3 | while read x; do
done | grep -v -F -f <(needed_crates) | cut '-d ' -f3 | while read x; do
echo " $(dirname $x)"
done
}