Please sign in to comment.
Add SHA1 hashing to FactsParse
Summary: Watchman provides a field called `"content.sha1hex"`. When a file changes, Watchman will tell us the new SHA1 hash of that file without us having to open it and hash it ourselves. We can use this SHA1 hash as our key in Memcache, allowing servers to share information about the files they parsed. But on a cache miss, we need to hash the file ourselves. The only way to be sure that our hash matches the facts we read from the file is to hash the same string we parsed, which means FactsParse has to perform the hashing and return the hash as part of its results. Reviewed By: kmeht Differential Revision: D13631325 fbshipit-source-id: f949a15bae20f959d29cd53da6ded2f2914dbb35
- Loading branch information...
Showing with 35 additions and 13 deletions.
- +2 −1 hphp/hack/src/facts/dune
- +3 −1 hphp/hack/src/facts/facts.ml
- +1 −1 hphp/hack/src/facts/facts.mli
- +2 −1 hphp/hack/src/facts/facts_parser.ml
- +9 −3 hphp/test/slow/dv_array/ext_factparse.php.expectf
- +9 −3 hphp/test/slow/dv_array_hack_arr/ext_factparse.php.expectf
- +9 −3 hphp/test/slow/ext_factparse/ext_factparse.php.expectf