Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 644922 - dev-lang/php - fix support for --enable-maintainer-zts, --enable-shmop and --with-mm
Summary: dev-lang/php - fix support for --enable-maintainer-zts, --enable-shmop and --...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: PHP Bugs
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2018-01-18 09:32 UTC by Xiami
Modified: 2018-01-20 05:10 UTC (History)
1 user (show)

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


Attachments
php-ebuild-dep.patch (php-ebuild-dep.patch,1.39 KB, patch)
2018-01-18 09:32 UTC, Xiami
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Xiami 2018-01-18 09:32:41 UTC
Created attachment 515222 [details, diff]
php-ebuild-dep.patch

--enable-shmop takes use of POSIX shared memory and relies on libc only (do not pull in dev-libs/mm). And it does nothing with --enable-maintainer-zts.

--with-mm is only used by session support. It doesn't depend on --enable-shmop, vice versa. It's used by setting "session.save_handler = mm" in php.ini.

I had looked up git history. It lies at https://gitweb.gentoo.org/repo/gentoo/historical.git/commit/dev-lang/php?id=eb65d6f4bc67946bfee172cffd01b696f6197076 .

Commit message is simple. Don't know why such dependencies put in.
Comment 1 Michael Orlitzky gentoo-dev 2018-01-18 14:47:41 UTC
USE=threads will set --enable-maintainer-zts.

I'll take a closer look at the patch soon, thanks!
Comment 2 Xiami 2018-01-19 05:17:50 UTC
(In reply to Michael Orlitzky from comment #1)
> USE=threads will set --enable-maintainer-zts.
> 
> I'll take a closer look at the patch soon, thanks!

Ummm wranglers changed the title which didn't reflect my meaning precisely...

My patch does:
1) Remove mutually exclusive relation between USE flag "sharedmem" and "threads"
2) Decouple USE flag "sharedmem" with new added "mm"(which responses for --with-mm and used by "session" only)

Reasons are at my first post :)
Comment 3 Michael Orlitzky gentoo-dev 2018-01-19 14:57:39 UTC
Thanks, I think this makes sense. PHP has a shared memory extension in ext/shmop that better maps to the "sharedmem" USE flag, but currently we conflate that with the "mm" support that applies only to the session extension.

Would you mind if I named the flag "session-mm" instead, to clarify?

Afterwards, there is this line in our current ebuilds...

  sharedmem? ( !threads )

which could mean that --enable-maintainer-zts used to conflict with either ext/shmop, or --with-mm, because we used to enable them both with USE=sharedmem. I've done a quick check and I can't figure out what the problem was, though; PHP will happily let me do,

  ./configure --with-mm --enable-shmop --enable-maintainer-zts

so I guess we'll get rid of that restriction like you suggest and see what happens =)
Comment 4 Michael Orlitzky gentoo-dev 2018-01-20 00:24:06 UTC
Ok, it turns out that "--with-mm" and "--enable-maintainer-zts" are incompatible:

https://github.com/php/php-src/pull/3027

I'll add a different REQUIRED_USE for that.
Comment 5 Larry the Git Cow gentoo-dev 2018-01-20 05:10:55 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c6fd6c07c3c92aa7d27816749383c77ab025e07d

commit c6fd6c07c3c92aa7d27816749383c77ab025e07d
Author:     Michael Orlitzky <mjo@gentoo.org>
AuthorDate: 2018-01-19 16:35:41 +0000
Commit:     Michael Orlitzky <mjo@gentoo.org>
CommitDate: 2018-01-20 05:01:15 +0000

    dev-lang/php: new revisions to fix shared memory and threads support.
    
    Our PHP ebuilds used the "sharedmem" flag to conflate two ./configure
    flags, namely --enable-shmop and --with-mm. The former is the "shared
    memory" extension, and the latter enables the dev-libs/mm backend for
    session storage. This commit separates the two:
    
      * The old USE=sharedmem enables the shared memory extension
      * The new USE=session-mm enables the dev-libs/mm session backend
    
    The nascent session-mm flag depends on USE=session being set.
    
    Additionally, we had a REQUIRED_USE constraint prohibiting USE=sharedmem
    from being set at the same time as USE=threads. This turns out to be due
    to an incompatibility between the --with-mm and --enable-maintainer-zts
    flags, the latter of which is toggled by USE=threads. So in the new
    revisions, we have a REQUIRED_USE constraint that blocks USE=threads
    when USE=session-mm is set.
    
    Thanks are due to Xiami who reported and fixed all of these issues in
    bug 644922.
    
    Reported-by: Xiami <i@f2light.com>
    Closes: https://bugs.gentoo.org/644922
    Package-Manager: Portage-2.3.13, Repoman-2.3.3

 dev-lang/php/metadata.xml                          |   7 +-
 dev-lang/php/php-7.1.13-r1.ebuild                  | 721 +++++++++++++++++++++
 .../php/{php-7.2.1.ebuild => php-7.2.1-r1.ebuild}  |   8 +-
 3 files changed, 731 insertions(+), 5 deletions(-)