You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@thrift.apache.org by GitBox <gi...@apache.org> on 2021/08/15 08:20:44 UTC
[GitHub] [thrift] DavertTanz commented on pull request #2288: THRIFT-5318: Update PHP thrift_protocol extension for PHP 8
DavertTanz commented on pull request #2288:
URL: https://github.com/apache/thrift/pull/2288#issuecomment-899014779
Hello everyone!
Sorry for writing in the old PR, but I have a problem that thrift protocol extension does not compile for PHP 8.
For example, I am using the following Dockerfile to reproduce the error:
```Dockerfile
FROM php:8-fpm
RUN apt update \
&& apt install -y wget \
openssl \
unzip \
libtool
RUN wget -O /tmp/thrift.zip https://github.com/apache/thrift/archive/refs/tags/v0.14.2.zip \
&& mkdir /tmp/thrift \
&& unzip -q /tmp/thrift.zip -d /tmp/thrift/ \
&& cd /tmp/thrift/thrift-0.14.2/ \
&& export PATH="/opt/remi/php80/root/bin/:$PATH" \
&& ./bootstrap.sh \
&& cd /tmp/thrift/thrift-0.14.2/lib/php/src/ext/thrift_protocol/ \
&& ./configure \
&& make \
&& cp /tmp/thrift/thrift-0.14.2/lib/php/src/ext/thrift_protocol/modules/thrift_protocol.so /usr/local/lib/php/extensions/no-debug-non-zts-20200930/thrift_protocol.so \
&& echo extension=thrift_protocol.so > /usr/local/etc/php/conf.d/thrift_protocol.ini
CMD ["php-fpm"]
```
And then I get the following log with errors:
```log
#6 0.315 --2021-08-15 08:02:33-- https://github.com/apache/thrift/archive/refs/tags/v0.14.2.zip
#6 0.319 Resolving github.com (github.com)... 140.82.121.3
#6 0.389 Connecting to github.com (github.com)|140.82.121.3|:443... connected.
#6 0.567 HTTP request sent, awaiting response... 302 Found
#6 0.626 Location: https://codeload.github.com/apache/thrift/zip/refs/tags/v0.14.2 [following]
#6 0.626 --2021-08-15 08:02:34-- https://codeload.github.com/apache/thrift/zip/refs/tags/v0.14.2
#6 0.626 Resolving codeload.github.com (codeload.github.com)... 140.82.121.9
#6 0.779 Connecting to codeload.github.com (codeload.github.com)|140.82.121.9|:443... connected.
#6 0.951 HTTP request sent, awaiting response... 200 OK
#6 1.176 Length: unspecified [application/zip]
#6 1.176 Saving to: '/tmp/thrift.zip'
#6 1.176
#6 1.176 0K .......... .......... .......... .......... .......... 445K
#6 1.288 50K .......... .......... .......... .......... .......... 905K
#6 1.343 100K .......... .......... .......... .......... .......... 3.27M
#6 1.359 150K .......... .......... .......... .......... .......... 910K
#6 1.413 200K .......... .......... .......... .......... .......... 919K
#6 1.468 250K .......... .......... .......... .......... .......... 907K
#6 1.523 300K .......... .......... .......... .......... .......... 1.12M
#6 1.567 350K .......... .......... .......... .......... .......... 910K
#6 1.621 400K .......... .......... .......... .......... .......... 3.20M
#6 1.637 450K .......... .......... .......... .......... .......... 927K
#6 1.691 500K .......... .......... .......... .......... .......... 920K
#6 1.745 550K .......... .......... .......... .......... .......... 1.12M
#6 1.788 600K .......... .......... .......... .......... .......... 895K
#6 1.844 650K .......... .......... .......... .......... .......... 925K
#6 1.898 700K .......... .......... .......... .......... .......... 3.18M
#6 1.914 750K .......... .......... .......... .......... .......... 923K
#6 1.968 800K .......... .......... .......... .......... .......... 952K
#6 2.020 850K .......... .......... .......... .......... .......... 1.08M
#6 2.066 900K .......... .......... .......... .......... .......... 3.19M
#6 2.081 950K .......... .......... .......... .......... .......... 920K
#6 2.135 1000K .......... .......... .......... .......... .......... 901K
#6 2.191 1050K .......... .......... .......... .......... .......... 917K
#6 2.245 1100K .......... .......... .......... .......... .......... 1.13M
#6 2.288 1150K .......... .......... .......... .......... .......... 926K
#6 2.342 1200K .......... .......... .......... .......... .......... 3.09M
#6 2.358 1250K .......... .......... .......... .......... .......... 919K
#6 2.413 1300K .......... .......... .......... .......... .......... 994K
#6 2.463 1350K .......... .......... .......... .......... .......... 1.05M
#6 2.522 1400K .......... .......... .......... .......... .......... 897K
#6 2.565 1450K .......... .......... .......... .......... .......... 928K
#6 2.619 1500K .......... .......... .......... .......... .......... 2.94M
#6 2.635 1550K .......... .......... .......... .......... .......... 923K
#6 2.690 1600K .......... .......... .......... .......... .......... 1.13M
#6 2.733 1650K .......... .......... .......... .......... .......... 941K
#6 2.786 1700K .......... .......... .......... .......... .......... 924K
#6 2.840 1750K .......... .......... .......... .......... .......... 899K
#6 2.896 1800K .......... .......... .......... .......... .......... 2.93M
#6 2.913 1850K .......... .......... .......... .......... .......... 927K
#6 2.966 1900K .......... .......... .......... .......... .......... 1.12M
#6 3.010 1950K .......... .......... .......... .......... .......... 947K
#6 3.063 2000K .......... .......... .......... .......... .......... 2.84M
#6 3.080 2050K .......... .......... .......... .......... .......... 921K
#6 3.134 2100K .......... .......... .......... .......... .......... 1.13M
#6 3.190 2150K .......... .......... .......... .......... .......... 840K
#6 3.237 2200K .......... .......... .......... .......... .......... 1021K
#6 3.286 2250K .......... .......... .......... .......... .......... 938K
#6 3.339 2300K .......... .......... .......... .......... .......... 2.70M
#6 3.357 2350K .......... .......... .......... .......... .......... 938K
#6 3.410 2400K .......... .......... .......... .......... .......... 1.11M
#6 3.454 2450K .......... .......... .......... .......... .......... 954K
#6 3.507 2500K .......... .......... .......... .......... .......... 905K
#6 3.562 2550K .......... .......... .......... .......... .......... 930K
#6 3.616 2600K .......... .......... .......... .......... .......... 2.62M
#6 3.634 2650K .......... .......... .......... .......... .......... 934K
#6 3.688 2700K .......... .......... .......... .......... .......... 1.17M
#6 3.730 2750K .......... .......... .......... .......... .......... 940K
#6 3.783 2800K .......... .......... .......... .......... .......... 2.59M
#6 3.802 2850K .......... .......... .......... .......... .......... 924K
#6 3.856 2900K .......... .......... .......... .......... .......... 897K
#6 3.912 2950K .......... .......... .......... .......... .......... 1.15M
#6 3.954 3000K .......... .......... .......... .......... .......... 949K
#6 4.007 3050K .......... .......... .......... .......... .......... 938K
#6 4.060 3100K .......... .......... .......... .......... .......... 2.64M
#6 4.079 3150K .......... .......... .......... .......... .......... 921K
#6 4.133 3200K .......... .......... .......... .......... .......... 1.15M
#6 4.175 3250K .......... .......... .......... .......... .......... 948K
#6 4.231 3300K .......... .......... .......... .......... .......... 898K
#6 4.284 3350K .......... .......... .......... .......... .......... 944K
#6 4.337 3400K .......... .......... .......... .......... .......... 2.58M
#6 4.356 3450K .......... .......... .......... .......... .......... 1.03M
#6 4.403 3500K .......... .......... .......... .......... .......... 1.01M
#6 4.451 3550K .......... .......... .......... .......... .......... 944K
#6 4.504 3600K .......... .......... .......... .......... .......... 2.58M
#6 4.523 3650K .......... .......... .......... .......... .......... 896K
#6 4.579 3700K .......... .......... .......... .......... .......... 922K
#6 4.633 3750K .......... .......... .......... .......... .......... 1.16M
#6 4.675 3800K .......... .......... .......... .......... .......... 948K
#6 4.728 3850K .......... .......... .......... .......... .......... 941K
#6 4.781 3900K .......... .......... .......... .......... .......... 2.45M
#6 4.801 3950K .......... .......... .......... .......... .......... 964K
#6 4.853 4000K .......... .......... .......... .......... .......... 1.16M
#6 4.911 4050K .......... .......... .......... .......... .......... 873K
#6 4.952 4100K .......... .......... .......... .......... .......... 948K
#6 5.005 4150K .......... .......... .......... .......... .......... 2.66M
#6 5.023 4200K .......... .......... .......... .......... .......... 923K
#6 5.078 4250K .......... .......... .......... .......... .......... 1.10M
#6 5.122 4300K .......... .......... .......... .......... .......... 997K
#6 5.172 4350K .......... .......... .......... .......... .......... 944K
#6 5.225 4400K .......... .......... .......... .......... .......... 2.46M
#6 5.281 4450K .......... .......... .......... .......... .......... 897K
#6 5.301 4500K .......... .......... .......... .......... .......... 921K
#6 5.355 4550K .......... .......... .......... .......... .......... 1.18M
#6 5.396 4600K .......... .......... .......... .......... .......... 948K
#6 5.449 4650K .......... .......... .......... .......... .......... 948K
#6 5.502 4700K .......... .......... .......... .......... .......... 2.40M
#6 5.522 4750K .......... .......... .......... .......... .......... 1004K
#6 5.572 4800K .......... .......... .......... .......... .......... 848K
#6 5.631 4850K .......... .......... .......... .......... .......... 1.20M
#6 5.672 4900K .......... .......... ..... 2.31M=4.5s
#6 5.682
#6 5.682 2021-08-15 08:02:39 (1.07 MB/s) - '/tmp/thrift.zip' saved [5043561]
#6 5.682
#6 5.844 make distclean... ok
#6 5.852 Configuring for:
#6 5.852 PHP Api Version: 20200930
#6 5.852 Zend Module Api No: 20200930
#6 5.852 Zend Extension Api No: 420200930
#6 9.455 configure.ac:89: installing './compile'
#6 9.456 configure.ac:93: installing './config.guess'
#6 9.457 configure.ac:93: installing './config.sub'
#6 9.459 configure.ac:27: installing './install-sh'
#6 9.460 configure.ac:27: installing './missing'
#6 9.498 compiler/cpp/Makefile.am: installing './depcomp'
#6 9.590 configure.ac: installing './ylwrap'
#6 11.15 checking for grep that handles long lines and -e... /bin/grep
#6 11.15 checking for egrep... /bin/grep -E
#6 11.15 checking for a sed that does not truncate output... /bin/sed
#6 11.16 checking for pkg-config... /usr/bin/pkg-config
#6 11.16 checking pkg-config is at least version 0.9.0... yes
#6 11.16 checking for cc... cc
#6 11.17 checking whether the C compiler works... yes
#6 11.19 checking for C compiler default output file name... a.out
#6 11.19 checking for suffix of executables...
#6 11.21 checking whether we are cross compiling... no
#6 11.23 checking for suffix of object files... o
#6 11.25 checking whether we are using the GNU C compiler... yes
#6 11.26 checking whether cc accepts -g... yes
#6 11.27 checking for cc option to accept ISO C89... none needed
#6 11.29 checking how to run the C preprocessor... cc -E
#6 11.31 checking for icc... no
#6 11.31 checking for suncc... no
#6 11.32 checking for system library directory... lib
#6 11.32 checking if compiler supports -R... no
#6 11.33 checking if compiler supports -Wl,-rpath,... yes
#6 11.35 checking build system type... x86_64-pc-linux-gnu
#6 11.37 checking host system type... x86_64-pc-linux-gnu
#6 11.37 checking target system type... x86_64-pc-linux-gnu
#6 11.39 checking for PHP prefix... /usr/local
#6 11.39 checking for PHP includes... -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib
#6 11.39 checking for PHP extension directory... /usr/local/lib/php/extensions/no-debug-non-zts-20200930
#6 11.39 checking for PHP installed headers prefix... /usr/local/include/php
#6 11.39 checking if debug is enabled... no
#6 11.40 checking if zts is enabled... no
#6 11.41 checking for gawk... no
#6 11.41 checking for nawk... nawk
#6 11.41 checking if nawk is broken... no
#6 11.41 checking whether to enable the thrift_protocol extension... yes, shared
#6 11.41 checking for g++... g++
#6 11.42 checking whether we are using the GNU C++ compiler... yes
#6 11.44 checking whether g++ accepts -g... yes
#6 11.45 checking how to run the C++ preprocessor... g++ -E
#6 11.47 checking for a sed that does not truncate output... /bin/sed
#6 11.48 checking for ld used by cc... /usr/bin/ld
#6 11.48 checking if the linker (/usr/bin/ld) is GNU ld... yes
#6 11.48 checking for /usr/bin/ld option to reload object files... -r
#6 11.48 checking for BSD-compatible nm... /usr/bin/nm -B
#6 11.48 checking whether ln -s works... yes
#6 11.48 checking how to recognize dependent libraries... pass_all
#6 11.49 checking for ANSI C header files... yes
#6 11.57 checking for sys/types.h... yes
#6 11.58 checking for sys/stat.h... yes
#6 11.60 checking for stdlib.h... yes
#6 11.62 checking for string.h... yes
#6 11.64 checking for memory.h... yes
#6 11.65 checking for strings.h... yes
#6 11.67 checking for inttypes.h... yes
#6 11.69 checking for stdint.h... yes
#6 11.71 checking for unistd.h... yes
#6 11.73 checking dlfcn.h usability... yes
#6 11.74 checking dlfcn.h presence... yes
#6 11.75 checking for dlfcn.h... yes
#6 11.75 checking how to run the C++ preprocessor... g++ -E
#6 11.76 checking the maximum length of command line arguments... 1572864
#6 11.77 checking command to parse /usr/bin/nm -B output from cc object... ok
#6 11.82 checking for objdir... .libs
#6 11.82 checking for ar... ar
#6 11.82 checking for ranlib... ranlib
#6 11.83 checking for strip... strip
#6 11.87 checking if cc supports -fno-rtti -fno-exceptions... no
#6 11.88 checking for cc option to produce PIC... -fPIC
#6 11.88 checking if cc PIC flag -fPIC works... yes
#6 11.90 checking if cc static flag -static works... yes
#6 11.93 checking if cc supports -c -o file.o... yes
#6 11.95 checking whether the cc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
#6 11.96 checking whether -lc should be explicitly linked in... no
#6 11.97 checking dynamic linker characteristics... GNU/Linux ld.so
#6 11.98 checking how to hardcode library paths into programs... immediate
#6 11.98 checking whether stripping libraries is possible... yes
#6 11.99 checking if libtool supports shared libraries... yes
#6 11.99 checking whether to build shared libraries... yes
#6 11.99 checking whether to build static libraries... no
#6 12.07
#6 12.07 creating libtool
#6 12.08 appending configuration tag "CXX" to libtool
#6 12.13 checking for ld used by g++... /usr/bin/ld -m elf_x86_64
#6 12.13 checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
#6 12.14 checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
#6 12.18 checking for g++ option to produce PIC... -fPIC
#6 12.18 checking if g++ PIC flag -fPIC works... yes
#6 12.19 checking if g++ static flag -static works... yes
#6 12.22 checking if g++ supports -c -o file.o... yes
#6 12.24 checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
#6 12.24 checking dynamic linker characteristics... GNU/Linux ld.so
#6 12.24 (cached) (cached) checking how to hardcode library paths into programs... immediate
#6 12.37 configure: patching config.h.in
#6 12.37 configure: creating ./config.status
#6 12.40 config.status: creating config.h
#6 12.42 /bin/bash /tmp/thrift/thrift-0.14.2/lib/php/src/ext/thrift_protocol/libtool --mode=compile g++ -I. -I/tmp/thrift/thrift-0.14.2/lib/php/src/ext/thrift_protocol -I/tmp/thrift/thrift-0.14.2/lib/php/src/ext/thrift_protocol/include -I/tmp/thrift/thrift-0.14.2/lib/php/src/ext/thrift_protocol/main -I/tmp/thrift/thrift-0.14.2/lib/php/src/ext/thrift_protocol -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -std=c++11 -c /tmp/thrift/thrift-0.14.2/lib/php/src/ext/thrift_protocol/php_thrift_protocol.cpp -o php_thrift_protocol.lo
#6 12.47 mkdir .libs
#6 12.47 g++ -I. -I/tmp/thrift/thrift-0.14.2/lib/php/src/ext/thrift_protocol -I/tmp/thrift/thrift-0.14.2/lib/php/src/ext/thrift_protocol/include -I/tmp/thrift/thrift-0.14.2/lib/php/src/ext/thrift_protocol/main -I/tmp/thrift/thrift-0.14.2/lib/php/src/ext/thrift_protocol -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -std=c++11 -c /tmp/thrift/thrift-0.14.2/lib/php/src/ext/thrift_protocol/php_thrift_protocol.cpp -fPIC -DPIC -o .libs/php_thrift_protocol.o
#6 12.64 /tmp/thrift/thrift-0.14.2/lib/php/src/ext/thrift_protocol/php_thrift_protocol.cpp: In function 'void createObject(const char*, zval*, int, zval*, zval*)':
#6 12.64 /tmp/thrift/thrift-0.14.2/lib/php/src/ext/thrift_protocol/php_thrift_protocol.cpp:417:20: error: cannot convert 'zval*' {aka '_zval_struct*'} to 'zend_object*' {aka '_zend_object*'}
#6 12.64 zend_call_method(return_value, ce, &constructor, nullptr, 0, &ctor_rv, nargs, arg1, arg2);
#6 12.64 ^~~~~~~~~~~~
#6 12.64 In file included from /tmp/thrift/thrift-0.14.2/lib/php/src/ext/thrift_protocol/php_thrift_protocol.cpp:24:
#6 12.64 /usr/local/include/php/Zend/zend_interfaces.h:41:46: note: initializing argument 1 of 'zval* zend_call_method(zend_object*, zend_class_entry*, zend_function**, const char*, size_t, zval*, uint32_t, zval*, zval*)'
#6 12.64 ZEND_API zval* zend_call_method(zend_object *object, zend_class_entry *obj_ce, zend_function **fn_proxy, const char *function_name, size_t function_name_len, zval *retval, uint32_t param_count, zval* arg1, zval* arg2);
#6 12.64 ~~~~~~~~~~~~~^~~~~~
#6 12.65 /tmp/thrift/thrift-0.14.2/lib/php/src/ext/thrift_protocol/php_thrift_protocol.cpp: In function 'void validate_thrift_object(zval*)':
#6 12.65 /tmp/thrift/thrift-0.14.2/lib/php/src/ext/thrift_protocol/php_thrift_protocol.cpp:931:65: error: cannot convert 'zval*' {aka '_zval_struct*'} to 'zend_object*' {aka '_zend_object*'}
#6 12.65 zval* prop = zend_read_property(object_class_entry, object, varname, strlen(varname), false, &rv);
#6 12.65 ^~~~~~
#6 12.65 In file included from /usr/local/include/php/main/php.h:35,
#6 12.65 from /tmp/thrift/thrift-0.14.2/lib/php/src/ext/thrift_protocol/php_thrift_protocol.cpp:23:
#6 12.65 /usr/local/include/php/Zend/zend_API.h:407:73: note: initializing argument 2 of 'zval* zend_read_property(zend_class_entry*, zend_object*, const char*, size_t, zend_bool, zval*)'
#6 12.65 ZEND_API zval *zend_read_property(zend_class_entry *scope, zend_object *object, const char *name, size_t name_length, zend_bool silent, zval *rv);
#6 12.65 ~~~~~~~~~~~~~^~~~~~
#6 12.65 /tmp/thrift/thrift-0.14.2/lib/php/src/ext/thrift_protocol/php_thrift_protocol.cpp: In function 'void binary_deserialize_spec(zval*, PHPInputTransport&, HashTable*)':
#6 12.65 /tmp/thrift/thrift-0.14.2/lib/php/src/ext/thrift_protocol/php_thrift_protocol.cpp:972:34: error: cannot convert 'zval*' {aka '_zval_struct*'} to 'zend_object*' {aka '_zend_object*'}
#6 12.65 zend_update_property(ce, zthis, varname, strlen(varname), &rv);
#6 12.65 ^~~~~
#6 12.65 In file included from /usr/local/include/php/main/php.h:35,
#6 12.65 from /tmp/thrift/thrift-0.14.2/lib/php/src/ext/thrift_protocol/php_thrift_protocol.cpp:23:
#6 12.65 /usr/local/include/php/Zend/zend_API.h:387:74: note: initializing argument 2 of 'void zend_update_property(zend_class_entry*, zend_object*, const char*, size_t, zval*)'
#6 12.65 ZEND_API void zend_update_property(zend_class_entry *scope, zend_object *object, const char *name, size_t name_length, zval *value);
#6 12.65 ~~~~~~~~~~~~~^~~~~~
#6 12.65 /tmp/thrift/thrift-0.14.2/lib/php/src/ext/thrift_protocol/php_thrift_protocol.cpp: In function 'void binary_serialize_spec(zval*, PHPOutputTransport&, HashTable*)':
#6 12.65 /tmp/thrift/thrift-0.14.2/lib/php/src/ext/thrift_protocol/php_thrift_protocol.cpp:1013:55: error: cannot convert 'zval*' {aka '_zval_struct*'} to 'zend_object*' {aka '_zend_object*'}
#6 12.65 zval* prop = zend_read_property(Z_OBJCE_P(zthis), zthis, varname, strlen(varname), false, &rv);
#6 12.65 ^~~~~
#6 12.65 In file included from /usr/local/include/php/main/php.h:35,
#6 12.65 from /tmp/thrift/thrift-0.14.2/lib/php/src/ext/thrift_protocol/php_thrift_protocol.cpp:23:
#6 12.65 /usr/local/include/php/Zend/zend_API.h:407:73: note: initializing argument 2 of 'zval* zend_read_property(zend_class_entry*, zend_object*, const char*, size_t, zend_bool, zval*)'
#6 12.65 ZEND_API zval *zend_read_property(zend_class_entry *scope, zend_object *object, const char *name, size_t name_length, zend_bool silent, zval *rv);
#6 12.65 ~~~~~~~~~~~~~^~~~~~
#6 12.67 make: *** [Makefile:209: php_thrift_protocol.lo] Error 1
```
May be I forgot to install something?
For PHP 7.4 everything goes well.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@thrift.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org