Extends cargo to execute the given command on multiple crates - upstream is at

Overview

cargo-multi

Crates.io Coverage Status

GitLab CI: master: build status develop: build status

Travis: master: Build Status develop: Build Status

Extends cargo to execute the given command on multiple crates. Inspired by git multi. First cargo-multi checks current directory for cargo workspaces and if found executes a given command in each workspace. Alternatively cargo-multi executes a given command in each crate found in the current directory.

Installation

Use cargo to install this subcommand

cargo install cargo-multi

Usage

Run cargo multi <cargosubcommand> in the directory where you keep your crates.

cargo multi update
cargo multi build
cargo multi test

Example

$ cargo multi update
----------------------
Executing cargo update
----------------------
cargo:
        Updating registry `https://github.com/rust-lang/crates.io-index`
        Updating git2 v0.3.5 -> v0.3.4
        Removing libgit2-sys v0.4.0
        Updating nom v1.2.0 -> v1.2.1
        Updating num_cpus v0.2.10 -> v0.2.11
        Updating regex v0.1.52 -> v0.1.54
        Updating regex-syntax v0.2.3 -> v0.2.5
        Updating tar v0.4.3 -> v0.4.4
        Removing unicode-bidi v0.2.3
        Removing unicode-normalization v0.1.2
        Removing url v0.5.5

cargo-multi:
        Updating registry `https://github.com/rust-lang/crates.io-index`

elm:
        Updating registry `https://github.com/rust-lang/crates.io-index`

gitlab-rs:
        Updating registry `https://github.com/rust-lang/crates.io-index`

hyper:
        Updating registry `https://github.com/rust-lang/crates.io-index`
        Updating num_cpus v0.2.10 -> v0.2.11
        Updating regex v0.1.52 -> v0.1.54
        Updating regex-syntax v0.2.3 -> v0.2.5
        Updating serde v0.6.14 -> v0.6.15
        Updating unicase v1.2.1 -> v1.3.0

json:
        Updating registry `https://github.com/rust-lang/crates.io-index`
        Updating serde v0.6.14 -> v0.6.15

rass:
        Updating registry `https://github.com/rust-lang/crates.io-index`

requests-rs:
        Updating registry `https://github.com/rust-lang/crates.io-index`
        Updating num_cpus v0.2.10 -> v0.2.11
        Updating serde v0.6.14 -> v0.6.15
        Updating unicase v1.2.1 -> v1.3.0

syncthing-rs:
        Updating registry `https://github.com/rust-lang/crates.io-index`
        Updating regex v0.1.53 -> v0.1.54
        Updating regex-syntax v0.2.4 -> v0.2.5

trust:
        Updating registry `https://github.com/rust-lang/crates.io-index`
        Removing aho-corasick v0.5.1
        Removing docopt v0.6.78
        Removing memchr v0.1.10
        Removing regex v0.1.54
        Removing regex-syntax v0.2.5
        Removing rustc-serialize v0.3.18
        Removing strsim v0.3.0
        Removing utf8-ranges v0.1.3
