flâneur — a map of the web's best reading

Overriding Dependencies - The Cargo Book

doc.rust-lang.org · 2,207 words · saved by 1 readers

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