krakjoe / tombs

Detect unused code in production
Other
433 stars 20 forks source link

Build failed: zend_strpprintf #3

Closed Bogdaan closed 5 years ago

Bogdaan commented 5 years ago

Hi, i'm trying to build extension with docker:

FROM php:7.2-fpm-alpine

RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"

# option a
RUN apk add --no-cache git && \
        git clone https://github.com/krakjoe/tombs.git /tmp/tombs && \
        cd /tmp/tombs && \
        phpize && \
        ./configure --enable-tombs && \
        make -j$(/usr/bin/nproc) && \
        make test && \
        php -v

# option b
# RUN apk add --no-cache git && \
#      git clone https://github.com/krakjoe/tombs.git /tmp/tombs && \
#      docker-php-ext-configure /tmp/tombs && \
#      docker-php-ext-install /tmp/tombs && \
#      php -v

But see warnings during build process:

mkdir .libs
 cc -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -I. -I/tmp/tombs -DPHP_ATOM_INC -I/tmp/tombs/include -I/tmp/tombs/main -I/tmp/tombs -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 -fstack-protector-strong -fpic -fpie -O2 -DHAVE_CONFIG_H -fstack-protector-strong -fpic -fpie -O2 -c /tmp/tombs/zend_tombs.c  -fPIC -DPIC -o .libs/zend_tombs.o
/tmp/tombs/zend_tombs.c: In function 'zend_tombs_activate':
/tmp/tombs/zend_tombs.c:173:17: warning: implicit declaration of function 'zend_strpprintf'; did you mean 'zend_vstrpprintf'? [-Wimplicit-function-declaration]
         value = zend_strpprintf(0, "0x%08X", (unsigned int) level);
                 ^~~~~~~~~~~~~~~
                 zend_vstrpprintf
/tmp/tombs/zend_tombs.c:173:15: warning: assignment to 'zend_string *' {aka 'struct _zend_string *'} from 'int' makes pointer from integer without a cast [-Wint-conversion]
         value = zend_strpprintf(0, "0x%08X", (unsigned int) level);
               ^

And then unable to load ext.:

Failed loading /usr/local/lib/php/extensions/no-debug-non-zts-20160303/tombs.so:  Error relocating /usr/local/lib/php/extensions/no-debug-non-zts-20160303/tombs.so: zend_strpprintf: symbol not found

What am doing wrong?

Bogdaan commented 5 years ago

php-7.1 compatibility issue