-
Notifications
You must be signed in to change notification settings - Fork 326
Cleanup all checks for unsupported libmemcached versions #295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Looks great, thank you! |
Seems like one of the changes broke the build for older libmemcached (tested with 1.0.8) |
The removals here were too aggressive: There was a bug in libmemcached 1.0.x for some 1.0.8 < x < 1.0.18 that failed to expose memcached_exists as a non-C++-mangled C symbol.
The effect of that bug was for library versions that had a memcached_exists but did not expose it we used the memcached_get workaround above. Removing the workaround means we're exposed to the non-exported-symbol issue now. Since we don't compile php-memcached in C++ mode, I'm not sure if there's a way to engage the C++ name mangling so that we can gain access to the mangled memcached_exists symbol. I'm also concerned that the unit tests did not pick this up on Travis CI. We do test against multiple versions of libmemcached, which suggests that maybe libmemcached is now in the Travis base image and we're linking to that ahead of the local copy? |
Ok, the thing is this only happens at runtime and doesn't cause build to fail
So this is consistent with the fact it is still building successfully even after you purged any possible libmemcached libraries in the Travis image Also I just verified that this still happens when php-memcached is linked dynamically with libmemcached not just statically is in the original report (awslabs/aws-elasticache-cluster-client-memcached-for-php#12) |
That makes sense, since the function is always defined in the exist.h header, just not with extern "C" { } at libmemcached's compile-time. Tests still execute on Travis CI, though, which means the module is loading at run time, so I don't understand why it doesn't reproduce there. I looked into ways to get access to the C++ symbol, and it's basically a no-go -- the name mangling is compiler-dependent. Options I see:
|
REGISTER_MEMC_CLASS_CONST_LONG(OPT_REMOVE_FAILED_SERVERS, MEMCACHED_BEHAVIOR_REMOVE_FAILED_SERVERS); | ||
#endif | ||
#ifdef HAVE_MEMCACHED_BEHAVIOR_SERVER_TIMEOUT_LIMIT | ||
#if defined(LIBMEMCACHED_VERSION_HEX) && LIBMEMCACHED_VERSION_HEX >= 0x01000018 | ||
REGISTER_MEMC_CLASS_CONST_LONG(OPT_SERVER_TIMEOUT_LIMIT, MEMCACHED_BEHAVIOR_SERVER_TIMEOUT_LIMIT); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this libmemcached 1.0.18 or higher? It hasn't caused compile to fail on any older 1.0.x version.
I mis-re-read the diff.
Soon this will no longer be the case.
Are there any actual downside to it besides just having old compatibility hacks clutter the codebase? Can it be partially reverted?
Yes, I find that very odd too. |
Ubuntu Trusty and Debian Wheezy are still in LTS until 2018, so 1.0.8 is still an important user base. Ok, finished thinking out loud, gotta revert. |
…-memcached-dev#295)" This reverts commit c564fd8.
…_exists This partially reverts commit c564fd8 from php-memcached-dev#295
I've tagged php-memcached v3.0.1 which brings back the memcached_exists workaround, but keeps the other libmemcached < 1.0.2 removals. Thanks again for the cleanup work from this PR! |
Remove all compatible checks for LIBMEMCACHED_VERSION_HEX < 0x01000002