Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 388245

Summary: New keywords for dev-php/pecl-apc-3.1.9-r2: ~{x86,x64}-macos
Product: Gentoo/Alt Reporter: nietonfir
Component: Prefix SupportAssignee: Gentoo Prefix <prefix>
Status: RESOLVED WONTFIX    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: OS X   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: eprefixified pecl-apc-3.1.9-r2.ebuild
ebuild diff
prefix patch for fixing apc_lock.h not choosing the right fallback
eprefixified php-ext-source-v2.eclass
php-ext-source-r2.eclass diff

Description nietonfir 2011-10-23 18:29:31 UTC
The ebuild builds just fine after some minor adjustements to the ebuild itself,  the php-ext-source-r2 eclass, some upstream patch and local shared memory adjustements. ;)
Te
It seems to be that shared mutexes aren't supported on FreeBSD/OS X. The ebuild will build fine but will crash the PHP process as soon as a php page is requested. To fix this, the upstream patch ([1]) from [2] needs to be added.

Moreover, even with that patch, apc crashes the PHP process at startup because it can't allocate its shared memory segments at the default size of 32Mb ([3]). This is due to an OS X limitation: The default shared memory settings are way to conservative. Thus the user would need to tweak those to be able to use apc by setting saner values in /etc/sysctl.conf, e.g the 512MB settings config from [4]. This (needed change") could be communicated to the user via an elog message or a news item.

But I think that it may be easier to add the "mmap" USE-flag to the ~x86/~x64-macos profile (${EPREFIX}/usr/portage/profiles/prefix/darwin/macos/10.6/package.use) to circumvent that problem. And because of the not working mutexes, the default lock should be changed from "lock_pthreadmutex" to "lock_pthreadrw" as well (as everything performs better than the - fixed by the patch - file fallback [5]). ;)

[1] http://news.php.net/php.pecl.cvs/15669
[2] https://bugs.php.net/bug.php?id=59750
[3] http://php.net/manual/en/apc.configuration.php
[4] http://techjournal.318.com/mac-os-x-server/shared-memory-settings-explain/
[5] http://www.scribd.com/doc/88689/ApcFacebook
Comment 1 nietonfir 2011-10-23 18:30:15 UTC
Created attachment 290649 [details]
eprefixified pecl-apc-3.1.9-r2.ebuild
Comment 2 nietonfir 2011-10-23 18:30:54 UTC
Created attachment 290651 [details, diff]
ebuild diff
Comment 3 nietonfir 2011-10-23 18:33:56 UTC
Created attachment 290653 [details, diff]
prefix patch for fixing apc_lock.h not choosing the right fallback

This patch [1] comes from upstream [2].

[1] http://news.php.net/php.pecl.cvs/15669
[2] https://bugs.php.net/bug.php?id=59750
Comment 4 nietonfir 2011-10-23 18:36:08 UTC
Created attachment 290655 [details]
eprefixified php-ext-source-v2.eclass

This eclass was already submitted with #358987
Comment 5 nietonfir 2011-10-23 18:43:41 UTC
Created attachment 290657 [details, diff]
php-ext-source-r2.eclass diff
Comment 6 Pacho Ramos gentoo-dev 2014-11-21 15:04:29 UTC
was removed