Crates.io | cargo-pando |
lib.rs | cargo-pando |
version | 0.3.0 |
source | src |
created_at | 2019-01-08 03:41:33.806099 |
updated_at | 2019-11-07 22:20:17.753922 |
description | Perform tasks concurrently over multiple copies of your repo, over multiple toolchains and/or git revisions. |
homepage | |
repository | https://github.com/KevinMGranger/cargo-pando |
max_upload_size | |
id | 106225 |
size | 83,162 |
Perform tasks concurrently over multiple copies of your repo.
The name pando comes from the clonal colony of "multiple" trees that are actually one single organism. It is latin for "I spread out".
HERE BE DRAGONS. This extension is in the early stages of development and may cause data loss or worse. Only use if you're very comfortable with git and have backups.
There may also be backwards incompatible changes for each version.
Will be easily installable from crates.io once it's more mature.
git clone (repo url here)
cd cargo-pando
cargo install --path .
Upgrading
git pull origin master
cargo install --path . --force
.travis.yml
, or just using all the installed ones.target/pando
per toolchain, e.g. target/pando/1.31.0
. Note that this is destructive.
The configured target dir in your cargo config is respected.rustup run TOOLCHAIN_HERE cargo test
or some other action in each copy of the repo-- in parallel.
For example, cargo +1.31.0 test
in target/pando/1.31.0/working_dir
.Output is logged to target/pando/TOOLCHAIN_HERE/output
, and each line is printed next to the progress bar for the checkout.
If your tests rely on external resources, keep in mind they won't be in the expected location.
If there are exclusive resources, you'll have to synchronize access yourself.
More parallelism doesn't always make things faster, especially since compilation can be IO intensive as well as CPU intensive.
See cargo pando help
for more details.
Test the working directory against the toolchains listed in .travis.yml
:
cargo pando test
Test against every installed toolchain except the default,
limiting it to 2 cargo test
s at any given time:
cargo pando --all test -j 2
Test each specified toolchain, but only doc tests:
cargo pando -t stable -t beta test -- --doc
If you want to run a single command across all of the checkouts at once, use print, cut, and xargs:
cargo pando print | cut -f 2 | xargs ls
Run an arbitrary command against each checkout, substituting the name of the toolchain where applicable:
cargo pando each echo the toolchain '{}' has been copied
If the command does not lend itself well to the single line given by the progress bars, xargs can help again:
cargo pando print | cut -f 1 | xargs -L 1 -P 2 echo the toolchain is
Test the given toolchain against the index (stage) of your repo. Useful if you're incrementally adding changes to a commit and you want to check that your work in progress still works.
cargo pando --index -t stable test
See how much space the pando directory is taking up:
du -sh target/pando
Get rid of it!
rm -rf target/pando
(I can't remember what those last two were about. Oh well.)