Comments (7)
Hard to say without more info. Have you checked your logs?
https://facebook.github.io/watchman/docs/troubleshooting.html#where-are-the-logs
If you're on Linux, running strace watchman -f ...
might be useful.
If you're on OSX things are more of a PITA because the debugging tools require you to be root. You can try attaching to the watchman client process; for example:
wez@wez-mbp ~
22:53 $ ps -ef | grep watchman
2048904527 6697 1 0 10:53PM ?? 0:00.86 /usr/local/Cellar/watchman/3.0.0/bin/watchman --foreground --logfile=/var/tmp/.watchman.wez.log --sockname=/var/tmp/.watchman.wez --statefile=/var/tmp/.watchman.wez.state
2048904527 6711 28715 0 10:54PM ttys001 0:00.01 watchman -j
2048904527 6713 6634 0 10:54PM ttys002 0:00.00 grep --color=auto watchman
wez@wez-mbp ~
22:54 $ sudo lldb -p 6711
Password:
Attaching to process with:
process attach -p 6711
Process 6711 stopped
Executable module set to "/usr/local/bin/watchman".
Architecture set to: x86_64-apple-macosx.
(lldb) bt
* thread #1: tid = 0xc00637, 0x00007fff943f7306 libsystem_kernel.dylib`read$NOCANCEL + 10, queue = 'com.apple.main-thread, stop reason = signal SIGSTOP
frame #0: 0x00007fff943f7306 libsystem_kernel.dylib`read$NOCANCEL + 10
frame #1: 0x00007fff94397966 libsystem_c.dylib`_sread + 16
frame #2: 0x00007fff94396f6b libsystem_c.dylib`__srefill1 + 24
frame #3: 0x00007fff94397088 libsystem_c.dylib`__srget + 14
frame #4: 0x00007fff94390574 libsystem_c.dylib`fgetc + 52
frame #5: 0x000000010df5642b watchman`stream_get + 59
frame #6: 0x000000010df55499 watchman`lex_scan + 73
frame #7: 0x000000010df54f0f watchman`parse_json + 31
frame #8: 0x000000010df551a1 watchman`json_loadf + 161
frame #9: 0x000000010df4d562 watchman`main + 658
frame #10: 0x000000010df41284 watchman`start + 52
(lldb)
You should make sure that you are sending valid JSON in; if I try running the command you pasted, substituting a local path, I get this:
$ watchman -j <<-EOT
heredocd> ["trigger", "/tmp/foo", {
heredocd> "name": "assets",
heredocd> "expression": ["pcre", "\.(js|css|c|cpp)$"],
heredocd> "command": ["make"]
heredocd> }]
heredocd> EOT
failed to parse JSON from stdin: invalid escape near '"\.'
(I'm using zsh, so it may be something to do with my shell vs. your shell)
from watchman.
@wez thanks for your information, I would try to use strace if I can find anything.
I do use zsh too, and I have the same problem you had with invalid escape
. And the script I use is the one from the official documentation. Maybe it needs some changes.
https://facebook.github.io/watchman/docs/cmd/trigger.html
from watchman.
It's the problem of the expression. Btw, this is a bit off topic but does watchman support multiple triggers configuration through stdin. The one I have tried but it doesn't work :
["triggers": [
{
"name": "js_builder",
"expression": [
"match",
"*.js",
"wholename"
],
"command": [
"echo",
"something"
]
},
{
"name": "css_builder",
"expression": [
"match",
"*.css",
"wholename"
],
"command": [
"echo",
"css builder"
]
}
]]
from watchman.
We should tweak the docs to escape that backslash.
Regarding two triggers in one invocations, you can send in two trigger commands, one after the other:
["trigger", ...]
["trigger", ...]
Make sure that you handle errors as appropriate to your use case.
from watchman.
awesome, thanks for your help !
from watchman.
I am new to wathman. I am using zsh. I think I didn't install watchman correctly in my Ubuntu. Can anybody help me.
I am getting following error while using watchman
zsh: command not found: watchman
from watchman.
@pardha-billa please open a new issue; be sure to include what you tried and the errors you're seeing
from watchman.
Related Issues (20)
- react-navtive
- Failed to build watchman: undefined reference to `make_fcontext'
- fb-watchman license listed as Apache-2.0 on NPM HOT 1
- Ubuntu .deb file not present in the latest release HOT 6
- Watchman is running at a lower than normal priority. HOT 1
- Watchman/buck2 integration
- Version v2023.12.18.00 just hangs on mac
- not bin HOT 1
- Publish new serde_bser version
- Installation error: ‘CertUtils’ has not been declared in ‘fizz (Ubuntu 22.04.3 LTS) HOT 3
- Unable to install watchman on arch HOT 2
- Prebuilt Linux binaries are unusable on any modern system HOT 5
- PCRE link is broken
- MacOS binaries missing HOT 4
- Hard dependency on Homebrew HOT 1
- Windows binaries are missing
- Unable to install pywatchman
- Unable to build watchman from source for ubuntu in the latest versions of releases HOT 1
- Could you provide `fc39.x86_64.rpm`? HOT 1
- Error from yarn gets written into plist
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from watchman.