cargo-watch icon indicating copy to clipboard operation
cargo-watch copied to clipboard

Take local dependencies into account

Open therustmonk opened this issue 6 years ago • 4 comments

It's useful to have a capability to take local dependencies (with paths) into accounts. It's not the same #52, it's about watching for deps like these:

[dependencies]
dep1 = { path = "../libs/dep1" }
depN = { path = "../libs/depN" }

therustmonk avatar Mar 22 '19 08:03 therustmonk

@passcod I'm interested in taking this on; got any advice for where to start or should I just dive right in?

...as an aside I found this project because I have my own set of inotifywait scripts and was thinking to myself "I wonder if anyone has created cargo watch yet". Thanks for creating a super useful tool!

waynr avatar Oct 24 '19 02:10 waynr

This would be:

  1. reading the cargo.toml, which we don't do at all currently. There might be a crate that can help here? maybe cargo has a library nowadays. Otherwise, just reading and parsing the toml.
  2. Figuring what additional paths we should watch by default, i.e. the local deps as above, but also maybe we should pick up local replacements using the [replace] and [patch] sections.
  3. Adding a flag (to clap) to disable this behaviour, just in case

passcod avatar Oct 24 '19 03:10 passcod

Okay, I'm gonna try to get started on this tomorrow night or over the weekend. I wanted to get started tonight but have an early wakeup tomorrow morning. Thanks for the points!

waynr avatar Oct 25 '19 01:10 waynr

This would be useful.

An easy workaround, in the meantime, is cargo watch -w . -w "../local-dep-1" -w "../local-dep-2" [...].

d4h0 avatar Oct 18 '20 12:10 d4h0

This is in 8.2.0

passcod avatar Dec 29 '22 08:12 passcod