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

Can't get watchman triggers to work #38

Closed
aldeka opened this issue May 9, 2014 · 5 comments
Closed

Can't get watchman triggers to work #38

aldeka opened this issue May 9, 2014 · 5 comments

Comments

@aldeka
Copy link

aldeka commented May 9, 2014

(If there's an IRC channel or something that would be more appropriate for this kind of help request, let me know! I didn't see any mentioned in the README.)

I'm trying to compile and minify my less and js with make and watchman, per the Rdio post.

(Is it just me, or do none of the code snippets in that blog post work out of the box? Anyway.)

Gist with Makefile, Python script, and scrollback.

I have a Makefile. make works. make clean works. I cannot for the life of me get make watch, which uses watchman, to work. The trigger syntax is lifted directly from the README.

trigger-list finds the triggers (see scrollback in gist), so that's not the problem.

I read this issue and it seemed to suggest I had to wrap the make call in a script, since watchman triggers pass the filename as an argument, which make doesn't expect.

So I wrote make.py to do this. I can run python make.py with arbitrary arguments and it does the right thing.

But make watch still doesn't do anything. It doesn't compile after a make clean. It doesn't compile after editing a file. Watchman has been inert the whole time I've been trying to get it to work.

Help?

@sunshowers
Copy link
Contributor

Is watchman in your PATH? watchman expects to be in your PATH.

@aldeka
Copy link
Author

aldeka commented May 9, 2014

As you can see in the Makefile, I call watchman with an absolute path.

@sunshowers
Copy link
Contributor

Right -- that might or might not work. In any case it is not currently a supported configuration. Please add watchman to your PATH and try again.

Should it be supported? Maybe, though it makes some things related to daemonization trickier if I remember correctly. Patches are welcome.

@aldeka
Copy link
Author

aldeka commented May 9, 2014

Okay! The other command-line commands work by calling it directly, fwiw, but maybe triggers don't.

Just added watchman to my PATH; I can successfully call e.g. watchman trigger-list $(args) on the command line now. make watch still doesn't do anything.

@aldeka
Copy link
Author

aldeka commented May 9, 2014

Okay, I had to lsof | grep watchman | grep log to find the logs, and delete my .watchman.$(user).state file at least once, and I still can't get it working with both the *.js and *.less patterns on the same line... but I'll quit while I'm ahead!

Key findings: script calls need absolute paths, and it's easiest if you call the trigger on the directory that has the Makefile inside of it. Possible that putting watchman on my PATH also helped!

I'll update the gist with the changes.

@aldeka aldeka closed this as completed May 9, 2014
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