Giter Club home page Giter Club logo

cargo-cache's People

Contributors

afnanenayet avatar byron avatar matthiaskrgr avatar peter-kehl avatar quarticcat avatar rbtcollins avatar regexident avatar spaceface16518 avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cargo-cache's Issues

fix paths on windows

#22 (comment)
would remove directory 'C:\Users\Ibrahim.Dursun\.cargo\registry/src/'

There's probably some Path::from("a/b/c").push("d") somewhere.
I assume this can be fixed by doing Path::from("a").push("b").push("c").push("d") etc.

compile with stable

Please as soon as 1.30 becomes stable remove the requirement of nightly, because i like to use this package to reduce disk space and don't want to download another version of the compiler to do so.

thread 'main' panicked at 'called `Result::unwrap()`

I‘m getting

➜  ~ RUST_BACKTRACE=1 cargo cache
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 20, kind: Other, message: "Not a directory" }', src/libcore/result.rs:999:5
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
   1: std::panicking::default_hook::{{closure}}
   2: std::panicking::rust_panic_with_hook
   3: std::panicking::continue_panic_fmt
   4: rust_begin_unwind
   5: core::panicking::panic_fmt
   6: core::result::unwrap_failed
   7: cargo_cache::cache::registry_cache::RegistryCache::files
   8: cargo_cache::dirsizes::DirSizes::new
   9: cargo_cache::main
  10: std::rt::lang_start::{{closure}}
  11: main

on macOS 10.14.2.

build failure of cargo dependency

I've tried both stable and nightly channel but it keeps on failing to compile. I've tried both the crate release and the latest from git but the same error message appears.

error: failed to compile `cargo-cache v0.1.2 (https://github.com/matthiaskrgr/cargo-cache#7b808792)`, intermediate artifacts can be found at `/tmp/cargo-install3Mt63g`

I'm not that familiar with rust so I don't really know what's happening here.

Panic when a directory is missing

I first cleared all my caches by running cargo cache --remove-dirs all.
Then I ran the command cargo cache --top-cache-items 10 to check everything was in order, but I got a panic:

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }', libcore/result.rs:983:5
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
             at libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::panicking::default_hook::{{closure}}
             at libstd/sys_common/backtrace.rs:71
   2: std::panicking::rust_panic_with_hook
             at libstd/panicking.rs:227
             at libstd/panicking.rs:477
   3: std::panicking::continue_panic_fmt
             at libstd/panicking.rs:391
   4: rust_begin_unwind
             at libstd/panicking.rs:326
   5: core::panicking::panic_fmt
             at libcore/panicking.rs:77
   6: core::result::unwrap_failed
   7: cargo_cache::library::get_top_crates
   8: cargo_cache::main
   9: std::rt::lang_start::{{closure}}
  10: main
  11: __libc_start_main
  12: _start

The tool should probably check for missing directories and simply ignore them if they don't exist (treat them as if they're empty).

better top crates formatting

cargo cache -t 1

Summary of: /home/matthias/.cargo/bin/ (686.11 MB total)
racer                           size: 89.81 MB

Summary of: /home/matthias/.cargo/registry/src/ (777.78 MB total)
openblas-src                   src ckt: 1   src avg: 112.12 MB    total: 112.12 MB

Summary of: /home/matthias/.cargo/registry/cache/ (1.02 GB total)
mozjs_sys                       src ckt: 7   src avg:  29.40 MB    total: 205.80 MB

Summary of: /home/matthias/.cargo/git/db/ (939.09 MB total)
polonius             src ckt: 1   src avg: 136.49 MB    total: 136.49 MB

Summary of: /home/matthias/.cargo/git/checkouts/ (109.95 MB total)
rust-clippy src ckt: 3   src avg:  17.39 MB    total: 52.17 MB

this looks kinda bad.

Maybe it is possible to first get the maximum needed padding and sort the vector and then insert the padding afterwards? Sounds like it would be slower than the current approach though..

better default output

ideas:

Total size:                             2.55 GB
Size of 102 installed binaries:           919.47 MB
Size of registry:                         636.99 MB
Size of registry index:                     71.06 MB
Size of 3545 crate archives:                565.93 MB
Size of 0 crate source checkouts:           0 B
Size of git db:                           996.56 MB
Size of 113 bare git repos:                 996.56 MB
Size of 0 git repo checkouts:               0 B


