Arcanist: Cannot load library from arbitrary path

I can load a library from a sibling directory to where arc is cloned, or from a directory within the repo, but not from any other library

Reproduction Instructions

cd ~
mkdir .arcanist-plugins
cd .arcanist-plugins
git clone https://github.com/pinterest/arcanist-linters.git

In the /home/kuba/.arcrc file, add:

   "load": ["/home/kuba/.arcanist-plugins/arcanist-linters"],

Then run

arc linters --trace

The output is:

 ARGV  /home/kuba/bin/arc linters --trace
 LOAD  Loading library from "/home/kuba/.arcanist-plugins/arcanist-linters"...
 ARGV  /home/kuba/bin/arcanist/scripts/arcanist.php linters --trace
 LOAD  Loaded "arcanist" from "/home/kuba/bin/arcanist/src".
Config: Reading user configuration file "/home/kuba/.arcrc"...
Config: Did not find system configuration at "/etc/arcconfig".
Working Copy: No candidate locations for .arcconfig from this working directory.
Working Copy: Path "/home/kuba" is not in any working copy.
 AVAILABLE   text (Basic Text Linter)
 AVAILABLE   csharp (C#)
 AVAILABLE   cpplint (C++ Google’s Styleguide)
 AVAILABLE   cppcheck (C++ linter)
 AVAILABLE   lessc (CSS pre-processor)
 AVAILABLE   csslint (CSSLint)
 AVAILABLE   chmod (Chmod)
 AVAILABLE   gjslint (Closure Linter)
 AVAILABLE   coffeelint (CoffeeLint)
 AVAILABLE   composer (Composer Dependency Manager)
 AVAILABLE   filename (Filename)
 AVAILABLE   generated (Generated Code)
 AVAILABLE   golint (Golint)
 AVAILABLE   hlint (Haskell Linter)
 AVAILABLE   jsonlint (JSON Lint)
 AVAILABLE   json (JSON Lint)
 AVAILABLE   jscs (JavaScript Code Style)
 AVAILABLE   jshint (JavaScript error checking)
 AVAILABLE   nolint (Lint Disabler)
 AVAILABLE   merge-conflict (Merge Conflicts)
 AVAILABLE   phpcs (PHP_CodeSniffer)
 AVAILABLE   phutil-library (Phutil Library Linter)
 AVAILABLE   pylint (PyLint)
 AVAILABLE   flake8 (Python Flake8 multi-linter)
 AVAILABLE   pep8 (Python PEP 8)
 AVAILABLE   pyflakes (Python PyFlakes)
 AVAILABLE   ruby (Ruby)
 AVAILABLE   rubocop (Ruby static code analyzer)
 AVAILABLE   script-and-regex (Script and Regex)
 AVAILABLE   xml (SimpleXML Linter)
 AVAILABLE   spelling (Spellchecker)
 AVAILABLE   xhpast (XHPAST Lint)
 AVAILABLE   php (php -l)
 AVAILABLE   puppet-lint (puppet-lint)
(Run `arc linters --verbose` for more details.)

Note that the output mentions that the library has been loaded, but the linters it provides are not listed.

The problem can be solved by following these steps:

  1. move the arcanist-linters dir to be a sibling of arcanist dir
  2. remove the load line from ~/.arcrc
  3. add "load": ["arcanist-linters"] to .arcconfig in each repository

Unfortunately the above might be troublesome for people who installed arc using a package manager.

Phabricator/Arcanist Version
arcanist 65cda1596f25bb9daea1d78c46402ab61df073d5 (9 Jul 2020)

Have you tried an absolute path (/home/kuba/.arcanist-plugins/arcanist-linters) rather than relying on tilde-expansion?

I have quite a lot of Arcanist libraries loaded from arbitrary places on the filesystem containing various linters and have not seen any issues, so I think the root issue is something else here.

Note that the output mentions that the library has been loaded

I might be blind, but I can’t see any prints in your output indicating the arcanist-linters library has been loaded. For me the message is between the last Working Copy: print and the first linter being printed.

Yes, I did. I didn’t solve the problem, unfortunately.

I might have copied the wrong logs. I’ve ran the commands again (this time, with absolute path in ~/.arcrc, and updated the original post with the actual logs. The line:

 LOAD  Loading library from "/home/kuba/.arcanist-plugins/arcanist-linters"...

seems to indicate that the library has been loaded, but the linters are not listed