make the typecheck tests v2 compatible
Summary:
There are a bunch of hack typechecker tests based around some Python and shell scripts that very much want to be run from fbsource/fbcode (run the tests, if the output differs, offer to automate updating the expect files sort of thing). buck1 arranges for them to be run from fbcode but the current behavior of buck2 is to run from fbsource. I explored one way of achieving buck1/buck2 compatibility in
D32629408 but this turns out to be way hard and not a lot to be gained today for much work. A much easier "hack" that sees us on our way today is given here.
Note that even this isn't the whole story. These tests are also executed under dune (presumably for OSS) from some ancestor of fbcode and there is special case logic in 'verify.py' and 'review.sh' to account for that. So, care is taken here to only adjust the working directory in the case of buck2.
Some related chat:
- https://fb.workplace.com/groups/buck2users/permalink/
3023616267894734/
- https://fb.workplace.com/groups/buck2prototyping/posts/
2800385523592263/?comment_id=
2800401463590669
Reviewed By: ndmitchell
Differential Revision:
D32698005
fbshipit-source-id:
11fab5789240ec3bebcd8f310d663aa2e606e990