Bug 262343

Summary: devel/phabricator: broken with php80
Product: Ports & Packages Reporter: Gleb Popov <arrowd>
Component: Individual Port(s)Assignee: Michael Gmelin <grembo>
Status: Closed FIXED    
Severity: Affects Only Me Flags: bugzilla: maintainer-feedback? (grembo)
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
Patch arcanist/phabricator for PHP 8.x grembo: maintainer-approval+

Description Gleb Popov freebsd_committer freebsd_triage 2022-03-04 16:33:27 UTC
After upgrading phabricator-php74 to phabricator-php80 it becomes completely unusable. The main page returns

>>> UNRECOVERABLE FATAL ERROR <<<

Uncaught Error: Call to undefined function get_magic_quotes_gpc() in /usr/local/lib/php/phabricator/support/startup/PhabricatorStartup.php:521
Stack trace:
#0 /usr/local/lib/php/phabricator/support/startup/PhabricatorStartup.php(133): PhabricatorStartup::verifyPHP()
#1 /usr/local/lib/php/phabricator/webroot/index.php(98): PhabricatorStartup::didStartup(1646411032.6753)
#2 /usr/local/lib/php/phabricator/webroot/index.php(3): phabricator_startup()
#3 {main}
  thrown

/usr/local/lib/php/phabricator/support/startup/PhabricatorStartup.php:521


┻━┻ ︵ ¯\_(ツ)_/¯ ︵ ┻━┻


and starting phd results in

Starting phd.
[2022-03-04 19:26:53] EXCEPTION: (Exception) Error while loading file "/usr/local/lib/php/phabricator/src/applications/base/PhabricatorApplication.php": Private methods cannot be final as they are never overridden by other classes at [<arcanist>/src/init/lib/PhutilBootloader.php:275]
arcanist(), phabricator()
  #0 PhutilBootloader::executeInclude(string) called at [<arcanist>/src/init/lib/PhutilBootloader.php:207]
  #1 PhutilBootloader::loadLibrarySource(string, string) called at [<arcanist>/src/symbols/PhutilSymbolLoader.php:422]
  #2 PhutilSymbolLoader::loadSymbol(array) called at [<arcanist>/src/symbols/PhutilSymbolLoader.php:277]
  #3 PhutilSymbolLoader::selectAndLoadSymbols() called at [<arcanist>/src/init/init-library.php:23]
  #4 __phutil_autoload(string) called at [<phabricator>/src/infrastructure/events/PhabricatorEventEngine.php:30]
  #5 PhabricatorEventEngine::initialize() called at [<phabricator>/src/infrastructure/env/PhabricatorEnv.php:133]
  #6 PhabricatorEnv::initializeCommonEnvironment(boolean) called at [<phabricator>/src/infrastructure/env/PhabricatorEnv.php:75]
  #7 PhabricatorEnv::initializeScriptEnvironment(boolean) called at [<phabricator>/scripts/init/lib.php:26]
  #8 init_phabricator_script(array) called at [<phabricator>/scripts/init/init-script.php:9]
  #9 require_once(string) called at [<phabricator>/scripts/__init_script__.php:3]
  #10 require_once(string) called at [<phabricator>/scripts/daemon/manage_daemons.php:5]
/usr/local/etc/rc.d/phd: WARNING: failed to start phd
Comment 1 Michael Gmelin freebsd_committer freebsd_triage 2022-03-04 16:44:55 UTC
Hm, phabricator is marked as broken for 8.1. I can look into upstream patches, AFAIK, even though the project is not actively maintained, they adopted some patches (which should also help with 8.0). Is this urgent?

In the meantime, you could try to set `error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT` in php.ini (which was the default before 8.0).
Comment 2 Michael Gmelin freebsd_committer freebsd_triage 2022-03-04 18:53:23 UTC
Created attachment 232252 [details]
Patch arcanist/phabricator for PHP 8.x

Hi Gleb,

I produced a patch to update/fix arcanist and phabricator for 8.x (so it builds on 8.1 now and includes patches for 8 in general).

I don't have the time to test this on my personal instance right now (will do later), so maybe if you have a chance, your assistance in testing would be welcome.

Best
Michael
Comment 3 Gleb Popov freebsd_committer freebsd_triage 2022-03-05 09:29:20 UTC
(In reply to Michael Gmelin from comment #2)
I'm hesitant to try this out on my production instance, as it would require upgrading the DB. However, I tried this out on a VM to spin up a new instance and it worked flawlessly! Both the web interface and phd are fine.

Thanks for working on this, it is very much appreciated.
Comment 4 commit-hook freebsd_committer freebsd_triage 2022-03-08 18:35:29 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=69495d3f1a78b32f7ce7e84c8ea8b14f7a0fbbac

commit 69495d3f1a78b32f7ce7e84c8ea8b14f7a0fbbac
Author:     Michael Gmelin <grembo@FreeBSD.org>
AuthorDate: 2022-03-08 18:28:19 +0000
Commit:     Michael Gmelin <grembo@FreeBSD.org>
CommitDate: 2022-03-08 18:31:11 +0000

    devel/phabricator: Update to 20211218

    This should unbreak running on PHP 8.0 and (at least)
    build on PHP 8.1.

    PR:             262343
    Reported by:    arrowd@

 devel/phabricator/Makefile  |  8 +---
 devel/phabricator/distinfo  | 10 ++---
 devel/phabricator/pkg-plist | 91 +++++++++++++++++++++++++++++++++++++++++----
 3 files changed, 90 insertions(+), 19 deletions(-)
Comment 5 commit-hook freebsd_committer freebsd_triage 2022-03-08 18:35:30 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=44273a72bfdcef960468da5bc4f02eabcca0aa2c

commit 44273a72bfdcef960468da5bc4f02eabcca0aa2c
Author:     Michael Gmelin <grembo@FreeBSD.org>
AuthorDate: 2022-03-08 18:25:37 +0000
Commit:     Michael Gmelin <grembo@FreeBSD.org>
CommitDate: 2022-03-08 18:31:10 +0000

    devel/arcanist-lib: Update to 20211210

    This should unbreak running on PHP 8.0 and (at least)
    build on PHP 8.1.

    PR:             262343
    Reported by:    arrowd@

 devel/arcanist-lib/Makefile                        |  6 ++---
 devel/arcanist-lib/distinfo                        |  6 ++---
 ...tch-src_moduleutils_PhutilLibraryMapBuilder.php | 16 ++++++------
 .../files/patch-src_runtime_ArcanistRuntime.php    |  4 +--
 ...orkflow_ArcanistShellCompleteWorkflow.php (new) | 11 ++++++++
 ...patch-src_workflow_ArcanistLiberateWorkflow.php |  4 +--
 devel/arcanist-lib/pkg-plist                       | 30 ++++++++++++++++++++++
 7 files changed, 58 insertions(+), 19 deletions(-)
Comment 6 Michael Gmelin freebsd_committer freebsd_triage 2022-03-08 18:38:03 UTC
(In reply to Gleb Popov from comment #3)

Hi Gleb,

I updated the smaller one of my instances (on php74) and database changes worked  smoothly. Bigger one will follow later together with other updates. Since things look okay, I pushed the changes and will close this one as resolved, thanks for reporting!.
Comment 7 Gleb Popov freebsd_committer freebsd_triage 2022-03-10 05:47:15 UTC
(In reply to Michael Gmelin from comment #6)
Awesome, thanks for the prompt update!