Closed cyounkins closed 6 months ago
Hi @cyounkins, thanks for the report. I have been looking a bit into this.
I think that's because the pyre python client calls the pyre OCaml binary, and that one writes its logs to stdout, and then they go through multiple hops in the client: ocaml binary stderr -> log file -> tail -F -> pyre client stderr (i.e your terminal). My guess is that when we get the final result from the ocaml binary, the logs do not reach the final logger before we stop logging.
This happens around: https://github.com/facebook/pyre-check/blob/main/client/commands/analyze.py#L350-L361
Adding a time.sleep(1)
there seems to fix the problem, but it is obviously less than ideal.
I think we need to increase the refresh rate of tail
(using option -s
), but that isn't available on MacOS, only on Linux. So we might have to implement our own tail
function in Python (we discussed this before).
I have a fix internally, I will need to run more tests on it and go through code review.
So you were able to reproduce it then?
The reader could wait for a sentinel string. Or you could tail it yourself in python.
Yes I'm able to reproduce and I have a fix doing the tail in python. Please hold on while it goes through code review internally.
Pysa Bug
Pre-submission checklist [x] I've checked the list of common issues and mine does not appear
Bug description One invocation of
pyre analyze
,reveal_type
will print out the type correctly. With no changes to code, the next invocation it will not.Reproduction steps Try on my repo: https://github.com/cyounkins/pysa-testing/tree/63395fc6b3ba826b1ebb9dec1c55abcadf4c7622
Expected behavior
reveal_type
should always outputLogs Below are normal logs. Here are some
noninteractive
: https://gist.github.com/cyounkins/1831c2b62ea8bc5f84852526632ecbeeAdditional context I'm providing no cache flag. I don't see any state files being written so maybe this is a race condition.