-
Notifications
You must be signed in to change notification settings - Fork 111
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
Maintenance patch. #274
base: main
Are you sure you want to change the base?
Maintenance patch. #274
Conversation
Just making notes while I figure this out.... Here are two errors related to the window build
Reverse engineering the break Change to "brotli" triggers changes to "flexilogger" So I think reverting to the change to brotli would fix the issue |
The last commit is experimental .. more work is required. |
I’m on Windows 10 and I can confirm the winapi build issue. Installing martinfrances107/cargo-leptos@98ca5bed works, but it looks like watching files isn’t functional, or at least isn’t functioning correctly, because I see a lot of these events without any sort of rebuilding (unless I restart the command, of course):
|
Updated version of notify is a major change. In this new regime "Rename" events can supply a variable number of files. Now notify is cross platform and has lots of new fine grained events. I am not sure I have preserved the intent of the original.. I am still looking at this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I am not extremely familiar with the notification code here, but I think the new version preserves the same behavior.
It does look (at least from CI) like the Windows build issue is solved, right?
Do you feel like this one is ready? Having read through it, nothing jumps out at me.
Just chiming in once more to say that cargo leptos watch still isn’t responding to file changes for me with martinfrances107/cargo-leptos@558bef52. My apologies if this is out of scope; I only started using Leptos with this branch, so I don’t know whether it’s changed behaviour or not. |
I will have another look, this issue started as a maintence patch. I tried to do the changes associated with the notfiy crate in an isolated PR as it was a project in itself. I am a big fan of keeping PRs small and isolated to one issue... BUT... here the slowly increasing complexity is justified. regarding the changes in notify.rs try_new() -- it lacks associated tests. So NEXT .. I am going to add the smallest test to trigger on change of file contents. |
The next PR is a outline of the test
I am currently "#[ignore]ing" the new test - its not passing, I am in the middle of debugging it. But I see enough detail to cause an architectural discussion in the background. from the commit log - "A structural issue, if no event is generated I am going the have to insert a timeout mechansim that says Making test dependant on a minimim execution time is borderline But in this case I think an exception has to be made? |
Cogitating on this some more . and unpicking this some more. I am about the generate the next commit From the original main branch
So next, I am restoring the debounce behaviour. In this new updated crate environment the choice is "debounce-mini" or "notify-debouncer-full". "debounce-mini" events do not contain the required information about the filename. debounced events are prefered as they are less chatty -- less events for us to process. In formal language .. just for reference here is what the notify-debounce-full crate has to say on this..
BugFix... I could start using a crate that implements a TEARDOWN feature but I am trying to keep things simple. NB a variable name change - "watcher" becomes "debouncer"
otherwise watcher.watcher().watch() is just a stutter. |
The new test passes on Linux, but not windows. The new test can be viewed a framework for drilling down and identifying the Events that windows is issuing and I am not seeing on my OS. My current thought is there are lots of fine grained Events like ModifyKind::Other |
Nuts, I thought I had covered all the corner cases... At the moment I can't see a way forward... More on the weekend. |
The expected debug is missing from build artefacts - implying no events are emitted. This warning/filename conflict is interesting -- could the file creation / modification be silently failing !!!
|
I am about to publish a new commit. The only clue in the test artefacts is a "project conflict" [ project2 ] which I was reusing for the new test. So my response is to hive off a new cargo project, named "notify" and use that soley for the test [ change_file_contents()]. In terms of review .. I think that this is going to have to be refactored .. but I want something that passes. |
So after that isolation refactor .. those conflict warnings persist, and so they are not related to the new test.. The debug message I added shows "events" are being generated... So it looks to me, the root problem is a "window" specific misconfiguration Hmm, I am not sure what to try next. |
I haven't gone back through and re-read everything after my comments a couple weeks ago. @shivjm Could you clarify: If you If it does work on the current, published version then I guess it's something in the update/PR that breaks file-watching on Windows in particular. If it does not work on the current, published version, then it seems unrelated to this PR and maybe more specific to your setup (although since the test is failing in Windows CI, that is maybe less likely) Thanks! |
@gbj The published version works perfectly with --locked, which I hadn’t tried before. In that version, cargo leptos watch is able to detect changes and reload automatically as it should. Thanks! Without --locked, I get the winapi error from earlier in this thread and can’t install the package. With this branch, no changes are detected. |
Checked cargo outdated again ... fixed a couple of issues. |
From my comments above
I have now set the watchdog timeout to 4s .. this well above what I think is reasonable. |
Hmm, that maybe a intresting data point Now the new test fails in "macros-latest" ... that is when I updat the dependencies within the examples directory. I wonder if I can use this is identify the sub-module that is causing the failure on windows but not on linux....Hope fully it will be a small list. |
Do you think this is ready for merge? |
No, the only remaining issues is why does the new test "change_file_contents()" pass on ubuntu but timesout of Windows. PS thanks for all the micro merges recently .. The PR here is smaller. I need more time to reason this out.. |
#295 has just demonstrated that bumping for zip isolation is problematic for Windows targets only. The next step here is to back out changes to the zip crate so they can be dealt with in isolation |
Minimal setup to assert that when a file is changed the appropiate watch event is triggered. A structural issue, if no event is generated then the test hangs. NB. The is currently a work in progress.
* Plumbed in the 500ms timeout failure mecahnism. -- Now using #[tokio::test] * Now using the more idomatic "one shot" channel for the success signal. * Now have separation between initial creation of the file and is subsequent reopening -- previously I was using the create file handle to do the "modification" write. * Implemented the "Teardown" - removal of the file. NB test is still not working.
…o shorter than the watchdog timeout.
The new test change_file_contents() now passes.
Better handling of ModifyKind::Name, ModifyKind::Other, ModifyKind::Any
…for the test the run in isolation.
lightningcss now using v1.0.0-alpha.57 zip now using version 2.1 Also removed debug print
…l environment is running slowly.
Updated lots of dependencies, bringing 3 Cargo.lock files upto date. In particular upgrading leptos submodules ... I had to drop the no longer needed cx variable. For example :- ```rustlang -pub fn App(cx: Scope) -> impl IntoView { - provide_meta_context(cx); +pub fn App() -> impl IntoView { view! { - cx, <div> ```
…with by other PRs.
What was a panic!() is now returns None, Removed debug_assert just in case it is causing issues.
I am still working on this as and when I get a new idea. Here is the current state of things. based on shivjm reporting .. on his setup windows issues an event which we consume correclty ... It the windows tests only, which are broken.For some reason no event is generated. So that has me looking the notify crates doc for windows specific config that I may be missing this new test is the first tokio test ( see #[tokio::test] ) Maybe instead of windows specific it is tokio specific? one sec will submit a new commit based on |
Ran the standard battery of checks and fixed up deprectaed issues, clippy warnings etc.
Lots of packges updated. In particular lightningcss moved from 47-55(alpha) This is a essential first step in resolving outstanding lightningcss issues.
Hightlights :-
Clippy now making use of .flatten()
Fixed 5 deprecated issues of all of the form :-
```console warning: use of deprecated macro
assert_display_snapshot
: use assert_snapshot!() instead --> src/compile/tests.rs:62:5 |62 | assert_display_snapshot!(cargo, @"cargo build --package=example --bin=example --no-default-features --features=ssr");
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(deprecated)]` on by default
PS Notify is 2 major number behind .. I am going to create a separate PR with Notifty only changes.