Arcanist library loading behavior has changed

As far as I can tell, https://secure.phabricator.com/D20980 changed the semantics of how arcanist libraries are loaded. Comments in https://secure.phabricator.com/diffusion/ARC/browse/master/scripts/arcanist.php;8c4f6ce1617e70e70cc30080e5a00fad1448f932$609-612 say that it will look for directories next to libphutil (which is also next to arcanist), but looks like code doesn’t do that anymore: https://secure.phabricator.com/diffusion/ARC/browse/master/scripts/arcanist.php;8c4f6ce1617e70e70cc30080e5a00fad1448f932$649

Our repos rely on this by specifying only relative paths. We can work around it, but perhaps other people will run into a similar issue.

(Thanks for the great tools. We love Phabricator!)

Reproduction Instructions

Have a project with something like:

{
  "load": [
    "clang-format-linter"
  ]
}

Where clang-format-linter lives in /home/$USER/tools/arcanist/clang-format-linter. Previously it would pick up the library automatically when running the library as it was in the sibling directory to arcanist and libphutil. Now, running arc --trace version fails with:

$ arc --trace version
 ARGV  '/home/girts/tools/arcanist/arcanist/bin/../scripts/arcanist.php' '--trace' 'version'
 LOAD  Loaded "arcanist" from "/home/girts/tools/arcanist/arcanist/src".
Config: Reading user configuration file "/home/girts/.arcrc"...
Config: Did not find system configuration at "/etc/arcconfig".
Working Copy: Reading .arcconfig from "/home/girts/devel/foo/.arcconfig".
Working Copy: Path "/home/girts/devel/foo" is part of `git` working copy "/home/girts/devel/foo".
Working Copy: Project root is at "/home/girts/devel/foo".
Config: Did not find local configuration at "/home/girts/devel/foo/.git/arc/config".
Loading phutil library from 'clang-format-linter'...
[2020-02-13 21:29:38] ERROR 2: require_once(clang-format-linter/__phutil_library_init__.php): failed to open stream: No such file or directory at [/home/girts/tools/arcanist/arcanist/scripts/arcanist.php:649]
arcanist(head=master, ref.master=8c4f6ce1617e)
  #0 require_once called at [<arcanist>/scripts/arcanist.php:649]
  #1 arcanist_load_libraries(array, boolean, string, ArcanistWorkingCopyIdentity) called at [<arcanist>/scripts/arcanist.php:176]
PHP Fatal error:  require_once(): Failed opening required 'clang-format-linter/__phutil_library_init__.php' (include_path='/home/girts/tools/arcanist/arcanist/scripts/externals/includes:.:/usr/share/php') in /home/girts/tools/arcanist/arcanist/scripts/arcanist.php on line 649

Fatal error: require_once(): Failed opening required 'clang-format-linter/__phutil_library_init__.php' (include_path='/home/girts/tools/arcanist/arcanist/scripts/externals/includes:.:/usr/share/php') in /home/girts/tools/arcanist/arcanist/scripts/arcanist.php on line 649

Phabricator/Arcanist Version

arcanist 8c4f6ce1617e70e70cc30080e5a00fad1448f932 (13 Feb 2020)

Can you walk me through why you suspect D10596 (which landed five years ago, in 2015) caused a behavioral change? Has your install not updated for five years?

(I have some guesses about what’s going on here, but want to make sure I’m not missing something, since they don’t involve D10596 so they’re not correct if you have good evidence that D10596 is the culprit, e.g. you bisected to it.)

Argh, apologies :grimacing:, I copied the wrong revision. https://secure.phabricator.com/D20980 should be the right one. I edited the original post too.

This is likely fixed in master by https://secure.phabricator.com/D21004.

Thanks, this fixes the issue!