[90500] trunk/dports/python/py-pylibmc

Ryan Schmidt ryandesign at macports.org
Thu Mar 8 20:24:34 PST 2012


On Mar 8, 2012, at 13:53, Jeremy Lavergne wrote:

>> strndup is included in Lion and later. So shouldn't this patch be used on Snow Leopard and earlier, not just on Snow Leopard?
> 
> Is it missing from earlier than Snow Leopard? I don't have a means of verifying this but if you can confirm that assumption is true.. :-)


strndup is a GNU extension that Apple only added to OS X in Lion; it did not exist in OS X before Lion. Old software developed before Lion might assume OS X does not ever have strndup, and include their own implementation on OS X, which would fail with a duplicate symbol error on Lion and up, and need to be patched on Lion and up to no longer do that. We've already fixed several tickets of that sort. New software developed after the release of Lion might assume OS X always has strndup, as might software developed with no consideration for OS X and developed only for Linux where strndup is always available, and might therefore not include an implementation of strndup, which would result in an undefined symbol error, and need to be patched on Snow Leopard and earlier to include an implementation. pylibmc appears to be one of these cases.

So yes. On Leopard, the same thing happens as would happen on Snow Leopard without the patch: py27-pylibmc builds and installs, but if you look in the log, you'll see the warnings which mean that it'll just fail at runtime.

_pylibmcmodule.c: In function ‘_check_libmemcached_version’:
_pylibmcmodule.c:2063: warning: implicit declaration of function ‘strndup’
_pylibmcmodule.c:2063: warning: assignment makes pointer from integer without a cast

So the patch should be applied on Snow Leopard and earlier, and the revision should be increased to trigger a rebuild for those Leopard and Tiger users who already upgraded to r90500. I've made this change in r90573. I also fixed the patch failure of the stub port, by not adding the patchfile until we're in the name != subport block.






More information about the macports-dev mailing list