Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 588608 - dev-php/pecl-memcached - PHP7 support
Summary: dev-php/pecl-memcached - PHP7 support
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal with 2 votes (vote)
Assignee: Robin Johnson
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 574238
  Show dependency tree
 
Reported: 2016-07-11 15:08 UTC by Jaco Kroon
Modified: 2017-02-06 13:58 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jaco Kroon 2016-07-11 15:08:47 UTC
Hi All,

I'm trying to get php-php/pecl-memcached to build with php7 support.  Assistance would be appreciated.  So far what I've done:

Updated the USE_PHP flag in the ebuild:

USE_PHP="php5-4 php5-5 php5-6 php7-0"

Removed the mask for php_targets_php7-0 from /usr/portage/profile/use.stable.mask (not sure what the right way is).

At this point the compile starts, but fails with:

/var/tmp/portage/dev-php/pecl-memcached-2.2.0-r1/work/php7.0/php_memcached_private.h:44:40: fatal error: ext/standard/php_smart_str.h: No such file or directory
 #include <ext/standard/php_smart_str.h>

I'm assuming this is because a patch is required for php7.

/usr/lib64/php7.0/include/php/ext/standard/php_smart_string.h is probably the replacement, but it's a non-trivial replacement (creating a symlink results in other errors plainly relating to strings).

Please advise:

- best way to sort out the use.stable.mask
- best way to go about patching memcached for use with php7 (without affecting builds for <php-7.0).
Comment 1 Brian Evans (RETIRED) gentoo-dev 2016-07-11 20:12:11 UTC
We are currently waiting on upstream support of PHP 7.

https://pecl.php.net/package/memcached specifically lists  version 6.0 or less on any released version. (last was on 2014-04-01)

While there is a php7 branch upstream, no release has come of it yet, has not yet been merged to master (if it ever will i dunno).

Upstream ticket https://github.com/php-memcached-dev/php-memcached/issues/213 is waiting for an answer if the branch is stable enough for use.

Lots of questions and no answers really.
Comment 2 Jaco Kroon 2016-07-12 09:18:37 UTC
Hi Brian,

Thanks for the detailed information.

If I were to manage to pull a patch from that - my client really would like this (yesterday type of thing).  And in the light that php_targets_php7-0 is USE-masked, could we apply such a patch conditionally to that USE flag?

I'd prefer to wait for an official release as well, but I'm not sure I can push back that long.

Would you be willing to carry that as "experimental" - or do I put this in my own overlay?
Comment 3 Brian Evans (RETIRED) gentoo-dev 2016-07-12 12:40:51 UTC
(In reply to Jaco Kroon from comment #2)
> Hi Brian,
> 
> Thanks for the detailed information.
> 
> If I were to manage to pull a patch from that - my client really would like
> this (yesterday type of thing).  And in the light that php_targets_php7-0 is
> USE-masked, could we apply such a patch conditionally to that USE flag?

First off, the 7.0 target is only masked on stable because php 7.0 is not yet marked stable.  Hopefully this should change soon.

As https://github.com/php-memcached-dev/php-memcached/compare/master...php7 shows, it is not a simple patch.  It looks to be nearly a full rewrite.
Comment 4 Ullrich 2016-11-10 11:01:53 UTC
Would it be possible to have a masked/development ebuild available for the php7 branch from upstream? Nearly every other distro is offering a php7-* package for memcached and it seems like there is not much trouble.
Comment 5 Tomáš Mózes 2016-11-11 06:13:41 UTC
You can test this if you wish:
https://github.com/hydrapolic/gentoo/tree/master/dev-php/pecl-memcached
Comment 6 Ullrich 2016-11-11 10:09:15 UTC
Thanks Tomáš, just installed 

 [ebuild     U *] dev-php/pecl-memcached-9999::gentoo [2.2.0-r1::gentoo] USE="session -json -sasl (-igbinary%)" PHP_TARGETS="php7-0%* (-php5-4%) (-php5-5%) (-php5-6%*)" 0 KiB

and right now its working without any problems.
Comment 7 Denis I. Polukarov 2016-11-11 14:47:22 UTC
Build success on x86, x86_64, arm.
Comment 8 Brian Evans (RETIRED) gentoo-dev 2016-12-12 16:26:22 UTC
I've added a snapshot to the php7 github branch to the tree as pecl-memcached-3.0.0_alpha1_pre20161206

I'll keep this bug open until it is released upstream.
Comment 9 Andrew Udvare 2017-01-11 22:50:52 UTC
Current ebuild is broken:

 * Package:    dev-php/pecl-memcached-3.0.0_alpha1_pre20161206
 * Repository: gentoo
 * Maintainer: robbat2@gentoo.org php-bugs@gentoo.org
 * USE:        abi_x86_64 amd64 elibc_glibc igbinary kernel_linux php_targets_php5-6 php_targets_php7-1 session userland_GNU
 * FEATURES:   compressdebug preserve-libs sandbox splitdebug userpriv usersandbox
 * ERROR: dev-php/pecl-memcached-3.0.0_alpha1_pre20161206::gentoo failed (prepare phase):
 *   eapply_user (or default) must be called in src_prepare()!
 *
 * Call stack:
 *            ebuild.sh, line  767:  Called __ebuild_main 'prepare'
 *   phase-functions.sh, line 1007:  Called __dyn_prepare
 *   phase-functions.sh, line  382:  Called die
 * The specific snippet of code:
 *              die "eapply_user (or default) must be called in src_prepare()!"
 *
 * If you need support, post the output of `emerge --info '=dev-php/pecl-memcached-3.0.0_alpha1_pre20161206::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=dev-php/pecl-memcached-3.0.0_alpha1_pre20161206::gentoo'`.
 * The complete build log is located at '/var/log/portage/dev-php:pecl-memcached-3.0.0_alpha1_pre20161206:20170111-223608.log'.
 * For convenience, a symlink to the build log is located at '/var/tmp/portage/dev-php/pecl-memcached-3.0.0_alpha1_pre20161206/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/dev-php/pecl-memcached-3.0.0_alpha1_pre20161206/temp/environment'.
 * Working directory: '/var/tmp/portage/dev-php/pecl-memcached-3.0.0_alpha1_pre20161206/work/pecl-memcached-3.0.0_alpha1_pre20161206'
 * S: '/var/tmp/portage/dev-php/pecl-memcached-3.0.0_alpha1_pre20161206/work/pecl-memcached-3.0.0_alpha1_pre20161206'
Comment 10 Alexey Skobkin 2017-01-12 21:05:26 UTC
Works for me but does not install PHP 7.1 extension despite of flags. Only PHP 7.0.

[ebuild   R   ] dev-php/pecl-memcached-3.0.0_alpha1_pre20161206  USE="json sasl session -igbinary" PHP_TARGETS="php7-0 php7-1 -php5-6" 

Would you like to merge these packages? [Yes/No] 
>>> Verifying ebuild manifests
>>> Emerging (1 of 1) dev-php/pecl-memcached-3.0.0_alpha1_pre20161206::gentoo
>>> Installing (1 of 1) dev-php/pecl-memcached-3.0.0_alpha1_pre20161206::gentoo
>>> Jobs: 1 of 1 complete                           Load avg: 0.76, 0.39, 0.20

# equery f pecl-memcached 
 * Searching for pecl-memcached ...
 * Contents of dev-php/pecl-memcached-3.0.0_alpha1_pre20161206:
/etc
/etc/php
/etc/php/cgi-php7.0
/etc/php/cgi-php7.0/ext
/etc/php/cgi-php7.0/ext-active
/etc/php/cgi-php7.0/ext-active/memcached.ini -> /etc/php/cgi-php7.0/ext/memcached.ini
/etc/php/cgi-php7.0/ext/memcached.ini
/etc/php/cli-php7.0
/etc/php/cli-php7.0/ext
/etc/php/cli-php7.0/ext-active
/etc/php/cli-php7.0/ext-active/memcached.ini -> /etc/php/cli-php7.0/ext/memcached.ini
/etc/php/cli-php7.0/ext/memcached.ini
/etc/php/fpm-php7.0
/etc/php/fpm-php7.0/ext
/etc/php/fpm-php7.0/ext-active
/etc/php/fpm-php7.0/ext-active/memcached.ini -> /etc/php/fpm-php7.0/ext/memcached.ini
/etc/php/fpm-php7.0/ext/memcached.ini
/usr
/usr/lib64
/usr/lib64/php7.0
/usr/lib64/php7.0/lib
/usr/lib64/php7.0/lib/extensions
/usr/lib64/php7.0/lib/extensions/no-debug-non-zts-20151012
/usr/lib64/php7.0/lib/extensions/no-debug-non-zts-20151012/memcached.so
/usr/share
/usr/share/doc
/usr/share/doc/pecl-memcached-3.0.0_alpha1_pre20161206
/usr/share/doc/pecl-memcached-3.0.0_alpha1_pre20161206/ChangeLog.bz2
/usr/share/doc/pecl-memcached-3.0.0_alpha1_pre20161206/README.markdown.bz2
Comment 11 Brian Evans (RETIRED) gentoo-dev 2017-01-12 21:36:45 UTC
(In reply to Andrew Udvare from comment #9)
> Current ebuild is broken:
> 
>  * Package:    dev-php/pecl-memcached-3.0.0_alpha1_pre20161206
>  * Repository: gentoo
>  * Maintainer: robbat2@gentoo.org php-bugs@gentoo.org
>  * USE:        abi_x86_64 amd64 elibc_glibc igbinary kernel_linux
> php_targets_php5-6 php_targets_php7-1 session userland_GNU

The build has been fixed when php7-0 is disabled but others enabled.
Comment 12 Alexey Skobkin 2017-01-12 21:47:03 UTC
> The build has been fixed when php7-0 is disabled but others enabled.

I have opposing situation. When I disabled php7-0 and only php7-1 left the ebuild starts to fail.

When I returned php7-0 to PHP_TARGETS it emerged successfully.
Comment 13 Brian Evans (RETIRED) gentoo-dev 2017-01-13 02:45:58 UTC
(In reply to skobk.in from comment #12)
> > The build has been fixed when php7-0 is disabled but others enabled.
> 
> I have opposing situation. When I disabled php7-0 and only php7-1 left the
> ebuild starts to fail.
> 
> When I returned php7-0 to PHP_TARGETS it emerged successfully.

Resync in about an hour from this post as the rsync mirrors were having issues today and all targets will be fixed.
Comment 14 Alexey Skobkin 2017-01-13 08:46:41 UTC
> Resync in about an hour from this post as the rsync mirrors were having issues today and all targets will be fixed.

Yeah, thanks. Now I have PHP 7.1 extension.
Comment 15 Michael Orlitzky gentoo-dev 2017-02-04 15:59:22 UTC
There's a v3.0.0 release on Github that hasn't made it to the PECL website yet. I just pushed an ebuild for the Github version (dev-php/pecl-memcached-3.0.0). Can you please test it to make sure it works before I close this?
Comment 16 Tomáš Mózes 2017-02-06 06:42:33 UTC
(In reply to Michael Orlitzky from comment #15)
> There's a v3.0.0 release on Github that hasn't made it to the PECL website
> yet. I just pushed an ebuild for the Github version
> (dev-php/pecl-memcached-3.0.0). Can you please test it to make sure it works
> before I close this?

Seems to work fine, using now in production.
Comment 17 Michael Orlitzky gentoo-dev 2017-02-06 13:58:39 UTC
(In reply to Tomáš Mózes from comment #16)
> 
> Seems to work fine, using now in production.

*thumbs up*