Giter Club home page Giter Club logo

Comments (19)

malyeyev-AMZN avatar malyeyev-AMZN commented on June 17, 2024 2

Thanks Aaron. I've merged 3.0.1 into our php7 branch.

from aws-elasticache-cluster-client-memcached-for-php.

mvanbaak avatar mvanbaak commented on June 17, 2024

Probably fixed as soon as you guys sync https://github.com/awslabs/aws-elasticache-cluster-client-libmemcached with latest upstream.

from aws-elasticache-cluster-client-memcached-for-php.

sodabrew avatar sodabrew commented on June 17, 2024

Hmm. I thought memcached_exist was available in all libmemcached 1.0.x versions.

from aws-elasticache-cluster-client-memcached-for-php.

mvanbaak avatar mvanbaak commented on June 17, 2024

I thought so as well, but if you look at the commit where the upstream changes are pulled, there's an ifdef for that function in php-memcached-compat. This is probably the change that breaks it (the removal of this whole c and h file).

All documents state that libmemcached 1.X is ok, but it seems the latest 3.0 version needs a newer libmemcached.

I'm not familiar with libmemcached and the php module, so this is purely a 'I think' solution without looking into the code of libmemcached itself ;-)

from aws-elasticache-cluster-client-memcached-for-php.

sodabrew avatar sodabrew commented on June 17, 2024

libmemcached Changelog:

0.53 Mon Sep 26 20:50:33 PDT 2011
  * Fix for FreeBSD/OpenBSD and -lm
  * Added memcached_exist()
  * Fix for memory when using config test.
  * CLI gained --quiet

I was the one who went ahead with removing the php_memcached_compat.c that provides the alternate memcached_exists, so I want to be sure I didn't blow it!

from aws-elasticache-cluster-client-memcached-for-php.

mvanbaak avatar mvanbaak commented on June 17, 2024

I launched a clean amazon linux ami (the latest) to compile the module.
This is my ansible setup for it:

- name: Clone aws-elasticache-cluster-client-libmemcached library
  tags: awsmemcached
  git:
    repo: https://github.com/awslabs/aws-elasticache-cluster-client-libmemcached.git
    dest: /tmp/aws-libmemcached
    accept_hostkey: yes
    depth: 1

- name: Create build directory
  tags: awsmemcached
  file:
    dest: /tmp/aws-libmemcached/BUILD
    mode: 0755
    state: directory

- name: Configure aws-elasticache-cluster-client-libmemcached library
  tags: awsmemcached
  shell: >
    ../configure --prefix=/usr/local/lib/aws-libmemcached --with-pic
    chdir=/tmp/aws-libmemcached/BUILD

- name: Make and install aws-elasticache-cluster-client-libmemcached library
  tags: awsmemcached
  shell: >
    {{ item }}
    chdir=/tmp/aws-libmemcached/BUILD
  with_items:
    - make
    - make install

- name: Clone aws-elasticache-cluster-client-memcached-for-php
  tags: awsmemcached
  git:
    repo: https://github.com/awslabs/aws-elasticache-cluster-client-memcached-for-php.git
    dest: /tmp/aws-elasticache-cluster-client-memcached-for-php
    accept_hostkey: yes
    depth: 1
    version: php7

- name: Configure, compile and install aws-elasticache-cluster-client-memcached-for-php
  tags: awsmemcached
  shell: >
    {{ item }}
    chdir=/tmp/aws-elasticache-cluster-client-memcached-for-php
  with_items:
    - phpize
    - ./configure --with-libmemcached-dir=/usr/local/lib/aws-libmemcached --disable-memcached-sasl --enable-memcached-igbinary
    - sed -i "s#-lmemcached#/usr/local/lib/aws-libmemcached/lib/libmemcached.a -lcrypt -lpthread -lm -lstdc++#" Makefile
    - make
    - make install

- name: Enable aws-elasticache-cluster-client-memcached-for-php
  tags: php
  lineinfile:
    dest: "/etc/{{ php_conf_dir }}/zz-memcached.ini"
    line: "extension=memcached.so"
    create: yes

With the latest commit this gives the error undefined symbol: memcached_exist

When I checkout 7937c7f1907f74dc857ed8f34a0261bf0de89ae2 instead of HEAD of the php7 branch everything works

from aws-elasticache-cluster-client-memcached-for-php.

malyeyev-AMZN avatar malyeyev-AMZN commented on June 17, 2024

Potentially relevant changes in upsteam libmemcached between 1.0.8 and 1.0.18:

diff --git a/libmemcached-1.0/exist.h b/libmemcached-1.0/exist.h
index 5c60105..ef60a81 100644
--- a/libmemcached-1.0/exist.h
+++ b/libmemcached-1.0/exist.h
@@ -36,6 +36,10 @@

#pragma once

+#ifdef __cplusplus
+extern "C" {
+#endif
+
LIBMEMCACHED_API
memcached_return_t memcached_exist(memcached_st *memc, const char *key, size_t key_length);

@@ -43,3 +47,6 @@ LIBMEMCACHED_API
memcached_return_t memcached_exist_by_key(memcached_st *memc,
const char *group_key, size_t group_key_length,
const char *key, size_t key_length);
+#ifdef __cplusplus
+}
+#endif

from aws-elasticache-cluster-client-memcached-for-php.

sodabrew avatar sodabrew commented on June 17, 2024

Is this a bug in libmemcached for visibility of that symbol to C linkage?

from aws-elasticache-cluster-client-memcached-for-php.

malyeyev-AMZN avatar malyeyev-AMZN commented on June 17, 2024

@mvanbaak do you by any chance have multiple versions of libmemcached installed?
sudo yum list installed | grep libmem

from aws-elasticache-cluster-client-memcached-for-php.

malyeyev-AMZN avatar malyeyev-AMZN commented on June 17, 2024

Still can't reproduce it.

Unlikely but this may also be related to libmemcachedutil library. Just to rule it out, could you please try (between running ./configure and make) using the following

sed -i "s#-lmemcached\b#/usr/local/lib/aws-libmemcached/lib/libmemcached.a -lcrypt -lpthread -lm -lstdc++#" Makefile && sed -i "s#-lmemcachedutil\b#/usr/local/lib/aws-libmemcached/lib/libmemcachedutil.a#" Makefile
instead of
sed -i "s#-lmemcached#/usr/local/lib/aws-libmemcached/lib/libmemcached.a -lcrypt -lpthread -lm -lstdc++#" Makefile

from aws-elasticache-cluster-client-memcached-for-php.

mvanbaak avatar mvanbaak commented on June 17, 2024

I'll test that later tonight. Sorry, bit busy at the moment

from aws-elasticache-cluster-client-memcached-for-php.

malyeyev-AMZN avatar malyeyev-AMZN commented on June 17, 2024

@mvanbaak
Also I can't run your playbook

ansible-playbook -i "localhost," -c local issue-12.yml
ERROR! 'git' is not a valid attribute for a Play

The error appears to have been in '/home/ec2-user/issue-12.yml': line 1, column 3, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:


- name: Clone aws-elasticache-cluster-client-libmemcached library
  ^ here

from aws-elasticache-cluster-client-memcached-for-php.

malyeyev-AMZN avatar malyeyev-AMZN commented on June 17, 2024

Ok, able to reproduce now and debugging it.

from aws-elasticache-cluster-client-memcached-for-php.

malyeyev-AMZN avatar malyeyev-AMZN commented on June 17, 2024

@sodabrew looks like one of the changes upstream broke it:

php-memcached-dev/php-memcached@c564fd8#diff-9441255ac664d11fa292d9fb7ce03320L24

]$ nm /tmp/aws-elasticache-cluster-client-memcached-for-php/modules/memcached.so | grep memcached_exist
                 U memcached_exist
]$ nm /usr/local/lib/aws-libmemcached/lib/libmemcached.a | grep memcached_exist
00000000000003f5 T _Z15memcached_existP12memcached_stPKcm
000000000000042a T _Z22memcached_exist_by_keyP12memcached_stPKcmS2_m

from aws-elasticache-cluster-client-memcached-for-php.

mvanbaak avatar mvanbaak commented on June 17, 2024

Ok. If you want me to test something let me know. For now I told my playbook to use an older commit from the php7 branch ;-)

from aws-elasticache-cluster-client-memcached-for-php.

malyeyev-AMZN avatar malyeyev-AMZN commented on June 17, 2024

For reference I'm adding full Ansible YAML source and instructions to reproduce this which also happen to be modified to not use dynamic linking (produces same outcome as in original setup).

To run:

ansible-playbook -i "localhost," -c local issue-12-shared-lib.yml

To clean up:

sudo rm -rf /tmp/aws-* /etc/php-7.0.d/zz-memcached.ini /etc/ld.so.conf.d/aws-libmemcached.conf

issue-12-shared-lib.yml:

- hosts: localhost
  sudo: True
  tasks:
  - name: Clone aws-elasticache-cluster-client-libmemcached library
    tags: awsmemcached
    git:
      repo: https://github.com/awslabs/aws-elasticache-cluster-client-libmemcached.git
      dest: /tmp/aws-libmemcached
      accept_hostkey: yes
      depth: 1
  
  - name: Create build directory
    tags: awsmemcached
    file:
      dest: /tmp/aws-libmemcached/BUILD
      mode: 0755
      state: directory
  
  - name: Configure aws-elasticache-cluster-client-libmemcached library
    tags: awsmemcached
    shell: >
      ../configure --prefix=/usr/local/lib/aws-libmemcached --with-pic
      chdir=/tmp/aws-libmemcached/BUILD
  
  - name: Make and install aws-elasticache-cluster-client-libmemcached library
    tags: awsmemcached
    shell: >
      {{ item }}
      chdir=/tmp/aws-libmemcached/BUILD
    with_items:
      - make
      - make install
  
  - name: Add libmemcached isntall directory to system search path for shared libraries
    shell:
      echo "/usr/local/lib/aws-libmemcached/lib" > /etc/ld.so.conf.d/aws-libmemcached.conf
  
  - name: Clone aws-elasticache-cluster-client-memcached-for-php
    tags: awsmemcached
    git:
      repo: https://github.com/awslabs/aws-elasticache-cluster-client-memcached-for-php.git
      dest: /tmp/aws-elasticache-cluster-client-memcached-for-php
      accept_hostkey: yes
      depth: 1
      version: php7
  
  - name: Configure, compile and install aws-elasticache-cluster-client-memcached-for-php
    tags: awsmemcached
    shell: >
      {{ item }}
      chdir=/tmp/aws-elasticache-cluster-client-memcached-for-php
    with_items:
      - phpize
      - ./configure --with-libmemcached-dir=/usr/local/lib/aws-libmemcached --disable-memcached-sasl
      - make
      - make install
  
  - name: Enable aws-elasticache-cluster-client-memcached-for-php
    tags: php
    lineinfile:
      dest: "/etc/php-7.0.d/zz-memcached.ini"
      line: "extension=memcached.so"
      create: yes

from aws-elasticache-cluster-client-memcached-for-php.

malyeyev-AMZN avatar malyeyev-AMZN commented on June 17, 2024

Discussion moved to php-memcached-dev/php-memcached#295 (comment)

Once it is resolved upstream we will be merge the fix back into this repo

from aws-elasticache-cluster-client-memcached-for-php.

sodabrew avatar sodabrew commented on June 17, 2024

I've tagged php-memcached 3.0.1 with the fix for memcached_exists and others:
https://github.com/php-memcached-dev/php-memcached/releases/tag/v3.0.1

from aws-elasticache-cluster-client-memcached-for-php.

mvanbaak avatar mvanbaak commented on June 17, 2024

I just re-ran my ansible playbook on a completely new amazonlinux ami:

https://puu.sh/tVnhz/9050d46f28.png

Seems to be fixed. Thanks!

from aws-elasticache-cluster-client-memcached-for-php.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.