As written in the title, arcanist mixes user data with its own code, with no way to tell it to put it somewhere else. Specifically, it tries to write `libexec/arcanist/src/.phutil_module_cache`.
This can be a problem when packaging arc, because the install location is read-only.
Locally, I solved the issue with this patch:
```
diff --git a/src/moduleutils/PhutilLibraryMapBuilder.php b/src/moduleutils/PhutilLibraryMapBuilder.php
index f51fc464..b80a22cd 100644
--- a/src/moduleutils/PhutilLibraryMapBuilder.php
+++ b/src/moduleutils/PhutilLibraryMapBuilder.php
@@ -121,7 +121,10 @@ final class PhutilLibraryMapBuilder extends Phobject {
* @task path
*/
private function getPathForSymbolCache() {
- return $this->getPath('.phutil_module_cache');
+ $cachedir = getenv('XDG_CACHE_HOME');
+ if(!$cachedir)
+ $cachedir = getenv('HOME') . '/.cache';
+ return $cachedir . '/arcanist/phutil_module_cache';
}
/**
@@ -206,6 +209,10 @@ final class PhutilLibraryMapBuilder extends Phobject {
}
$json = json_encode($cache);
+
+ if (!file_exists(dirname($cache_file)))
+ mkdir(dirname($cache_file), 0755, true);
+
Filesystem::writeFile($cache_file, $json);
}
```
It works well for me, but cache directories are platform-dependent ([[ https://github.com/php-xdg/base-directory/tree/main/src/Platform | example ]]) so the patch is not complete.
Could (a complete version of) this be integrated in the project?