Page MenuHomePhabricator

refreshCdbJsonFiles in scap fails on mira due to missing dba_open function in hhvm
Closed, ResolvedPublic


HHVM lacks the dba_open function, which causes scap to fail. For the moment the script on mira has been live hacked to use php5 instead of hhvm.

The hack is uncommitted on mira in srv/deployment/scap/scap:

diff --git a/bin/refreshCdbJsonFiles b/bin/refreshCdbJsonFiles
index 69e0df8..27f50e0 100755
--- a/bin/refreshCdbJsonFiles
+++ b/bin/refreshCdbJsonFiles
@@ -1,4 +1,4 @@
-#!/usr/bin/env php
+#!/usr/bin/env php5
diff --git a/scap/ b/scap/
index a3d4798..28fd2ff 100644
--- a/scap/
+++ b/scap/
@@ -81,7 +81,7 @@ def check_valid_syntax(*paths):
     quoted_paths = ["'%s'" % x for x in paths]
     cmd = (
         "find %s -name '*.php' -or -name '*.inc' -or -name '*.phtml' "
-        " -or -name '*.php5' | xargs -n1 -P%d -exec php -l >/dev/null"
+        " -or -name '*.php5' | xargs -n1 -P%d -exec php5 -l >/dev/null"
     ) % (' '.join(quoted_paths), multiprocessing.cpu_count())
     logger.debug('Running command: `%s`', cmd)
     subprocess.check_call(cmd, shell=True)

Event Timeline

EBernhardson raised the priority of this task from to Needs Triage.
EBernhardson updated the task description. (Show Details)
EBernhardson added a subscriber: EBernhardson.

Multiversion uses wikimedia/cdb to work around the known bustedness of HHVM and the dba_* functions. It probably wouldn't be too hard to replace refreshCdbJsonFiles with a python script as another alternative. I never did before because lazy or something.

hashar set Security to None.

Please note this needs to be applied to tin too.

The scap log was really T125506: /srv/mediawiki-staging broken on both scap masters

With tin/mira reimaged, the shebang php5 means it is using PHP 5.5.9 from Trusty that is compiled with ICU version 52.1 . HHVM uses 48.

In addition to the ICU mismatch, the PHP 5.5 version we get by default on trusty is subject to a glibc iconv bug: T39665: IPTCTest::testIPTCParseForcedUTFButInvalid failure on PHP with buggy glibc (iconv //IGNORE broken), T124574: IPTCTest::testIPTCParseForcedUTFButInvalid fails on trusty/PHP5.5

I'm not sure if this would have any affect on building l10n caches. I would hope that we have valid UTF-8 in our source files.

greg assigned this task to thcipriani.

refreshCdbJsonFiles is now converted to python in scap 3.1 (which is deployed on the cluster).

See: rMSCAba8e257037e0f7b34ad23cc1d43b85fde29a9aea & T125685

Pretty sure that closes this issue.