From 7f93b7de02c523f6a3d71d85cd0591719b445606 Mon Sep 17 00:00:00 2001 From: epriestley Date: Tue, 22 Jan 2013 17:16:37 -0800 Subject: [PATCH] Don't use xhpast binary to compute xhpastlinter cache version if the binary doesn't exist Summary: The binary may not be built, in which case this raises a warning. Test Plan: Will make @zeeg test. Reviewers: zeeg, vrana Reviewed By: vrana CC: aran Differential Revision: https://secure.phabricator.com/D4569 --- src/lint/linter/ArcanistXHPASTLinter.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/lint/linter/ArcanistXHPASTLinter.php b/src/lint/linter/ArcanistXHPASTLinter.php index ce5b3062..8c19dab5 100644 --- a/src/lint/linter/ArcanistXHPASTLinter.php +++ b/src/lint/linter/ArcanistXHPASTLinter.php @@ -156,7 +156,12 @@ final class ArcanistXHPASTLinter extends ArcanistLinter { } public function getCacheVersion() { - return '2-'.md5_file(xhpast_get_binary_path()); + $version = '2'; + $path = xhpast_get_binary_path(); + if (Filesystem::pathExists($path)) { + $version .= '-'.md5_file($path); + } + return $version; } public function lintPath($path) {