Skip to content
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

devd doesn't listen if livewatch is specified #111

Open
polm opened this issue Apr 24, 2020 · 5 comments
Open

devd doesn't listen if livewatch is specified #111

polm opened this issue Apr 24, 2020 · 5 comments

Comments

@polm
Copy link

polm commented Apr 24, 2020

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?

@polm
Copy link
Author

polm commented Apr 24, 2020

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.

@wader
Copy link
Contributor

wader commented Apr 28, 2020

Maybe run with strace could help see what is going on strace -f devd .... Look for bind failure, going thru lots of files etc

@polm
Copy link
Author

polm commented Apr 28, 2020

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...

@wader
Copy link
Contributor

wader commented Apr 29, 2020

Did some digging. I suspect that #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?

@polm
Copy link
Author

polm commented Apr 29, 2020

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...?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants