Last modified: 2014-09-10 08:02:54 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T39076, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 37076 - [OPS] debianize PHP5 extension 'parsekit'
[OPS] debianize PHP5 extension 'parsekit'
Status: VERIFIED FIXED
Product: Wikimedia Labs
Classification: Unclassified
deployment-prep (beta) (Other open bugs)
unspecified
All All
: Normal enhancement
: ---
Assigned To: Faidon Liambotis
: ops
Depends on:
Blocks: 37078
  Show dependency treegraph
 
Reported: 2012-05-24 09:39 UTC by Antoine "hashar" Musso (WMF)
Modified: 2014-09-10 08:02 UTC (History)
8 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Antoine "hashar" Musso (WMF) 2012-05-24 09:39:22 UTC
The `scap` tool is used to copy PHP files on Apaches and pass them through the `lint` script to verify the PHP syntax. The script is simple enough and rely on the `parsekit` PECL extension:

 #!/bin/bash
 php -n -dextension=parsekit.so `dirname $0`/lint.php "$@"
 exit $?


The parse kit PHP5 extension is not available in lucid:

hashar@deployment-dbdump:~$ scap
Checking syntax...
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626/parsekit.so' - /usr/lib/php5/20090626/parsekit.so: cannot open shared object file: No such file or directory in Unknown on line 0

Fatal error: Call to undefined function parsekit_compile_file() in /usr/local/bin/lint.php on line 48
Found syntax errors, cannot sync.


We thus need to craft our own package off pecl, the dh-make-pecl debian helper script sounds like it is an easy task. http://www.mabishu.com/blog/2011/03/20/how-to-easily-create-debian-packages-for-php-extensions/


Once build, we can mark in puppet that `lint` require the php5-parsekit package.

Please note other systems could use the parsekit extension, continuous integration server comes to mind.
Comment 1 Antoine "hashar" Musso (WMF) 2012-05-24 09:41:07 UTC
This blocks the migration out of NFS - bug 36646. The reason being that we will then want to use the regular production tools (such as `scap`) and definitely need to lint PHP files before copying them to Apaches.
Comment 2 Antoine "hashar" Musso (WMF) 2012-05-24 09:54:22 UTC
Workaround:
I have installed php-dev and ran `pecl install parsekit` on deployment-dbdump.

The following extra packages will be installed:
  autoconf automake autotools-dev libltdl-dev libssl-dev libssl0.9.8 libtool
  m4 shtool


Then :
You should add "extension=parsekit.so" to php.ini

Did that in /etc/php5/conf.d/parsekit.ini and leaved a comment there.
Comment 3 Chad H. 2012-05-29 21:25:13 UTC
Do we know if parsekit works reliably on 5.3+ yet?

I had *quite* a few issues with false positives awhile back and had to give up using it locally.
Comment 4 Faidon Liambotis 2012-05-29 22:03:35 UTC
Could you clarify if you need it for lucid, precise or both?
Comment 5 Antoine "hashar" Musso (WMF) 2012-05-30 07:40:05 UTC
(In reply to comment #3)
> Do we know if parsekit works reliably on 5.3+ yet?
> 
> I had *quite* a few issues with false positives awhile back and had to give up
> using it locally.

We are using parsekit on fenari as part of the `scap` script (which call lint which is :

 php -n -dextension=parsekit.so `dirname $0`/lint.php "$@"

So yeah, works for us ;-D
Comment 6 Antoine "hashar" Musso (WMF) 2012-05-30 07:43:39 UTC
(In reply to comment #4)
> Could you clarify if you need it for lucid, precise or both?

Would need it for lucid for now so we can clean out the hack on fenari and use it on dbdump (beta bastion).

We could use a file /etc/php5/conf.d/parsekit.ini containing :
 extension=parsekit.so

Since php5-parsekit will only be installed on bastion, it is not going to do any harm to Apaches.
Comment 7 Chad H. 2012-05-30 13:19:57 UTC
(In reply to comment #5)
> (In reply to comment #3)
> > Do we know if parsekit works reliably on 5.3+ yet?
> > 
> > I had *quite* a few issues with false positives awhile back and had to give up
> > using it locally.
> 
> We are using parsekit on fenari as part of the `scap` script (which call lint
> which is :
> 
>  php -n -dextension=parsekit.so `dirname $0`/lint.php "$@"
> 
> So yeah, works for us ;-D

Run checkSyntax.php over the entire codebase with no errors, then I'll feel better :)
Comment 8 Antoine "hashar" Musso (WMF) 2012-05-30 15:04:59 UTC
(In reply to comment #7)
> Run checkSyntax.php over the entire codebase with no errors, then I'll feel
> better :)

We will use CodeSniffer instead ;-]
Comment 9 Antoine "hashar" Musso (WMF) 2012-06-22 10:42:51 UTC
Marking as an operation bug.
Comment 10 Faidon Liambotis 2012-06-26 18:20:46 UTC
Package php5-parsekit is on our apt repo, you should be able to (make puppet) apt-get it. Let me know if you need anything else with that.
Comment 11 Antoine "hashar" Musso (WMF) 2012-06-26 18:42:24 UTC
Thanks Faidon. I have tested the package on 'beta'.

Change for puppet is in https://gerrit.wikimedia.org/r/13048. Will follow up there.
Comment 12 Sam Reed (reedy) 2012-06-26 21:37:32 UTC
(In reply to comment #10)
> Package php5-parsekit is on our apt repo, you should be able to (make puppet)
> apt-get it. Let me know if you need anything else with that.

Any chance of it being upstreamed? Thanks :D
Comment 13 Antoine "hashar" Musso (WMF) 2012-07-05 10:12:38 UTC
(In reply to comment #12)
> Any chance of it being upstreamed? Thanks :D

Will need too fill out a request for a new Debian Package. Feel free to open a bug there and make sure you CC: Faidon, he definitely has clue about how we could do it (even if someone else will end up doing the paper work).
Comment 14 Faidon Liambotis 2012-07-16 12:18:48 UTC
I think Sam meant that *I* should upload it to Debian and maintain it there :-) I have no problem doing so (as I have no problem sponsoring/mentoring other people to do that), but it's obviously on my low-priority list.
Comment 15 Daniel Zahn 2014-09-10 02:05:01 UTC
on integration slaves in labs it is attempted to install this package but it fails:

Error: /Stage[main]/Contint::Packages/Package[php5-parsekit]/ensure: change from purged to present failed: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold install php5-parsekit' returned 100: Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package php5-parsekit

@integration-slave1006-trusty eqiad.wmflabs
Comment 16 Krinkle 2014-09-10 08:02:54 UTC
See bug 68256 comment 5. The php jobs currently don't run on the trusty slaves so it missing will not cause immediate problems, and puppet fortunately continues applying the remainder of the manifest.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links