Total size:                     2.55 GB
102 installed binaries:           919.47 MB
registry:                         636.99 MB
registry index:                     71.06 MB
3545 crate archives:                565.93 MB
0 crate source checkouts:           0 B
git db:                           996.56 MB
113 bare git repos:                 996.56 MB
0 git repo checkouts:               0 B


Total size:                               2.55 GB
  Size of 102 installed binaries:         919.47 MB
    Size of registry:                     636.99 MB
    Size of registry index:               71.06 MB
      Size of 3545 crate archives:        565.93 MB
      Size of 0 crate source checkouts:   0 B
    Size of git db:                       996.56 MB
      Size of 113 bare git repos:         996.56 MB
      Size of 0 git repo checkouts:       0 B


Total size:                                 2.55 GB
  Size of 102 installed binaries:         919.47 MB
    Size of registry:                     636.99 MB
    Size of registry index:                71.06 MB
      Size of 3545 crate archives:        565.93 MB
      Size of 0 crate source checkouts:         0 B
    Size of git db:                       996.56 MB
      Size of 113 bare git repos:         996.56 MB
      Size of 0 git repo checkouts:             0 B


Total size:                              2.55 GB
  Installed binaries:          102     919.47 MB
    Registry:                          636.99 MB
    Registry index:                     71.06 MB
      Crate archives:         3545     565.93 MB
      Crate source checkouts:    0           0 B
    Git db:                            996.56 MB
      Bare git repos:          113     996.56 MB
      Git repo checkouts:        0           0 B




 Total:                             2.55 GB
    102 installed binaries:         919.47 MB
    Registry:                     636.99 MB
      Registry index:              71.06 MB
      3545 crate archives:        565.93 MB
      0 crate source checkouts:         0 B
    Git db:                       996.56 MB
      113 bare git repos:         996.56 MB
      0 git repo checkouts:             0 B

-t: repo checkouts is wrong

Summary for: "/home/matthias/.cargo/git/checkouts/"
parity-ethereum     repo ckt: 1   ckt avg:   3.32 GB    total: 3.32 GB
xori                repo ckt: 1   ckt avg: 372.75 MB    total: 372.75 MB
fontsan             repo ckt: 1   ckt avg: 240.77 MB    total: 240.77 MB
mdbook              repo ckt: 1   ckt avg: 225.73 MB    total: 225.73 MB
polonius            repo ckt: 1   ckt avg: 185.00 MB    total: 185.00 MB
osmesa-src          repo ckt: 1   ckt avg: 158.28 MB    total: 158.28 MB
webrender           repo ckt: 1   ckt avg:  89.50 MB    total: 89.50 MB
alacritty           repo ckt: 1   ckt avg:  58.18 MB    total: 58.18 MB
rust-oids           repo ckt: 1   ckt avg:  50.75 MB    total: 50.75 MB
rust-rocksdb        repo ckt: 1   ckt avg:  50.24 MB    total: 50.24 MB

says 1 checkout everywhere, but its the repo name directory, need to traverse one level deeper into dir

-t: checkouts: first item is not printed

Size of 2 git repo checkouts: 15.34 MB

Summary for: "/home/matthias/.cargo/git/checkouts/"
cargo-cache repo ckt: 1   ckt avg: 679.36 KB    total: 679.36 KB

although the biggest repo was clippy (the second repo).

cmd cleanup

Use status.success() instead of stderr.contains("error") to check if command succeeded.

don't depend on git repo package

Currently cargo-cache depends on rustc_tools_util which is found in the clippy git repo.
However cargo publish does not allow this.

This needs to be worked around before publishing to crates.io.

check if cargo-cache works on windows

I have no idea if this works on windows and I don't have access to a windows machine with rust support.

Could someone using rust on windows give this a try and report back?
Any feedback is welcome! :)

cache directories

Perhaps it is possible can cache sizes of some directories for a tiny speedup?

registry command

command that lists a per-registry summary

  Registry:                          1.81 GB
    3 registry indices:            230.18 MB
    4677 crate archives:           729.52 MB
    1637 crate source checkouts:   851.50 MB

for each registry

cargo cache local fails if target dir is busy

