Another patch to fix arcanist on newer php versions. See previous patch
here: https://reviews.llvm.org/D129232
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
The patch LGTM; I'd like @hiraditya to test it though first to see if it resolves https://github.com/llvm/llvm-project/issues/57271.
Not working either. Do I have to reboot the machine/restart a service ?
Machine type:
lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 22.04.1 LTS Release: 22.04 Codename: jammy
with arc diff
Deprecated: Function libxml_disable_entity_loader() is deprecated in /usr/share/arcanist/support/init/init-script.php on line 92 PHP Fatal error: Uncaught Exception: Error while loading file "/usr/share/arcanist/src/object/Phobject.php": Return type of Phobject::rewind() should either be compatible with Iterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/share/arcanist/src/init/lib/PhutilBootloader.php:275 Stack trace: #0 /usr/share/arcanist/src/init/lib/PhutilBootloader.php(207): PhutilBootloader->executeInclude() #1 /usr/share/arcanist/src/symbols/PhutilSymbolLoader.php(422): PhutilBootloader->loadLibrarySource() #2 /usr/share/arcanist/src/symbols/PhutilSymbolLoader.php(277): PhutilSymbolLoader->loadSymbol() #3 /usr/share/arcanist/src/init/init-library.php(23): PhutilSymbolLoader->selectAndLoadSymbols() #4 /usr/share/arcanist/src/filesystem/Filesystem.php(18): __phutil_autoload() #5 /usr/share/arcanist/src/init/lib/PhutilBootloader.php(247): include_once('...') #6 /usr/share/arcanist/src/init/lib/PhutilBootloader.php(207): PhutilBootloader->executeInclude() #7 /usr/share/arcanist/src/symbols/PhutilSymbolLoader.php(422): PhutilBootloader->loadLibrarySource() #8 /usr/share/arcanist/src/symbols/PhutilSymbolLoader.php(277): PhutilSymbolLoader->loadSymbol() #9 /usr/share/arcanist/src/init/init-library.php(23): PhutilSymbolLoader->selectAndLoadSymbols() #10 /usr/share/arcanist/src/init/lib/PhutilBootloader.php(97): __phutil_autoload() #11 /usr/share/arcanist/src/init/lib/PhutilBootloader.php(21): PhutilBootloader->registerLibrary() #12 /usr/share/arcanist/src/init/init-library.php(70): PhutilBootloader::newLibrary() #13 /usr/share/arcanist/support/init/init-script.php(96): require_once('...') #14 /usr/share/arcanist/support/init/init-script.php(115): __arcanist_init_script__() #15 /usr/share/arcanist/support/init/init-arcanist.php(3): require_once('...') #16 /usr/share/arcanist/bin/arc(10): require_once('...') #17 {main} thrown in /usr/share/arcanist/src/init/lib/PhutilBootloader.php on line 275
More changes were needed to make it work on my machine. I've added them in a separate diff: https://reviews.llvm.org/D132523
I think we probably need more fixes than this at this point. Thanks for the patch though!
This works for me, and fixes an annoying problem when I run arc diff when I'm not on any local git branch. Why would you reject one fix just because unspecified "more fixes" are also needed?
if this patch helps make progress for some folks, i think it is reasonable to merge this one as well. @nickdesaulniers do you have any objections to merging this patch?
I still see the above error on Ubuntu 22.04 with PHP 2:8.1+92ubuntu1 and arcanist at 0fc22183e796fb8ac2e3a0a3f3f37aa964c6d7fa (Mar 30, 2023) and after patching with llvm/utils/phabricator/0001-Fix-PHP-8.1-incompatibility-with-arc-patch-D-12345.patch.
More precisely, this is what I see:
arc diff PHP Deprecated: Function libxml_disable_entity_loader() is deprecated in /usr/share/arcanist/support/init/init-script.php on line 92 Deprecated: Function libxml_disable_entity_loader() is deprecated in /usr/share/arcanist/support/init/init-script.php on line 92 PHP Fatal error: Uncaught Exception: Error while loading file "/usr/share/arcanist/src/object/Phobject.php": Return type of Phobject::rewind() should either be compatible with Iterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/share/arcanist/src/init/lib/PhutilBootloader.php:275 Stack trace: #0 /usr/share/arcanist/src/init/lib/PhutilBootloader.php(207): PhutilBootloader->executeInclude() #1 /usr/share/arcanist/src/symbols/PhutilSymbolLoader.php(422): PhutilBootloader->loadLibrarySource() #2 /usr/share/arcanist/src/symbols/PhutilSymbolLoader.php(277): PhutilSymbolLoader->loadSymbol() #3 /usr/share/arcanist/src/init/init-library.php(23): PhutilSymbolLoader->selectAndLoadSymbols() #4 /usr/share/arcanist/src/filesystem/Filesystem.php(18): __phutil_autoload() #5 /usr/share/arcanist/src/init/lib/PhutilBootloader.php(247): include_once('...') #6 /usr/share/arcanist/src/init/lib/PhutilBootloader.php(207): PhutilBootloader->executeInclude() #7 /usr/share/arcanist/src/symbols/PhutilSymbolLoader.php(422): PhutilBootloader->loadLibrarySource() #8 /usr/share/arcanist/src/symbols/PhutilSymbolLoader.php(277): PhutilSymbolLoader->loadSymbol() #9 /usr/share/arcanist/src/init/init-library.php(23): PhutilSymbolLoader->selectAndLoadSymbols() #10 /usr/share/arcanist/src/init/lib/PhutilBootloader.php(97): __phutil_autoload() #11 /usr/share/arcanist/src/init/lib/PhutilBootloader.php(21): PhutilBootloader->registerLibrary() #12 /usr/share/arcanist/src/init/init-library.php(70): PhutilBootloader::newLibrary() #13 /usr/share/arcanist/support/init/init-script.php(96): require_once('...') #14 /usr/share/arcanist/support/init/init-script.php(115): __arcanist_init_script__() #15 /usr/share/arcanist/support/init/init-arcanist.php(3): require_once('...') #16 /usr/share/arcanist/bin/arc(10): require_once('...') #17 {main} thrown in /usr/share/arcanist/src/init/lib/PhutilBootloader.php on line 275 Fatal error: Uncaught Exception: Error while loading file "/usr/share/arcanist/src/object/Phobject.php": Return type of Phobject::rewind() should either be compatible with Iterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/share/arcanist/src/init/lib/PhutilBootloader.php:275 Stack trace: #0 /usr/share/arcanist/src/init/lib/PhutilBootloader.php(207): PhutilBootloader->executeInclude() #1 /usr/share/arcanist/src/symbols/PhutilSymbolLoader.php(422): PhutilBootloader->loadLibrarySource() #2 /usr/share/arcanist/src/symbols/PhutilSymbolLoader.php(277): PhutilSymbolLoader->loadSymbol() #3 /usr/share/arcanist/src/init/init-library.php(23): PhutilSymbolLoader->selectAndLoadSymbols() #4 /usr/share/arcanist/src/filesystem/Filesystem.php(18): __phutil_autoload() #5 /usr/share/arcanist/src/init/lib/PhutilBootloader.php(247): include_once('...') #6 /usr/share/arcanist/src/init/lib/PhutilBootloader.php(207): PhutilBootloader->executeInclude() #7 /usr/share/arcanist/src/symbols/PhutilSymbolLoader.php(422): PhutilBootloader->loadLibrarySource() #8 /usr/share/arcanist/src/symbols/PhutilSymbolLoader.php(277): PhutilSymbolLoader->loadSymbol() #9 /usr/share/arcanist/src/init/init-library.php(23): PhutilSymbolLoader->selectAndLoadSymbols() #10 /usr/share/arcanist/src/init/lib/PhutilBootloader.php(97): __phutil_autoload() #11 /usr/share/arcanist/src/init/lib/PhutilBootloader.php(21): PhutilBootloader->registerLibrary() #12 /usr/share/arcanist/src/init/init-library.php(70): PhutilBootloader::newLibrary() #13 /usr/share/arcanist/support/init/init-script.php(96): require_once('...') #14 /usr/share/arcanist/support/init/init-script.php(115): __arcanist_init_script__() #15 /usr/share/arcanist/support/init/init-arcanist.php(3): require_once('...') #16 /usr/share/arcanist/bin/arc(10): require_once('...') #17 {main} thrown in /usr/share/arcanist/src/init/lib/PhutilBootloader.php on line 275
Sorry, it turns out that it was using the arc installed on the system from the Ubuntu repos (0~git20200925-1) instead of the git version at 0fc22183e796fb8ac2e3a0a3f3f37aa964c6d7fa patched by Fix PHP 8.1 incompatibility with arc patch D<12345>``. The latter works fine.