facebook / facebook/hhvm

hh_client returns non-parsable server startup text in JSON mode

Open
#7,748 3 comments 0 reactions 0 assignees View on GitHub
hack
Dominant language
C++
Stars
18.7k
Forks
3.1k
Avg merge
1h 47m
Merged PRs (30d)
2

Description

### HHVM Version

3.18.1 (but problem exists across versions)

### Standalone code, or other way to reproduce the problem

Invoke `hh_client` with the `--json` flag when `hh_server` isn't already running (e.g. right after calling `hh_client stop`).

### Expected result

hh_client should start the typechecker server process and return a machine-parsable JSON result.

### Actual result

hh_client returns a server startup dump followed by the actual JSON typechecker output. This messes up parsing of the results. E.g.

```
For more detailed logs, try `tail -f $(hh_client --monitor-logname) $(hh_client --logname)`
Server launched with the following command:
'/usr/bin/hh_server' '-d' '/home/user/repos/hack-router' '--waiting-client' '6'
Spawned typechecker (child pid=24307)
Logs will go to /tmp/hh_server/zShomezSuserSreposzShack-router.monitor_log
{"passed":false,"errors":[{"message":[{"descr":"Expected (","path":"/home/user/repos/hack-router/src/router/UnknownRouterException.php","line":16,"start":5,"end":11,"code":1002}]}],"version":"4f792a827d9b6fcc4bcd7940a1b92280f3fdedc3 Fri Feb 24 11:21:05 2017"}
```
The startup text should ideally be omitted in JSON mode.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.