thread '<unnamed>' panicked at 'Failed to get metadata of file '/home/matthias/vcs/github/cargo/target/debug'', src/library.rs:162:37
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
             at src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:39
   1: std::sys_common::backtrace::_print
             at src/libstd/sys_common/backtrace.rs:71
   2: std::panicking::default_hook::{{closure}}
             at src/libstd/sys_common/backtrace.rs:59
             at src/libstd/panicking.rs:197
   3: std::panicking::default_hook
             at src/libstd/panicking.rs:211
   4: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:474
   5: std::panicking::continue_panic_fmt
             at src/libstd/panicking.rs:381
   6: std::panicking::begin_panic_fmt
             at src/libstd/panicking.rs:336
   7: cargo_cache::library::cumulative_dir_size::{{closure}}::{{closure}}
             at src/library.rs:162
   8: core::result::Result<T,E>::unwrap_or_else
             at /rustc/50a0defd5a93523067ef239936cc2e0755220904/src/libcore/result.rs:766
   9: cargo_cache::library::cumulative_dir_size::{{closure}}
             at src/library.rs:161
  10: <rayon::iter::map::MapFolder<C,F> as rayon::iter::plumbing::Folder<T>>::consume
             at /home/matthias/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-1.0.3/src/iter/map.rs:225
  11: rayon::iter::plumbing::Folder::consume_iter
             at /home/matthias/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-1.0.3/src/iter/plumbing/mod.rs:176
  12: rayon::iter::plumbing::Producer::fold_with
             at /home/matthias/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-1.0.3/src/iter/plumbing/mod.rs:108
  13: rayon::iter::plumbing::bridge_producer_consumer::helper
             at /home/matthias/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-1.0.3/src/iter/plumbing/mod.rs:418
  14: rayon::iter::plumbing::bridge_producer_consumer::helper::{{closure}}
             at /home/matthias/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-1.0.3/src/iter/plumbing/mod.rs:410
  15: rayon_core::join::join_context::{{closure}}::{{closure}}
             at /home/matthias/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-core-1.4.1/src/join/mod.rs:128
  16: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
             at /rustc/50a0defd5a93523067ef239936cc2e0755220904/src/libstd/panic.rs:309
  17: std::panicking::try::do_call
             at /rustc/50a0defd5a93523067ef239936cc2e0755220904/src/libstd/panicking.rs:293
  18: __rust_maybe_catch_panic
             at src/libpanic_unwind/lib.rs:85
  19: std::panicking::try
             at /rustc/50a0defd5a93523067ef239936cc2e0755220904/src/libstd/panicking.rs:272
  20: std::panic::catch_unwind
             at /rustc/50a0defd5a93523067ef239936cc2e0755220904/src/libstd/panic.rs:388
  21: rayon_core::unwind::halt_unwinding
             at /home/matthias/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-core-1.4.1/src/unwind.rs:18
  22: rayon_core::join::join_context::{{closure}}
             at /home/matthias/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-core-1.4.1/src/join/mod.rs:128
  23: rayon_core::registry::in_worker
             at /home/matthias/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-core-1.4.1/src/registry.rs:705
  24: rayon_core::join::join_context
             at /home/matthias/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-core-1.4.1/src/join/mod.rs:116
  25: rayon::iter::plumbing::bridge_producer_consumer::helper
             at /home/matthias/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-1.0.3/src/iter/plumbing/mod.rs:409
  26: rayon::iter::plumbing::bridge_producer_consumer::helper::{{closure}}
             at /home/matthias/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-1.0.3/src/iter/plumbing/mod.rs:413
  27: rayon_core::join::join_context::{{closure}}::{{closure}}
             at /home/matthias/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-core-1.4.1/src/join/mod.rs:122
  28: rayon_core::job::StackJob<L,F,R>::run_inline
             at /home/matthias/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-core-1.4.1/src/job.rs:96
  29: rayon_core::join::join_context::{{closure}}
             at /home/matthias/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-core-1.4.1/src/join/mod.rs:146
  30: rayon_core::registry::in_worker
             at /home/matthias/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-core-1.4.1/src/registry.rs:705
  31: rayon_core::join::join_context
             at /home/matthias/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-core-1.4.1/src/join/mod.rs:116
  32: rayon::iter::plumbing::bridge_producer_consumer::helper
             at /home/matthias/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-1.0.3/src/iter/plumbing/mod.rs:409
  33: rayon::iter::plumbing::bridge_producer_consumer::helper::{{closure}}
             at /home/matthias/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-1.0.3/src/iter/plumbing/mod.rs:410
  34: rayon_core::join::join_context::{{closure}}::{{closure}}
             at /home/matthias/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-core-1.4.1/src/join/mod.rs:128
  35: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
             at /rustc/50a0defd5a93523067ef239936cc2e0755220904/src/libstd/panic.rs:309
  36: std::panicking::try::do_call
             at /rustc/50a0defd5a93523067ef239936cc2e0755220904/src/libstd/panicking.rs:293
  37: __rust_maybe_catch_panic
             at src/libpanic_unwind/lib.rs:85
  38: std::panicking::try
             at /rustc/50a0defd5a93523067ef239936cc2e0755220904/src/libstd/panicking.rs:272
  39: std::panic::catch_unwind
             at /rustc/50a0defd5a93523067ef239936cc2e0755220904/src/libstd/panic.rs:388
  40: rayon_core::unwind::halt_unwinding
             at /home/matthias/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-core-1.4.1/src/unwind.rs:18
  41: rayon_core::join::join_context::{{closure}}
             at /home/matthias/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-core-1.4.1/src/join/mod.rs:128
  42: rayon_core::registry::in_worker
             at /home/matthias/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-core-1.4.1/src/registry.rs:705
  43: rayon_core::join::join_context
             at /home/matthias/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-core-1.4.1/src/join/mod.rs:116
  44: rayon::iter::plumbing::bridge_producer_consumer::helper
             at /home/matthias/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-1.0.3/src/iter/plumbing/mod.rs:409
  45: rayon::iter::plumbing::bridge_producer_consumer::helper::{{closure}}
             at /home/matthias/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-1.0.3/src/iter/plumbing/mod.rs:410
  46: rayon_core::join::join_context::{{closure}}::{{closure}}
             at /home/matthias/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-core-1.4.1/src/join/mod.rs:128
  47: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
             at /rustc/50a0defd5a93523067ef239936cc2e0755220904/src/libstd/panic.rs:309
  48: std::panicking::try::do_call
             at /rustc/50a0defd5a93523067ef239936cc2e0755220904/src/libstd/panicking.rs:293
  49: __rust_maybe_catch_panic
             at src/libpanic_unwind/lib.rs:85
  50: std::panicking::try
             at /rustc/50a0defd5a93523067ef239936cc2e0755220904/src/libstd/panicking.rs:272
  51: std::panic::catch_unwind
             at /rustc/50a0defd5a93523067ef239936cc2e0755220904/src/libstd/panic.rs:388
  52: rayon_core::unwind::halt_unwinding
             at /home/matthias/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-core-1.4.1/src/unwind.rs:18
  53: rayon_core::join::join_context::{{closure}}
             at /home/matthias/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-core-1.4.1/src/join/mod.rs:128
  54: rayon_core::registry::in_worker
             at /home/matthias/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-core-1.4.1/src/registry.rs:705
  55: rayon_core::join::join_context
             at /home/matthias/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-core-1.4.1/src/join/mod.rs:116
  56: rayon::iter::plumbing::bridge_producer_consumer::helper
             at /home/matthias/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-1.0.3/src/iter/plumbing/mod.rs:409
  57: rayon::iter::plumbing::bridge_producer_consumer::helper::{{closure}}
             at /home/matthias/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-1.0.3/src/iter/plumbing/mod.rs:410
  58: rayon_core::join::join_context::{{closure}}::{{closure}}
             at /home/matthias/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-core-1.4.1/src/join/mod.rs:128
  59: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
             at /rustc/50a0defd5a93523067ef239936cc2e0755220904/src/libstd/panic.rs:309
  60: std::panicking::try::do_call
             at /rustc/50a0defd5a93523067ef239936cc2e0755220904/src/libstd/panicking.rs:293
  61: __rust_maybe_catch_panic
             at src/libpanic_unwind/lib.rs:85
  62: std::panicking::try
             at /rustc/50a0defd5a93523067ef239936cc2e0755220904/src/libstd/panicking.rs:272
  63: std::panic::catch_unwind
             at /rustc/50a0defd5a93523067ef239936cc2e0755220904/src/libstd/panic.rs:388
  64: rayon_core::unwind::halt_unwinding
             at /home/matthias/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-core-1.4.1/src/unwind.rs:18
  65: rayon_core::join::join_context::{{closure}}
             at /home/matthias/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-core-1.4.1/src/join/mod.rs:128
  66: rayon_core::registry::Registry::in_worker_cold::{{closure}}
             at /home/matthias/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-core-1.4.1/src/registry.rs:356
  67: <rayon_core::job::StackJob<L,F,R> as rayon_core::job::Job>::execute::{{closure}}
             at /home/matthias/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-core-1.4.1/src/job.rs:113
  68: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
             at /rustc/50a0defd5a93523067ef239936cc2e0755220904/src/libstd/panic.rs:309
  69: std::panicking::try::do_call
             at /rustc/50a0defd5a93523067ef239936cc2e0755220904/src/libstd/panicking.rs:293
  70: __rust_maybe_catch_panic
             at src/libpanic_unwind/lib.rs:85
  71: std::panicking::try
             at /rustc/50a0defd5a93523067ef239936cc2e0755220904/src/libstd/panicking.rs:272
  72: std::panic::catch_unwind
             at /rustc/50a0defd5a93523067ef239936cc2e0755220904/src/libstd/panic.rs:388
  73: rayon_core::unwind::halt_unwinding
             at /home/matthias/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-core-1.4.1/src/unwind.rs:18
  74: <rayon_core::job::StackJob<L,F,R> as rayon_core::job::Job>::execute
             at /home/matthias/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-core-1.4.1/src/job.rs:113
  75: rayon_core::job::JobRef::execute
             at /home/matthias/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-core-1.4.1/src/job.rs:60
  76: rayon_core::registry::WorkerThread::execute
             at /home/matthias/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-core-1.4.1/src/registry.rs:584
  77: rayon_core::registry::WorkerThread::wait_until_cold
             at /home/matthias/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-core-1.4.1/src/registry.rs:568
  78: rayon_core::registry::WorkerThread::wait_until
             at /home/matthias/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-core-1.4.1/src/registry.rs:544
  79: rayon_core::registry::main_loop
             at /home/matthias/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-core-1.4.1/src/registry.rs:666
  80: rayon_core::registry::Registry::new::{{closure}}
             at /home/matthias/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-core-1.4.1/src/registry.rs:135

