modifying vendored Rust crates locally

With the fixes for bug 1323557 [1] and cargo-vendor issue #71 [2], it's 
now more straightforward to modify a vendored Rust crate to test changes 
locally or on tryserver.

To do so, specify the crate's vendored path in the [patch.crates-io] 
section of the top-level Cargo.toml file. For example, to modify the 
"zip" crate, add this line to that section:

zip = { path = "third_party/rust/zip" }

Then run `mach vendor rust`, which will update Cargo.lock with the 
patched location of the crate:

$ mach vendor rust
       Adding zip v0.3.1 (file:///path/to/workdir/third_party/rust/zip)
     Removing zip v0.3.1

You'll need the latest version of cargo-vendor, 0.1.14, which you can 
get via `cargo install --force cargo-vendor`.

-myk

[1] https://bugzilla.mozilla.org/show_bug.cgi?id=1323557
[2] https://github.com/alexcrichton/cargo-vendor/pull/71

0
Myk
5/14/2018 10:22:17 PM
mozilla.dev.platform 6455 articles. 0 followers. Post Follow

0 Replies
28 Views

Similar Articles

[PageSpeed] 46

Reply: