From a6a4b1ebbc5c43a0d4bb47531d9eb0359b6f1ac1 Mon Sep 17 00:00:00 2001 From: vrana Date: Tue, 12 Jun 2012 17:37:30 -0700 Subject: [PATCH] Don't blast if cache couldn't be saved Summary: It is currently causing us some pain because we use libraries in read-only directories. Not saving the cache is still pretty bad because analysis is quite slow. But it is better than exploding. I considered other solutions like not .gitignoring the cache file but it would require committing it with each and every change. I plan to resolve the note https://secure.phabricator.com/diffusion/ARC/browse/master/src/lint/linter/ArcanistPhutilLibraryLinter.php;d93bb5abd4935bc8$56-59 in longer term. Test Plan: `arc liberate` without writable cache. Reviewers: epriestley, nh Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D2734 --- scripts/phutil_rebuild_map.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/phutil_rebuild_map.php b/scripts/phutil_rebuild_map.php index 53d5ee1a..feec1e24 100755 --- a/scripts/phutil_rebuild_map.php +++ b/scripts/phutil_rebuild_map.php @@ -407,7 +407,11 @@ final class PhutilLibraryMapBuilder { } $json = json_encode($cache); - Filesystem::writeFile($cache_file, $json); + try { + Filesystem::writeFile($cache_file, $json); + } catch (FilesystemException $ex) { + $this->log("Unable to save the cache!\n"); + } }