From: vrana Date: Wed, 13 Jun 2012 00:37:30 +0000 (-0700) Subject: Don't blast if cache couldn't be saved X-Git-Tag: conduit-6~255 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=a6a4b1ebbc5c43a0d4bb47531d9eb0359b6f1ac1;p=arcanist.git 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 --- 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"); + } }