Arcanist doesn't work when .arcrc has "wrong" permissions

Arcanist has a “helpful” feature where it will warn if your .arcrc's permissions are unsafe. While this is probably a helpful thing for most users, and there is prior art for this behavior in programs such as gpg, I believe arc's is a bit extreme in that it fails to work at all if the permissions are wrong, while usually a warning is issued without affecting functionality.

The reason I came across that I use NixOS to manage my configurations, and so my .arcrc lives in /nix/store/something and is symlinked to my homedir, which in turn causes arcanist to stop working fully. I wrote the following patch to work around this behavior

index 0d0a92e7..5024ca4c 100644
--- a/arcanist/src/configuration/ArcanistConfigurationManager.php
+++ b/arcanist/src/configuration/ArcanistConfigurationManager.php
@@ -181,7 +181,7 @@ final class ArcanistConfigurationManager extends Phobject {
             'Config: Reading user configuration file "%s"...',

-        if (!phutil_is_windows()) {
+        if (false) {
           $mode = fileperms($user_config_path);
           if (!$mode) {
             throw new Exception(

and while it works fine I believe a solution to this should land in upstream. Namely I’m looking to be able to specify in my config that it’s okay that it’s permissions are not 0600, so that I can continue to work without having to patch Arcanist.

Reproduction Instructions

  1. Set your .arcrc's permissions to something other than 0600, such as 0644.
  2. Try to use arc, such as arc diff, arc feature, etc.
  3. Verify that it refuses to work unless the permissions are fixed

Phabricator/Arcanist Version
I’m unable to obtain this, running arc version from inside my repo where all other arc commands work fine I get the following:

❯ arc version --trace
 ARGV  '/nix/store/l8p13fanv2hl5msa57dj7fqh2dk624gs-arcanist-20180916/libexec/arcanist/bin/../scripts/arcanist.php' 'version' '--trace'
 LOAD  Loaded "phutil" from "/nix/store/l8p13fanv2hl5msa57dj7fqh2dk624gs-arcanist-20180916/libexec/libphutil/src".
 LOAD  Loaded "arcanist" from "/nix/store/l8p13fanv2hl5msa57dj7fqh2dk624gs-arcanist-20180916/libexec/arcanist/src".
Config: Reading user configuration file "/home/bemeurer/.arcrc"...
Config: Did not find system configuration at "/etc/arcconfig".
Working Copy: Reading .arcconfig from "/home/bemeurer/src/inference-system/.arcconfig".
Working Copy: Path "/home/bemeurer/src/inference-system" is part of `git` working copy "/home/bemeurer/src/inference-system".
Working Copy: Project root is at "/home/bemeurer/src/inference-system".
Config: Did not find local configuration at "/home/bemeurer/src/inference-system/.git/arc/config".
>>> [0] (+0) <exec> $ which 'git'
<<< [0] (+3) <exec> 3,619 us
Working Copy: No candidate locations for .arcconfig from this working directory.
Working Copy: Path "/nix/store/l8p13fanv2hl5msa57dj7fqh2dk624gs-arcanist-20180916/libexec/arcanist" is not in any working copy.

[2020-02-19 21:08:50] EXCEPTION: (Exception) The current working directory is not part of a working copy for a supported version control system (Git, Subversion or Mercurial). at [<arcanist>/src/repository/api/ArcanistRepositoryAPI.php:85]
arcanist(), phutil()
  #0 ArcanistRepositoryAPI::newAPIFromConfigurationManager(ArcanistConfigurationManager) called at [<arcanist>/src/workflow/ArcanistVersionWorkflow.php:47]
  #1 ArcanistVersionWorkflow::run() called at [<arcanist>/scripts/arcanist.php:394]

EDIT: Since I can no longer reply, I’ll add that @epriestley’s rebuttal isn’t entirely fair because ssh separates configuration from keys, while arc does not, which is the root of the issue.

This is intended behavior. See also ssh.