#cargo-command #patch #command #cargo #command-line

app dependencies-patch

A simple tool to patch cargo dependencies with command line commands

3 releases (breaking)

0.3.0 Jun 3, 2024
0.2.0 May 19, 2024
0.1.0 May 19, 2024

#104 in Cargo plugins

Download history 134/week @ 2024-05-13 141/week @ 2024-05-20 19/week @ 2024-05-27 250/week @ 2024-06-03

544 downloads per month

MIT license

26KB
475 lines

dependencies-patch

A simple tool to patch cargo dependencies with command line commands.

Todo List

  • Support for packages from github
  • Support for packages from other URL
  • Support for packages from crates-io
  • Support for packages from other registries

Installation

$ cargo install dependencies-patch

Usage

The Cargo.toml for example_project looks like this:

[package]
edition = "2021"
name = "project1"
version = "0.1.0"

[workspace]

[dependencies]
log = "0.4"

Then run the following command to patch the log dependency to a git repository:

$ dependencies-patch --help
$ dependencies-patch -c /path/to/example_project -n log -t git --git-repo rust-lang/log

After running the command, the Cargo.toml will be updated to:

[package]
edition = "2021"
name = "project1"
version = "0.1.0"

[workspace]

[dependencies]
log = "0.4"

[patch.crates-io.log]
git = "https://github.com/rust-lang//log.git"

Notes

The tool can only add patches to the Cargo.toml file. It don't support removing patches.

Dependencies

~2.4–3.5MB
~63K SLoC