| Crates.io | cargo-lpatch |
| lib.rs | cargo-lpatch |
| version | 0.1.0 |
| created_at | 2025-08-14 05:21:05.566284+00 |
| updated_at | 2025-08-14 05:21:05.566284+00 |
| description | A cargo plugin to locally patch dependencies by cloning them and setting up local patches |
| homepage | |
| repository | https://github.com/rcore-os/cargo-lpatch |
| max_upload_size | |
| id | 1794452 |
| size | 145,521 |
A cargo plugin to locally patch dependencies by cloning them and setting up local patches in .cargo/config.toml.
cargo install --path .
Or install from crates.io (once published):
cargo install cargo-lpatch
Patch a crate from crates.io:
cargo lpatch --name serde
This will:
serde crate's repository URLcrates/serde/.cargo/config.tomlSpecify a custom directory for cloning:
cargo lpatch --name serde --dir my-dependencies
You can also provide a direct git URL instead of a crate name:
cargo lpatch --name https://github.com/serde-rs/serde.git
or
cargo lpatch --name git@github.com:serde-rs/serde.git
Crate Resolution: If you provide a crate name, the tool queries crates.io API to get the repository URL. If you provide a git URL, it uses that directly.
Repository Cloning: The tool clones the repository to the specified directory (default: crates/).
Configuration Update: The tool creates or updates .cargo/config.toml with a local patch configuration pointing to the cloned repository.
After running the tool, your .cargo/config.toml will contain something like:
[patch.crates-io]
serde = { path = "crates/serde" }
This tells Cargo to use the local version of the crate instead of downloading it from crates.io.
cargo lpatch --name serde --dir deps
cargo lpatch --name tokio --dir deps
cargo lpatch --name clap --dir deps
cargo lpatch --name git@github.com:myorg/private-crate.git --dir vendor
.cargo/config.toml managementgit pullLicensed under either of
at your option.