guild icon
Toit
#Running `jag watch hello.toit` does not notice when the hello.toit file is changed on MacOS
Thread channel in help
mattsoftware
mattsoftware 01/09/2023 11:53 PM
Following the tutorial from https://github.com/toitlang/jaguar on a mac. I can run jag monitor, and then jag run hello.toit on the simple Hello World program. When I jag run hello.toit the monitor spits out Hello World! as expected. When I run jag watch hello.toit the monitor spits out Hello World! but then any writes to the file after that does not do anything.

I have tried appending to the file on cli using echo, vim and text edit
Use live reloading over WiFI to turbo-charge developing for your ESP32. - GitHub - toitlang/jaguar: Use live reloading over WiFI to turbo-charge developing for your ESP32.
floitsch
floitsch 01/09/2023 11:57 PM
Interesting.
We are using a golang library for change detection. I will have a look later or tomorrow to see if there are known issues with that.
Is your filesystem in any way special?
mattsoftware
mattsoftware 01/10/2023 12:14 AM
no, other 'watching' stuff seems to work - for go stuff i usually use gow (but i think thats a little old now)
mattsoftware
mattsoftware 01/10/2023 12:14 AM
I didn't try another directory :🤔: let me try that before wasting your time
mattsoftware
mattsoftware 01/10/2023 12:21 AM
Right, so I noticed I was running 1.7.13 so updated to 1.8.1 and it seems to be watching. I am certain I had the watch command running a few weeks ago, but maybe I was mistaken. Sorry for the run around but at the moment it seems to be fixed
mattsoftware
mattsoftware 01/10/2023 12:25 AM
hmmm, and now I am back into my main directory running jag watch and its not working! I wonder if the watch is working, its just that jag is stuck re-compiling and not showing any console output?
floitsch
floitsch 01/10/2023 12:30 AM
Hmm. Good point. Jag might be able to compile but then something fails when sending it to the device.
floitsch
floitsch 01/10/2023 12:32 AM
That should be easy to detect: just add an error to the file and save it. If watch works then you should see the error there.
👍1
mattsoftware
mattsoftware 01/10/2023 12:41 AM
Yea, looks like watch isn't working for me
mattsoftware
mattsoftware 01/10/2023 12:42 AM
oh, if it is an error, then it does watch - so it is something else, just really slow
mattsoftware
mattsoftware 01/10/2023 12:42 AM
start with an error, create another error, and it will work (i.e. show the new error)
mattsoftware
mattsoftware 01/10/2023 12:43 AM
if I fixe the file, it takes about 10 seconds and it runs the file!
floitsch
floitsch 01/10/2023 12:43 AM
10s is a bit slow...
floitsch
floitsch 01/10/2023 12:44 AM
Is it also that slow when running the file directly?
mattsoftware
mattsoftware 01/10/2023 12:44 AM
i think its just slow. Might need a reboot - i just fixed the file and it worked - and changed the file and waiting to see if it ever updates - its been about 2 minutes with no luck
mattsoftware
mattsoftware 01/10/2023 12:44 AM
no, running the file directly works instantly
floitsch
floitsch 01/10/2023 12:44 AM
That's not normal...
mattsoftware
mattsoftware 01/10/2023 12:45 AM
and the first time I run jag watch it will upload it instantly
floitsch
floitsch 01/10/2023 12:45 AM
If the golang library is a module we can maybe try to update it.
👍1
mattsoftware
mattsoftware 01/10/2023 12:46 AM
I think i might try a reboot after work and see if that fixes it, maybe I'm running out of kernel file handles or something ¯\_(ツ)_/¯
floitsch
floitsch 01/10/2023 12:46 AM
Would be nice if it ends up being that easy :🙂:
floitsch
floitsch 01/10/2023 10:42 AM
Just created a PR to update Jaguar's dependencies.
fsnotify will go from v1.5.1 to v1.6.0. Hopefully that will improve the stability of jag watch.
bitphlipphar
bitphlipphar 01/14/2023 02:28 PM
Hi @mattsoftware! Jaguar v1.8.2 is out on non-Windows platforms with the updated fsnotify.
bitphlipphar
bitphlipphar 01/14/2023 02:56 PM
(we also now compile the Go binary without CGO_ENABLED, so if you run into issues do let us know)
mattsoftware
mattsoftware 01/15/2023 03:38 AM
Thats great Kasperl. I just checked and looks like its not the thing thats going wrong with my mac :/ As soon as I get more time I'll try and dig down into whats going on. I might need to build my own version of jaguar and add some debug statements, work out whats going on!
👍1
25 messages in total