Need a hand?

Hi, do you have any idea when you will a have a first release of this crate? This is a nice functionality to have since cargo does not support it natively and I'm sure many would appreciate it. I would like to help you publish a first version. Do you a have a list of things to be done before the first release?

option to clean crate graph leaves

clean all crate archives that no other package depends on.

Probably tricky and I might have to read dep graphs of every local crate archive from crates io.

crash when no options passed

When running cargo cache, we accept args as args to the cache subcmd, however if we run without options, we crash because cargo_show_cfg.subcommand_matches("cache").unwrap(); becomes None due to missing subcommand.
We need to somehow also have options when running without subcommand like cargo-cache or cargo-cache --list

CARGO_HOME for testing

quick idea dump: we can export CARGO_HOME and build a package in this controlled enviroment and then check that our results are accordingly.

Error installing

$ cargo --version
cargo 1.28.0 (96a2c7d16 2018-07-13)
$ cargo install --git https://github.com/matthiaskrgr/cargo-cache
    Updating git repository `https://github.com/matthiaskrgr/cargo-cache`
error: no packages found with binaries or examples

more lints?

perhaps enable
RUSTFLAGS="-Wunused-extern-crates -Wunused-import-braces -Wunused-labels -Wunused-lifetimes -Wunused-qualifications -Wunused-results"

currently unused-results triggers for .pop() and unused-qualifications triggers for library::pad_strings()

test cleanup

    let cargo_home = "target/alt_registries_CARGO_HOME/";

    // in the fake CARGO_HOME, install cargo-cache via git
    let command = Command::new("cargo")
        .arg("install")
        .arg("--git")
        .arg("https://github.com/matthiaskrgr/cargo-cache")
        .arg("--debug")
        .arg("--force")
        //        .current_dir(&crate_path)
        .env(
            "CARGO_TARGET_DIR",
            "target/alt_registries_CARGO_HOME/",
        )
        .env("CARGO_HOME", "target/

the variable should be used in the cmd, seen in at least 2 tests.

Recommend Projects

  • React photo React

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

  • Vue.js photo Vue.js

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

  • Typescript photo Typescript

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

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

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

Recommend Topics

  • javascript

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

  • web

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

  • server

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

  • Machine learning

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

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

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

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.