-
Notifications
You must be signed in to change notification settings - Fork 110
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
watch
ignores Rust's build system dependency tracking
#187
Comments
For my crate Maybe this could help! |
True! |
With #191 merged, I'm closing this. Feel free to comment if this isn't resolved |
This is still a problem. The original issue is that the current implementation of Fixing this will also help supporting the path tracking api. |
@myFavShrimp I'll reopen this because the change in #191 is a workaround, not the root issue, although it certainly seems capable of handling the case you originally listed. To be honest, it's unlikely that any of us will have time to look at the refactoring needed to use Rust's build system rather than the custom file watching here. Would you like to look into it and consider making a PR? |
I've made #191 originally for my crate leptos_i18n, and I've explored the tracking API linked by @myFavShrimp and it's a really good ressource, so I've implemented it for nightly and did some tests. the unstable API works but if I track the files in the macro without adding the files as dependencies for cargo leptos the problem still remains, there is no rebuild done. I don't know how cargo-leptos can go around this problem and track proc macro dependencies, this should be done by the maintainers of those macros. What I don't understand is how PR for the implementation: Baptistemontan/leptos_i18n#93 |
I can work on this when I have a clearer picture of what actually should be done. I took a quick look at what trunk and cargo-watch do. Both seem to simply watch the project directory for changes and trigger a rebuild when something changes. Cargo's build process then takes the tracked files into account and determines whether the project has to be rebuild or not. Is this behavior desired for cargo-leptos? |
What behavior are you referencing? The option trunk offer for additional paths to watch? This is what I implemented with #191 |
Sorry I should have been clearer. I did a quick test to see what similar tools do to achieve rebuilds when tracked files change (specifically trunk and cargo-watch). None of them seem to interact with Rust's build system directly. They just watch the whole project directory for changes and trigger a regular build when a file changes. Cargo's build process then takes the tracked files into account and determines whether the project has to be rebuild or not.
This is indeed similar to what you have implemented but the key difference is that all files are being watched by default and there is the option to configure an ignore list. I could not find any other way to achieve rebuilds when tracked files change.
What I mean by this question: |
All files? Like CSS, images, fonts, etc. etc.? |
There are two exceptions. |
I just want to report that I have a possibly related issue: When I watch a sub-project (examples/my-test-app) that's part of the workspace, it won't track source files in the parent workspace even though the main crate is set as a path dependency. Confusingly, it did seem to work with dependencies that are in a completely different folder. |
When making changes to files included using the
include_bytes!
macro, such asinclude_bytes!("track.me")
, changes to the track.me file do not trigger recompilation when usingcargo leptos watch
.Using a
build.rs
with the contentsdoesn't trigger recompilation either.
The text was updated successfully, but these errors were encountered: