Overriding Dependencies - The Cargo Book
The desire to override a dependency can arise through a number of scenarios. Most of them, however, boil down to the ability to work with a crate before it’s been published to crates.io. For example: These scenarios can be solved with the [patch] manifest section. This chapter walks through a few different use cases, and includes details on the different ways to override a dependency. Note: See also specifying a dependency with multiple locations, which can be used to override the source for a single dependency declaration in a local package. Let’s say you’re working with the uuid crate but while you’re working on it you discover a bug. You are, however, quite enterprising so you decide to also try to fix the bug! Originally your manifest will look like: First thing we’ll do is to clone the uuid repository locally via: Next we’ll edit the manifest of my-library to contain: Here we declare that we’re patching the source crates-io with a new dependency. This will effectively add the loca
Overriding Dependencies - The Cargo Book Keyboard shortcuts Press ← or → to navigate between chapters Press S or / to search in the book Press ? to show this help Press Esc to hide this help Auto Light Rust Coal Navy Ayu The Cargo Book Overriding Dependencies The desire to override a dependency can arise through a number of scenarios. Most of them, however, boil down to the ability to work with a crate before it’s been published to crates.io . For example: A crate you’re working on is also used in a much larger application you’re working on, and you’d like to test a bug fix to the library insi
Explore this link on the map →saved by
related reading
- Semantic Versioning 2.0.0 | Semantic Versioningsemver.org
- Features - The Cargo Bookdoc.rust-lang.org
- Fixing the Dependency Confusion Vulnerability in 600+ Ruby Apps - Shopifyshopify.engineering
- Rewriting Bun in Rust | Bun Blogbun.com
- binpatch | binpatchbinpatch.p.byk.im
- Conventional Commitsconventionalcommits.org
- Hello, Cargo! - The Rust Programming Languagedoc.rust-lang.org
- Dependency Confusion: How I Hacked Into Apple, Microsoft and Dozens of Other Companies | by Alex Birsan | Mediummedium.com
- sbt Reference Manual — Library dependenciesscala-sbt.org
- The Rust Programming Language - The Rust Programming Languagedoc.rust-lang.org
- uv: An extremely Fast Python Package Manager :: Jane Streetjanestreet.com
- Niels Cautaerts - Python dependency management is a dumpster firenielscautaerts.xyz