-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add cargo watch #9339
Comments
@Zerotask, I usage the cargo-watch package and is like nodemon. Why do you think that is necessary include this on cargo if the package cargo-watch solve this problem? When I need make any tests without cargo, I run on homemade script like this:
Sorry if I did not understand correctly your request. |
Yes, I also mentioned this package and the reason why I think it should be added to the default toolchain of cargo. If a command is often used, one could consider to add it to the default toolchain. |
Yes! I understand your wish now and this make sense. I use every day cargo watch too. |
Hello, i'm interested in implementing this feature into cargo and as discussed in this forum post, I'm moving the conversation here. So, for starters I think this feature being a "simple" flag option to the I'm ok with things taking time, i would just appreciate some advice, if any has some. |
Just note that Cargos has a function To be fair, I don't know any details of cargo-watch. epage's suggestion seems like a great starting point to me. |
Another thing I'd add is to study multiple forms of prior art for features, pitfalls, etc so and report on them and what you suggest we should apply from them. We do this when adding commands but I suspect a |
While this might only be implemented a bit at at time, we should consider what all commands should support this. Speaking of a bit at a time, a plan for implementing this, at least from MVP to what you care about. |
I think the MVP should only care about of watching for files changes under src (or respectives if not a binary package) and then recompile it as of |
High-priority |
@zzz6519003 it helps nothing leaving a comment like “High-priority”. At this moment, cargo-watch and its underlying watchexec-cli are good alternatives before a first-party subcommand comes out. They both work seamlessly to me. Copied from epage's comment:
I think it is what to do next if someone wants to give it a try. Further more, you might want to go through a (pre-)RFC process or similar to solicit community feedback. In addition, commands other than Triage: in terms of technical details, the MVP needn't be a perfect one. I'd say the efforts level almost reaches “hard” but let's make it a medium one for now. |
Hey found out about this thread from someone linking me https://blog.rust-lang.org/inside-rust/2024/02/13/this-development-cycle-in-cargo-1-77.html — happy to answer any queries y'all might have. |
Describe the problem you are trying to solve
During development you are very often in the process of making changes and then build or run your project or run your tests. This always costs some time, therefore an automation would be useful, to save some time and increase the developer experience
Describe the solution you'd like
I'd like to have a built-in watcher similar to nodemon for NodeJS or like this project https://github.com/passcod/cargo-watch
This would allow you to run your whole project if you change something or you can also specify to run only tests when your files change:
cargo watch -x run
cargo watch -x test
Since this is completely optional to use, developers are not forced to use the suggested watcher.
Notes
The text was updated successfully, but these errors were encountered: