Skip to content

php7 build errors w/ --enable-memcached-protocol #258

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

Closed
mastre opened this issue Jun 28, 2016 · 8 comments
Closed

php7 build errors w/ --enable-memcached-protocol #258

mastre opened this issue Jun 28, 2016 · 8 comments
Milestone

Comments

@mastre
Copy link

mastre commented Jun 28, 2016

I'm building a static php-fpm binary using the php7 tree from git on CentOS 7. When building with only
--enable-memcached --enable-memcached-json
everything builds fine. When I enable binary protocol via
--enable-memcached --enable-memcached-protocol --enable-memcached-json
I get the build errors seen below. I'm linking to libmemcached-1.0.18 built from source w/ ./configure --enable-libmemcachedprotocol and installed in /usr/local

full config line:
./configure --prefix=/usr --with-config-file-path=/etc --enable-mysqlnd --with-mysqli=mysqlnd --with-mcrypt --with-zlib --with-gd --enable-gd-native-ttf --with-freetype-dir=/usr --with-curl --enable-mbstring --with-libmemcached-dir=/usr/local --enable-memcached --enable-memcached-protocol --enable-memcached-json --enable-fpm --enable-opcache --with-fpm-user=admin --with-fpm-group=admin --disable-rpath

(the version which builds w/o errors is the exact same sans --enable-memcached-protocol)

$ time make
...
/bin/sh /usr/src/php-7.0.8/libtool --silent --preserve-dup-deps --mode=compile cc -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -Iext/phar/ -I/usr/src/php-7.0.8/ext/phar/ -DPHP_ATOM_INC -I/usr/src/php-7.0.8/include -I/usr/src/php-7.0.8/main -I/usr/src/php-7.0.8 -I/usr/src/php-7.0.8/ext/date/lib -I/usr/include/libxml2 -I/usr/include/freetype2 -I/usr/src/php-7.0.8/ext/mbstring/oniguruma -I/usr/src/php-7.0.8/ext/mbstring/libmbfl -I/usr/src/php-7.0.8/ext/mbstring/libmbfl/mbfl -I/usr/src/php-7.0.8/ext/sqlite3/libsqlite -I/usr/local/include -I/usr/src/php-7.0.8/TSRM -I/usr/src/php-7.0.8/Zend    -I/usr/include -g -O2 -fvisibility=hidden -I/usr/src/php-7.0.8/ext/date/lib -I/usr/include/libxml2 -I/usr/include/freetype2 -I/usr/src/php-7.0.8/ext/mbstring/oniguruma -I/usr/src/php-7.0.8/ext/mbstring/libmbfl -I/usr/src/php-7.0.8/ext/mbstring/libmbfl/mbfl -I/usr/src/php-7.0.8/ext/sqlite3/libsqlite -I/usr/local/include   -c /usr/src/php-7.0.8/ext/phar/phar_path_check.c -o ext/phar/phar_path_check.lo
/bin/sh /usr/src/php-7.0.8/libtool --silent --preserve-dup-deps --mode=compile cc -I/usr/src/php-7.0.8     -Iext/php-memcached/ -I/usr/src/php-7.0.8/ext/php-memcached/ -DPHP_ATOM_INC -I/usr/src/php-7.0.8/include -I/usr/src/php-7.0.8/main -I/usr/src/php-7.0.8 -I/usr/src/php-7.0.8/ext/date/lib -I/usr/include/libxml2 -I/usr/include/freetype2 -I/usr/src/php-7.0.8/ext/mbstring/oniguruma -I/usr/src/php-7.0.8/ext/mbstring/libmbfl -I/usr/src/php-7.0.8/ext/mbstring/libmbfl/mbfl -I/usr/src/php-7.0.8/ext/sqlite3/libsqlite -I/usr/local/include -I/usr/src/php-7.0.8/TSRM -I/usr/src/php-7.0.8/Zend    -I/usr/include -g -O2 -fvisibility=hidden -I/usr/src/php-7.0.8/ext/date/lib -I/usr/include/libxml2 -I/usr/include/freetype2 -I/usr/src/php-7.0.8/ext/mbstring/oniguruma -I/usr/src/php-7.0.8/ext/mbstring/libmbfl -I/usr/src/php-7.0.8/ext/mbstring/libmbfl/mbfl -I/usr/src/php-7.0.8/ext/sqlite3/libsqlite -I/usr/local/include   -c /usr/src/php-7.0.8/ext/php-memcached/php_memcached.c -o ext/php-memcached/php_memcached.lo
/usr/src/php-7.0.8/ext/php-memcached/php_memcached.c: In function ‘s_stat_execute_cb’:
/usr/src/php-7.0.8/ext/php-memcached/php_memcached.c:2651:3: warning: passing argument 4 of ‘add_assoc_stringl_ex’ discards ‘const’ qualifier from pointer target type [enabled by default]
   add_assoc_stringl_ex(server_values, key, key_length, value, value_length);
   ^
In file included from /usr/src/php-7.0.8/main/php.h:39:0,
                 from /usr/src/php-7.0.8/ext/php-memcached/php_memcached.h:22,
                 from /usr/src/php-7.0.8/ext/php-memcached/php_memcached.c:25:
/usr/src/php-7.0.8/Zend/zend_API.h:397:14: note: expected ‘char *’ but argument is of type ‘const char *’
 ZEND_API int add_assoc_stringl_ex(zval *arg, const char *key, size_t key_len, char *str, size_t length);
              ^
/usr/src/php-7.0.8/ext/php-memcached/php_memcached.c: At top level:
/usr/src/php-7.0.8/ext/php-memcached/php_memcached.c:3331:1: error: unknown type name ‘zend_object_value’
 zend_object_value php_memc_server_new(zend_class_entry *ce)
 ^
/usr/src/php-7.0.8/ext/php-memcached/php_memcached.c: In function ‘php_memc_server_new’:
/usr/src/php-7.0.8/ext/php-memcached/php_memcached.c:3333:2: error: unknown type name ‘zend_object_value’
  zend_object_value retval;
  ^
/usr/src/php-7.0.8/ext/php-memcached/php_memcached.c:3343:8: error: request for member ‘handle’ in something not a structure or union
  retval.handle = zend_objects_store_put(intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, (zend_objects_free_object_storage_t)php_memc_server_free_storage, NULL);
        ^
/usr/src/php-7.0.8/ext/php-memcached/php_memcached.c:3343:50: error: ‘zend_objects_store_dtor_t’ undeclared (first use in this function)
  retval.handle = zend_objects_store_put(intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, (zend_objects_free_object_storage_t)php_memc_server_free_storage, NULL);
                                                  ^
/usr/src/php-7.0.8/ext/php-memcached/php_memcached.c:3343:50: note: each undeclared identifier is reported only once for each function it appears in
/usr/src/php-7.0.8/ext/php-memcached/php_memcached.c:3343:76: error: expected ‘)’ before ‘zend_objects_destroy_object’
  retval.handle = zend_objects_store_put(intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, (zend_objects_free_object_storage_t)php_memc_server_free_storage, NULL);
                                                                            ^
/usr/src/php-7.0.8/ext/php-memcached/php_memcached.c:3343:76: warning: passing argument 1 of ‘zend_objects_store_put’ from incompatible pointer type [enabled by default]
In file included from /usr/src/php-7.0.8/Zend/zend_globals.h:35:0,
                 from /usr/src/php-7.0.8/Zend/zend_compile.h:657,
                 from /usr/src/php-7.0.8/Zend/zend_modules.h:26,
                 from /usr/src/php-7.0.8/Zend/zend_API.h:27,
                 from /usr/src/php-7.0.8/main/php.h:39,
                 from /usr/src/php-7.0.8/ext/php-memcached/php_memcached.h:22,
                 from /usr/src/php-7.0.8/ext/php-memcached/php_memcached.c:25:
/usr/src/php-7.0.8/Zend/zend_objects_API.h:58:15: note: expected ‘struct zend_object *’ but argument is of type ‘struct php_memc_server_t *’
 ZEND_API void zend_objects_store_put(zend_object *object);
               ^
/usr/src/php-7.0.8/ext/php-memcached/php_memcached.c:3343:76: error: too many arguments to function ‘zend_objects_store_put’
  retval.handle = zend_objects_store_put(intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, (zend_objects_free_object_storage_t)php_memc_server_free_storage, NULL);
                                                                            ^
In file included from /usr/src/php-7.0.8/Zend/zend_globals.h:35:0,
                 from /usr/src/php-7.0.8/Zend/zend_compile.h:657,
                 from /usr/src/php-7.0.8/Zend/zend_modules.h:26,
                 from /usr/src/php-7.0.8/Zend/zend_API.h:27,
                 from /usr/src/php-7.0.8/main/php.h:39,
                 from /usr/src/php-7.0.8/ext/php-memcached/php_memcached.h:22,
                 from /usr/src/php-7.0.8/ext/php-memcached/php_memcached.c:25:
/usr/src/php-7.0.8/Zend/zend_objects_API.h:58:15: note: declared here
 ZEND_API void zend_objects_store_put(zend_object *object);
               ^
/usr/src/php-7.0.8/ext/php-memcached/php_memcached.c:3344:8: error: request for member ‘handlers’ in something not a structure or union
  retval.handlers = &memcached_server_object_handlers;
        ^
/usr/src/php-7.0.8/ext/php-memcached/php_memcached.c: In function ‘s_server_cursor_list_servers_cb’:
/usr/src/php-7.0.8/ext/php-memcached/php_memcached.c:3369:2: warning: passing argument 4 of ‘add_assoc_string_ex’ discards ‘const’ qualifier from pointer target type [enabled by default]
  add_assoc_string(&array, "host", memcached_server_name(instance));
  ^
In file included from /usr/src/php-7.0.8/main/php.h:39:0,
                 from /usr/src/php-7.0.8/ext/php-memcached/php_memcached.h:22,
                 from /usr/src/php-7.0.8/ext/php-memcached/php_memcached.c:25:
/usr/src/php-7.0.8/Zend/zend_API.h:396:14: note: expected ‘char *’ but argument is of type ‘const char *’
 ZEND_API int add_assoc_string_ex(zval *arg, const char *key, size_t key_len, char *str);
              ^
/usr/src/php-7.0.8/ext/php-memcached/php_memcached.c:3371:2: warning: passing argument 4 of ‘add_assoc_string_ex’ discards ‘const’ qualifier from pointer target type [enabled by default]
  add_assoc_string(&array, "type", memcached_server_type(instance));
  ^
In file included from /usr/src/php-7.0.8/main/php.h:39:0,
                 from /usr/src/php-7.0.8/ext/php-memcached/php_memcached.h:22,
                 from /usr/src/php-7.0.8/ext/php-memcached/php_memcached.c:25:
/usr/src/php-7.0.8/Zend/zend_API.h:396:14: note: expected ‘char *’ but argument is of type ‘const char *’
 ZEND_API int add_assoc_string_ex(zval *arg, const char *key, size_t key_len, char *str);
              ^
/usr/src/php-7.0.8/ext/php-memcached/php_memcached.c: In function ‘s_destroy_cb’:
/usr/src/php-7.0.8/ext/php-memcached/php_memcached.c:3649:10: error: ‘zend_fcall_info’ has no member named ‘object_ptr’
   if (fci->object_ptr != NULL) {
          ^
In file included from /usr/src/php-7.0.8/Zend/zend.h:39:0,
                 from /usr/src/php-7.0.8/main/php.h:35,
                 from /usr/src/php-7.0.8/ext/php-memcached/php_memcached.h:22,
                 from /usr/src/php-7.0.8/ext/php-memcached/php_memcached.c:25:
/usr/src/php-7.0.8/ext/php-memcached/php_memcached.c:3650:22: error: ‘zend_fcall_info’ has no member named ‘object_ptr’
    zval_ptr_dtor(&fci->object_ptr);
                      ^
/usr/src/php-7.0.8/Zend/zend_variables.h:122:49: note: in definition of macro ‘zval_ptr_dtor’
 #define zval_ptr_dtor(zval_ptr) _zval_ptr_dtor((zval_ptr) ZEND_FILE_LINE_CC)
                                                 ^
/usr/src/php-7.0.8/ext/php-memcached/php_memcached.c: In function ‘zim_MemcachedServer_run’:
/usr/src/php-7.0.8/ext/php-memcached/php_memcached.c:3660:2: error: unknown type name ‘zend’
  zend *address;
  ^
/usr/src/php-7.0.8/ext/php-memcached/php_memcached.c:3663:9: warning: assignment from incompatible pointer type [enabled by default]
  intern = Z_MEMC_OBJ_P(getThis());
         ^
/usr/src/php-7.0.8/ext/php-memcached/php_memcached.c:3669:2: warning: passing argument 2 of ‘php_memc_proto_handler_run’ from incompatible pointer type [enabled by default]
  rc = php_memc_proto_handler_run (intern->handler, address);
  ^
In file included from /usr/src/php-7.0.8/ext/php-memcached/php_memcached.c:27:0:
/usr/src/php-7.0.8/ext/php-memcached/php_memcached_server.h:36:11: note: expected ‘struct zend_string *’ but argument is of type ‘int *’
 zend_bool php_memc_proto_handler_run (php_memc_proto_handler_t *h, zend_string *address);
           ^
/usr/src/php-7.0.8/ext/php-memcached/php_memcached.c:58:46: error: ‘struct <anonymous>’ has no member named ‘server’
 #define MEMC_G(v) (php_memcached_globals.memc.v)
                                              ^
/usr/src/php-7.0.8/ext/php-memcached/php_memcached.c:3672:18: note: in expansion of macro ‘MEMC_G’
   s_destroy_cb (&MEMC_G(server.callbacks) [i].fci);
                  ^
/usr/src/php-7.0.8/ext/php-memcached/php_memcached.c: In function ‘zim_MemcachedServer_on’:
/usr/src/php-7.0.8/ext/php-memcached/php_memcached.c:58:46: error: ‘struct <anonymous>’ has no member named ‘server’
 #define MEMC_G(v) (php_memcached_globals.memc.v)
                                              ^
/usr/src/php-7.0.8/ext/php-memcached/php_memcached.c:3695:18: note: in expansion of macro ‘MEMC_G’
   s_destroy_cb (&MEMC_G(server.callbacks) [event].fci);
                  ^
/usr/src/php-7.0.8/ext/php-memcached/php_memcached.c:58:46: error: ‘struct <anonymous>’ has no member named ‘server’
 #define MEMC_G(v) (php_memcached_globals.memc.v)
                                              ^
/usr/src/php-7.0.8/ext/php-memcached/php_memcached.c:3697:3: note: in expansion of macro ‘MEMC_G’
   MEMC_G(server.callbacks) [event].fci       = fci;
   ^
/usr/src/php-7.0.8/ext/php-memcached/php_memcached.c:58:46: error: ‘struct <anonymous>’ has no member named ‘server’
 #define MEMC_G(v) (php_memcached_globals.memc.v)
                                              ^
/usr/src/php-7.0.8/ext/php-memcached/php_memcached.c:3698:3: note: in expansion of macro ‘MEMC_G’
   MEMC_G(server.callbacks) [event].fci_cache = fci_cache;
   ^
/usr/src/php-7.0.8/ext/php-memcached/php_memcached.c:3700:3: error: incompatible type for argument 1 of ‘zval_addref_p’
   Z_ADDREF_P (fci.function_name);
   ^
In file included from /usr/src/php-7.0.8/Zend/zend.h:31:0,
                 from /usr/src/php-7.0.8/main/php.h:35,
                 from /usr/src/php-7.0.8/ext/php-memcached/php_memcached.h:22,
                 from /usr/src/php-7.0.8/ext/php-memcached/php_memcached.c:25:
/usr/src/php-7.0.8/Zend/zend_types.h:820:36: note: expected ‘struct zval *’ but argument is of type ‘zval’
 static zend_always_inline uint32_t zval_addref_p(zval* pz) {
                                    ^
/usr/src/php-7.0.8/ext/php-memcached/php_memcached.c:3701:10: error: ‘zend_fcall_info’ has no member named ‘object_ptr’
   if (fci.object_ptr) {
          ^
In file included from /usr/src/php-7.0.8/Zend/zend.h:31:0,
                 from /usr/src/php-7.0.8/main/php.h:35,
                 from /usr/src/php-7.0.8/ext/php-memcached/php_memcached.h:22,
                 from /usr/src/php-7.0.8/ext/php-memcached/php_memcached.c:25:
/usr/src/php-7.0.8/ext/php-memcached/php_memcached.c:3702:19: error: ‘zend_fcall_info’ has no member named ‘object_ptr’
    Z_ADDREF_P (fci.object_ptr);
                   ^
/usr/src/php-7.0.8/Zend/zend_types.h:787:41: note: in definition of macro ‘Z_ADDREF_P’
 #define Z_ADDREF_P(pz)    zval_addref_p(pz)
                                         ^
/usr/src/php-7.0.8/ext/php-memcached/php_memcached.c: In function ‘zm_startup_memcached’:
/usr/src/php-7.0.8/ext/php-memcached/php_memcached.c:4436:37: warning: assignment from incompatible pointer type [enabled by default]
  memcached_server_ce->create_object = php_memc_server_new;
                                     ^
make: *** [ext/php-memcached/php_memcached.lo] Error 1

real    4m4.563s
user    3m32.528s
sys 0m37.928s

Is this an indication that the binary protocol part of the code has not yet been updated to work with php 7?

@edoger
Copy link

edoger commented Nov 9, 2016

I've had the same problem as you.
:(

@sodabrew
Copy link
Contributor

The 3.0.0 release will be released Real Soon Now. I'm cleaning up the tickets in preparation.

@sodabrew
Copy link
Contributor

I just tested and this is still broken. Reopening for 3.0.0.

@sodabrew sodabrew reopened this Jan 24, 2017
@sodabrew sodabrew modified the milestones: 3.0.0, 3.0.1 Jan 24, 2017
@edoger
Copy link

edoger commented Jan 25, 2017

What about ?

@mastre
Copy link
Author

mastre commented Jan 25, 2017

Just a followup, I too retested today with both the master and the php7 branch (which I assume is no longer needed, correct?) against php 7.1.1 and it still fails.

I can still build on 7.1.1 using master but without the --enable-memcached-protocol (previously, I had to use the php7 branch to build at all against php 7.x).

@sodabrew
Copy link
Contributor

sodabrew commented Jan 25, 2017

Is this an indication that the binary protocol part of the code has not yet been updated to work with php 7?

Yes, exactly. Because this region of code was not enabled by default, it was not tested and migrated to the PHP internals that have changed. I'm not going to hold up the 3.0.0 release over it, but it will be valuable to fix it for the first bugfix release after.

(I merged the php7 branch to master last week, so the php7 branch is now considered inactive.)

@mastre
Copy link
Author

mastre commented Jan 27, 2017

Awesome, look forward to testing it once fixed in 3.0.1.

@sodabrew
Copy link
Contributor

sodabrew commented Feb 7, 2017

Resolved by #312

@sodabrew sodabrew closed this as completed Feb 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants