Running `jag watch hello.toit` does not notice whe...
# help
m
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
f
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?
m
no, other 'watching' stuff seems to work - for go stuff i usually use gow (but i think thats a little old now)
I didn't try another directory 🤔 let me try that before wasting your time
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
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?
f
Hmm. Good point. Jag might be able to compile but then something fails when sending it to the device.
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.
m
Yea, looks like watch isn't working for me
oh, if it is an error, then it does watch - so it is something else, just really slow
start with an error, create another error, and it will work (i.e. show the new error)
if I fixe the file, it takes about 10 seconds and it runs the file!
f
10s is a bit slow...
Is it also that slow when running the file directly?
m
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
no, running the file directly works instantly
f
That's not normal...
m
and the first time I run jag watch it will upload it instantly
f
If the golang library is a module we can maybe try to update it.
m
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 ¯\_(ツ)_/¯
f
Would be nice if it ends up being that easy 🙂
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
.
k
Hi @mattsoftware! Jaguar v1.8.2 is out on non-Windows platforms with the updated fsnotify.
(we also now compile the Go binary without CGO_ENABLED, so if you run into issues do let us know)
m
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!
3 Views