devd
devd copied to clipboard
devd doesn't listen if livewatch is specified
I have devd 0.9 on Arch Linux, installed via the AUR. I usually use devd like this:
devd -a -l -p 8000 ~/site/
After updating devd recently it stopped working; devd would start up but I couldn't connect. I played around with flags and it seems like if I use the -l
switch it never starts listening on a port (checked with lsof
). The only output is Route / -> reads files from ...
.
If take away the -l flag it starts listening as usual.
Am I doing something wrong?
Fiddling around more found something strange. The above command doesn't work, but this does:
cd ~/site/
devd -a -l . -p 8000
It seems to consistently work if the path is .
but not if it's a directory. When it doesn't work, it also uses 100% CPU.
Maybe run with strace could help see what is going on strace -f devd ...
. Look for bind failure, going thru lots of files etc
Ah, yeah, it's going through tons of files,
If the directory structure is like this:
/home/person/site
Suppose cwd is /home/person
and command is devd -l ./site
. I would expect it to only access files in site
but it seems to be checking all the files in /home/person
.
Is that correct behavior? It seems wrong to me...
Did some digging. I suspect that https://github.com/cortesi/devd/pull/95 caused devd to always add a watch for the current working directory, the **
include pattern i think will make moddatch.Watch
add it as base dir.
If you are able to build devd yourself you could try to remove the "***"
part and see if it behaves better.
@cortesi Could this be the case? as i understand in the end devd will add recursive watches for all base dirs? will that case lots of file system traversal?
Sorry, I'm not familiar enough with go to build devd. (I was able to install go and run go build
but it produced no bianries...?)