Comments
  • Clap now swallows bare `--`

    Clap now swallows bare `--`

    This was fine when using clap 2.20.5. However, since updating to 2.21 (or above), I've started getting the following:

    $ cargo multi fmt -- --write-mode=diff
    -------------------------------------
    Executing cargo fmt --write-mode=diff
    -------------------------------------
    
    crate1:
    Unrecognized option: 'write-mode'.
    usage: cargo fmt [options]
    
    Options:
        -h, --help          show this message
        -q, --quiet         no output printed to stdout
        -v, --verbose       use verbose output
        -p, --package <package>
                            specify package to format (only usable in workspaces)
            --all           format all packages (only usable in workspaces)
    
    This utility formats all bin and lib files of the current crate using rustfmt. Arguments after `--` are passed to rustfmt.
    
    crate2:
    Unrecognized option: 'write-mode'.
    usage: cargo fmt [options]
    ...
    

    Something has changed with the way clap handles arguments: it seems to silently swallow any number of bare --s. I'm not sure why this is, though.

    Alternatively, pinning to a known-good version would suffice (`"~2.20.0").

    opened by BenjaminGill-Metaswitch 3
  • Upstream appears dead

    Upstream appears dead

    https://gitlab.com/imp/cargo-multi gives me a 404, that's also the only place linked to from https://crates.io/crates/cargo-multi so if it's gone for good it would be nice to update the links there.

    opened by Nemo157 2
  • Add --manifest-path to commands to allow warnings to be displayed correctly

    Add --manifest-path to commands to allow warnings to be displayed correctly

    This adds the manifest path option to commands run, this ensures that all warnings are relative to the current directory, rather than having warnings about main.rs and being unable to determine which crate has the warning was present in.

    opened by cswindle 2
  • Add support for Cargo workspaces

    Add support for Cargo workspaces

    This pull request add the ability for cargo multi to run the cargo commands across any crates in the workspace members section of a Cargo.toml file in the current directory, if there are none then it just reverts to the old behavior. I have also added that the first error code reported gets returned by cargo multi to make it easier for scripts using cargo multi.

    opened by cswindle 2
  • feature request: multi-publish

    feature request: multi-publish

    Hi,

    this looks like a great tool to do multi-crate publishing. What I mean: I have a project where a lot of crates live within the same repository (imag). All of these crates depend on each other (well, it is a tree-ish structure, not a circle of course). I released my first version (0.2.0) some days ago. I did it with this script:

    while true; do 
       for dir in *; pushd "$dir"; cargo publish; popd; done
    done
    

    (not exactly that script, but you get the gist of it)

    Another possibility would be to manually find the dependency tree and do it by hand. Or, and that's what I'm suggesting: using a tool for it which internally gets the dependency tree of all crates to work on and cargo publish them in the right order.

    TL;DR: allow me to cargo multi publish a set of crates that might depend on eachother and optimize this process to publish them in the right order (so, crates at the root of the dependency tree first, others later).

    opened by matthiasbeyer 1
Crates - A collection of open source Rust crates from iqlusion

iqlusion crates ?? This repository contains a set of Apache 2.0-licensed packages (a.k.a. "crates") for the Rust programming language, contributed to

iqlusion 335 Dec 26, 2022
cargo-crev to cargo-vet code review exporter

cargo-crev to cargo-vet converter Crev and Vet are supply-chain security tools for auditing Rust/Cargo dependencies. This tool (crevette) is a helper

crev - Code REView system 3 Dec 6, 2023
Trustworthy encrypted command line authenticator app compatible with multiple backups.

cotp - command line totp authenticator I believe that security is of paramount importance, especially in this digital world. I created cotp because I

Reply 71 Dec 30, 2022
A contract to lock fungible tokens with a given vesting schedule including cliffs.

Fungible Token Lockup contract Features A reusable lockup contract for a select fungible token. Lockup schedule can be set as a list of checkpoints wi

null 15 Dec 16, 2022
Generates a unique hash/identifier for a system given a set of parameters.

uniqueid ?? Generates a unique hash/identifier for a system given a set of parameters. Example usage use uniqueid; pub fn main() { let data = vec

Checksum 2 Aug 19, 2022
Formats output of Solana's cargo test-bpf/test-sbf command

solfmt Formats output of Solana's cargo test-bpf/test-sbf command. Installation cargo install solfmt Usage Run the your test command as usual (cargo t

Thorsten Lorenz 4 Dec 22, 2022
Temporary edit external crates that your project depends on

rhack You want to quickly put a sneaky macro kind of like dbg! into external crates to find out how some internal data structure works? If so rhack is

Ryo Nakao 119 Nov 3, 2022
A Rust binary for file encryption to multiple participants.

Kaspa-miner A Rust binary for file encryption to multiple participants. Installation From Sources With Rust's package manager cargo, you can install k

Elichai Turkel 31 Dec 30, 2022
Bulletproofs and Bulletproofs+ Rust implementation for Aggregated Range Proofs over multiple elliptic curves

Bulletproofs This library implements Bulletproofs+ and Bulletproofs aggregated range proofs with multi-exponent verification. The library supports mul

[ZenGo X] 62 Dec 13, 2022
Git FIDO Helper - Sign your Git commits with multiple resident SSH keys

gfh Git FIDO helper, or God Fucking Help me. gfh is a tool for helping you sign your commits in Git with resident SSH keys stored on multiple FIDO dev

Michael Mitchell 16 Nov 30, 2022
An open source Rust high performance cryptocurrency trading API with support for multiple exchanges and language wrappers. written in rust(🦀) with ❤️

Les.rs - Rust Cryptocurrency Exchange Library An open source Rust high performance cryptocurrency trading API with support for multiple exchanges and

Crabby AI 4 Jan 9, 2023
Mequeue is an executor for MEV bots optimized to be able to process multiple transactions concurrently.

Mequeue Mequeue is an executor for MEV bots optimized to be able to process multiple transactions concurrently. The main goal is to make this executor

null 13 Oct 3, 2023
A cryptographically verifiable code review system for the cargo (Rust) package manager.

A cryptographically verifiable code review system for the cargo (Rust) package manager.

crev - Code REView system 1.8k Jan 2, 2023
✈️A private, authenticated, permissioned cargo registry

chartered a little dig at creating a private cargo repository with authenticated downloads, the plan is to have git connect to a git server we setup t

Jordan Doyle 121 Dec 26, 2022
Audit Cargo.lock files for dependencies with security vulnerabilities

RustSec Crates ?? ??️ ?? The RustSec Advisory Database is a repository of security advisories filed against Rust crates published via crates.io. The a

RustSec 1.2k Dec 30, 2022
A cargo subcommand for displaying when Rust dependencies are out of date

cargo-outdated Linux: A cargo subcommand for displaying when Rust dependencies are out of date About cargo-outdated is for displaying when dependencie

Kevin K. 911 Dec 30, 2022
A minimal esp-hal application template for use with cargo-generate

{{ project-name }} A minimalist template for use with cargo-generate to create no_std applications targeting Espressif's line of SoCs and modules. At

esp-rs 35 Dec 29, 2022
cargo-generate template for Criterion benchmarks

Criterion Benchmark Template This is a cargo-generate template for quickly creating benchmarks using the Criterion benchmarking framework. Usage $ car

Lily Mara 4 Jan 19, 2023
Cargo features alignment tool.

Cargo Featalign Cargo features alignment tool. Introduction The original version of this project can be found at subalfred check features. Upon furthe

Hack Ink 4 Jul 30, 2023