-
Notifications
You must be signed in to change notification settings - Fork 512
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
[v0.6.3]windows d2.exe -w is crashed. #1767
Comments
|
Strange. Can't reproduce but I've made an attempted fix on inspection of logic. We'll followup with 0.6.3 shortly. Are you sure the file wasn't auto-saving on keystrokes or something? E.g. if you type into the file, close it, and then re-open it, those aren't saved? |
reopening until confirmed fix |
i do not encounter v0.6.1. >editor.exe "sandbox.d2" a >editor.exe (exit) >d2.exe -w "sandbox.d2" (Wait for a while) <- happens! |
d2 v0.6.3 (windows)
|
it was changed watch.go when '--target' was added in v0.6.2. b0cbd66#diff-fc70cf71bc274a18a06914bfd17d043d0cdc7795896c3f1abf9597d0340c0ef5 |
I've also encountered this in v0.6.2 & 0.6.3 while v0.6.1 is fine. I did not even open any editor and just ran |
Hi, chiming in. I can confirm I also have this behavior In version 0.6.3 and 0.6.2, but it works in 0.6.1 Logs:
|
Could be a red herring, but the fsnotify watcher WatchList() function appears to be returning a different path depending on platform:
(Both results are from throwing a debug print in the pollTicker case of watch loop and running with "go run . -w test.d2 -d") Looks like at that point d2 is essentially watching for any change in the parent folder. Instead of the specified watch file. Update:
Prints: watch list: [C:\path\to] |
Had a look into the fsnotify code for Windows. IMO the In conclusion, I guess, the "The above is reproducible in a new project with just fsnotify" code needs a bit more elaboration: i.e. change file.go and change a different file and see what events are received. Currently I don't see |
Yes. The The codes introduces in this commit, which is also just the version where this issue got: v0.6.2 f328eb3#diff-fc70cf71bc274a18a06914bfd17d043d0cdc7795896c3f1abf9597d0340c0ef5L240-R255 Where it calls
So on Windows it's adding the whole directory to the watch list, and caused the infinite loop of writing and notified and re-writing the svg file. |
this have been fixed since @alixander if you would like to bump the dependency version by that commit, this issue could be fixed. |
Just did a release with the fsnotify patch. Can someone test if this is fixed? If not, it must be something in d2's code rather than dependencies |
Have tested on my two diffrent Windows machines and it seems everything is fine |
solved on v0.6.4 !!! thx. |
Thanks to @artiga033 ! 🍺 |
'detected change' occurs frequently.
i did not save 'sandbox.d2'. (only the first time)
'd2.exe' sometimes crashed.
The text was updated successfully, but these errors were encountered: