Page MenuHomePhabricator

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

Description

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
 <?php
 
 /**
diff --git a/scap/tasks.py b/scap/tasks.py
index a3d4798..28fd2ff 100644
--- a/scap/tasks.py
+++ b/scap/tasks.py
@@ -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.
Restricted Application added subscribers: StudiesWorld, Aklapper. · View Herald TranscriptFeb 2 2016, 1:25 AM
bd808 added a subscriber: bd808.Feb 2 2016, 1:28 AM

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.

greg added a subscriber: greg.
hashar updated the task description. (Show Details)Feb 2 2016, 11:34 AM
hashar set Security to None.
Joe added a subscriber: Joe.Feb 2 2016, 12:47 PM

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.

bd808 added a comment.Feb 2 2016, 11:20 PM

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 edited projects, added scap2; removed Deployments.Feb 10 2016, 12:25 AM
greg closed this task as Resolved.Apr 4 2016, 9:04 PM
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.