Skip to content

Cannot install xsl-ext on any alpine version of PHP 7.4.0 #915

@ottnorml

Description

@ottnorml

Hello everybody,
I create the PHP images in my company and wanted to update them to PHP 7.4. Unfortunately, all Alpine-based image builds fail during the installation of the XSL extension.
This problem can be reproduced with this Dockerfile template:
The %%PHP_VARIANT%% variable must be replaced with cli, fpm or zts.

FROM php:7.4.0-%%PHP_VARIANT%%-alpine

## Install PHP extensions
RUN set -xe; \
    \
    apk --update add --no-cache --virtual .php-ext-install-deps \
        $PHPIZE_DEPS \
        # xsl deps
        libxslt-dev \
    \
    && docker-php-ext-install -j$(nproc) \
        xsl \
    && docker-php-source delete \
    \
    && runDeps="$( \
        scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \
            | tr ',' '\n' \
            | sort -u \
            | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
    )" \
    && apk add --no-cache $runDeps \
    \
    && apk del --no-network .php-ext-install-deps

The images are built by running docker build --compress --force-rm --no-cache --pull -t test/php:7.4.0-%%PHP_VARIANT%%-alpine 7.4/alpine/%%PHP_VARIANT%%.

These are the build logs of all 3 variants:

Output for php:7.4.0-cli-alpine
Sending build context to Docker daemon     533B
Step 1/2 : FROM php:7.4.0-cli-alpine
7.4.0-cli-alpine: Pulling from library/php
Digest: sha256:f9decffa7618542aa99de5ba6997214b9d9c178ba81c8cc2ea573473a3e51b6d
Status: Image is up to date for php:7.4.0-cli-alpine
 ---> 3d0ba8511fe4
Step 2/2 : RUN set -xe;         apk --update add --no-cache --virtual .php-ext-install-deps         $PHPIZE_DEPS         libxslt-dev         && docker-php-ext-install -j$(nproc)         xsl     && docker-php-source delete         && runDeps="$(         scanelf --needed --nobanner --format '%n#p' --recursive /usr/local             | tr ',' '\n'             | sort -u             | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }'     )"     && apk add --no-cache $runDeps         && apk del --no-network .php-ext-install-deps
 ---> Running in cdbae96cd67a
+ apk --update add --no-cache --virtual .php-ext-install-deps autoconf dpkg-dev dpkg file g++ gcc libc-dev make pkgconf re2c libxslt-dev
fetch http://dl-cdn.alpinelinux.org/alpine/v3.10/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.10/community/x86_64/APKINDEX.tar.gz
(1/31) Installing m4 (1.4.18-r1)
(2/31) Installing libbz2 (1.0.6-r7)
(3/31) Installing perl (5.28.2-r1)
(4/31) Installing autoconf (2.69-r2)
(5/31) Installing pkgconf (1.6.1-r1)
(6/31) Installing dpkg-dev (1.19.7-r0)
(7/31) Installing dpkg (1.19.7-r0)
(8/31) Installing libmagic (5.37-r1)
(9/31) Installing file (5.37-r1)
(10/31) Installing libgcc (8.3.0-r0)
(11/31) Installing libstdc++ (8.3.0-r0)
(12/31) Installing binutils (2.32-r0)
(13/31) Installing gmp (6.1.2-r1)
(14/31) Installing isl (0.18-r0)
(15/31) Installing libgomp (8.3.0-r0)
(16/31) Installing libatomic (8.3.0-r0)
(17/31) Installing mpfr3 (3.1.5-r1)
(18/31) Installing mpc1 (1.1.0-r0)
(19/31) Installing gcc (8.3.0-r0)
(20/31) Installing musl-dev (1.1.22-r3)
(21/31) Installing libc-dev (0.7.1-r0)
(22/31) Installing g++ (8.3.0-r0)
(23/31) Installing make (4.2.1-r2)
(24/31) Installing re2c (1.1.1-r0)
(25/31) Installing libgpg-error (1.36-r2)
(26/31) Installing libgcrypt (1.8.5-r0)
(27/31) Installing libxslt (1.1.33-r2)
(28/31) Installing zlib-dev (1.2.11-r1)
(29/31) Installing libxml2-dev (2.9.9-r2)
(30/31) Installing libxslt-dev (1.1.33-r2)
(31/31) Installing .php-ext-install-deps (20191202.202334)
Executing busybox-1.30.1-r2.trigger
OK: 230 MiB in 62 packages
+ nproc
+ docker-php-ext-install -j4 xsl
fetch http://dl-cdn.alpinelinux.org/alpine/v3.10/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.10/community/x86_64/APKINDEX.tar.gz
(1/1) Installing .phpize-deps (20191202.202341)
OK: 230 MiB in 63 packages
Configuring for:
PHP Api Version:         20190902
Zend Module Api No:      20190902
Zend Extension Api No:   320190902
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for a sed that does not truncate output... /bin/sed
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-pc-linux-musl
checking host system type... x86_64-pc-linux-musl
checking target system type... x86_64-pc-linux-musl
checking for PHP prefix... /usr/local
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
checking for PHP extension directory... /usr/local/lib/php/extensions/no-debug-non-zts-20190902
checking for PHP installed headers prefix... /usr/local/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for gawk... no
checking for nawk... no
checking for awk... awk
checking if awk is broken... no
checking whether to build with XSL support... yes, shared
checking for libxslt >= 1.1.0... yes
checking for libexslt... yes
checking for a sed that does not truncate output... /bin/sed
checking for ld used by cc... /usr/x86_64-alpine-linux-musl/bin/ld
checking if the linker (/usr/x86_64-alpine-linux-musl/bin/ld) is GNU ld... yes
checking for /usr/x86_64-alpine-linux-musl/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking whether ln -s works... yes
checking how to recognize dependent libraries... pass_all
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking the maximum length of command line arguments... 98304
checking command to parse /usr/bin/nm -B output from cc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking if cc supports -fno-rtti -fno-exceptions... no
checking for cc option to produce PIC... -fPIC
checking if cc PIC flag -fPIC works... yes
checking if cc static flag -static works... yes
checking if cc supports -c -o file.o... yes
checking whether the cc linker (/usr/x86_64-alpine-linux-musl/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no

creating libtool
appending configuration tag "CXX" to libtool
configure: patching config.h.in
configure: creating ./config.status
config.status: creating config.h
/bin/sh /usr/src/php/ext/xsl/libtool --mode=compile cc  -I. -I/usr/src/php/ext/xsl -DPHP_ATOM_INC -I/usr/src/php/ext/xsl/include -I/usr/src/php/ext/xsl/main -I/usr/src/php/ext/xsl -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 -I/usr/include/libxml2  -fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H  -fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64   -c /usr/src/php/ext/xsl/php_xsl.c -o php_xsl.lo
/bin/sh /usr/src/php/ext/xsl/libtool --mode=compile cc  -I. -I/usr/src/php/ext/xsl -DPHP_ATOM_INC -I/usr/src/php/ext/xsl/include -I/usr/src/php/ext/xsl/main -I/usr/src/php/ext/xsl -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 -I/usr/include/libxml2  -fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H  -fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64   -c /usr/src/php/ext/xsl/xsltprocessor.c -o xsltprocessor.lo
mkdir .libs
mkdir .libs
mkdir: can't create directory '.libs': File exists
 cc -I. -I/usr/src/php/ext/xsl -DPHP_ATOM_INC -I/usr/src/php/ext/xsl/include -I/usr/src/php/ext/xsl/main -I/usr/src/php/ext/xsl -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 -I/usr/include/libxml2 -fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H -fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -c /usr/src/php/ext/xsl/xsltprocessor.c  -fPIC -DPIC -o .libs/xsltprocessor.o
 cc -I. -I/usr/src/php/ext/xsl -DPHP_ATOM_INC -I/usr/src/php/ext/xsl/include -I/usr/src/php/ext/xsl/main -I/usr/src/php/ext/xsl -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 -I/usr/include/libxml2 -fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H -fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -c /usr/src/php/ext/xsl/php_xsl.c  -fPIC -DPIC -o .libs/php_xsl.o
/bin/sh /usr/src/php/ext/xsl/libtool --mode=link cc -DPHP_ATOM_INC -I/usr/src/php/ext/xsl/include -I/usr/src/php/ext/xsl/main -I/usr/src/php/ext/xsl -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 -I/usr/include/libxml2  -fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H  -fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  -Wl,-O1 -Wl,--hash-style=both -pie  -o xsl.la -export-dynamic -avoid-version -prefer-pic -module -rpath /usr/src/php/ext/xsl/modules  php_xsl.lo xsltprocessor.lo -lxslt -lxml2 -lexslt -lxslt -lgcrypt -lgpg-error -lxml2
cc -shared  .libs/php_xsl.o .libs/xsltprocessor.o  -lexslt -lxslt -lgcrypt -lgpg-error -lxml2  -Wl,-O1 -Wl,--hash-style=both -Wl,-soname -Wl,xsl.so -o .libs/xsl.so
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: cannot find -lgcrypt
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: cannot find -lgpg-error
collect2: error: ld returned 1 exit status
make: *** [Makefile:199: xsl.la] Error 1
Removing intermediate container cdbae96cd67a
The command '/bin/sh -c set -xe;         apk --update add --no-cache --virtual .php-ext-install-deps         $PHPIZE_DEPS         libxslt-dev         && docker-php-ext-install -j$(nproc)         xsl     && docker-php-source delete         && runDeps="$(         scanelf --needed --nobanner --format '%n#p' --recursive /usr/local             | tr ',' '\n'             | sort -u             | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }'     )"     && apk add --no-cache $runDeps         && apk del --no-network .php-ext-install-deps' returned a non-zero code: 2
Output for php:7.4.0-fpm-alpine
Sending build context to Docker daemon     533B
Step 1/2 : FROM php:7.4.0-fpm-alpine
7.4.0-fpm-alpine: Pulling from library/php
Digest: sha256:9fe54440e90b0bb6c7cc4671ef067464d1051988555be4d1a4b767868494179e
Status: Image is up to date for php:7.4.0-fpm-alpine
 ---> c6d45e0eb6ac
Step 2/2 : RUN set -xe;         apk --update add --no-cache --virtual .php-ext-install-deps         $PHPIZE_DEPS         libxslt-dev         && docker-php-ext-install -j$(nproc)         xsl     && docker-php-source delete         && runDeps="$(         scanelf --needed --nobanner --format '%n#p' --recursive /usr/local             | tr ',' '\n'             | sort -u             | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }'     )"     && apk add --no-cache $runDeps         && apk del --no-network .php-ext-install-deps
 ---> Running in af5f8a91a9b5
+ apk --update add --no-cache --virtual .php-ext-install-deps autoconf dpkg-dev dpkg file g++ gcc libc-dev make pkgconf re2c libxslt-dev
fetch http://dl-cdn.alpinelinux.org/alpine/v3.10/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.10/community/x86_64/APKINDEX.tar.gz
(1/31) Installing m4 (1.4.18-r1)
(2/31) Installing libbz2 (1.0.6-r7)
(3/31) Installing perl (5.28.2-r1)
(4/31) Installing autoconf (2.69-r2)
(5/31) Installing pkgconf (1.6.1-r1)
(6/31) Installing dpkg-dev (1.19.7-r0)
(7/31) Installing dpkg (1.19.7-r0)
(8/31) Installing libmagic (5.37-r1)
(9/31) Installing file (5.37-r1)
(10/31) Installing libgcc (8.3.0-r0)
(11/31) Installing libstdc++ (8.3.0-r0)
(12/31) Installing binutils (2.32-r0)
(13/31) Installing gmp (6.1.2-r1)
(14/31) Installing isl (0.18-r0)
(15/31) Installing libgomp (8.3.0-r0)
(16/31) Installing libatomic (8.3.0-r0)
(17/31) Installing mpfr3 (3.1.5-r1)
(18/31) Installing mpc1 (1.1.0-r0)
(19/31) Installing gcc (8.3.0-r0)
(20/31) Installing musl-dev (1.1.22-r3)
(21/31) Installing libc-dev (0.7.1-r0)
(22/31) Installing g++ (8.3.0-r0)
(23/31) Installing make (4.2.1-r2)
(24/31) Installing re2c (1.1.1-r0)
(25/31) Installing libgpg-error (1.36-r2)
(26/31) Installing libgcrypt (1.8.5-r0)
(27/31) Installing libxslt (1.1.33-r2)
(28/31) Installing zlib-dev (1.2.11-r1)
(29/31) Installing libxml2-dev (2.9.9-r2)
(30/31) Installing libxslt-dev (1.1.33-r2)
(31/31) Installing .php-ext-install-deps (20191202.202353)
Executing busybox-1.30.1-r2.trigger
OK: 230 MiB in 62 packages
+ nproc
+ docker-php-ext-install -j4 xsl
fetch http://dl-cdn.alpinelinux.org/alpine/v3.10/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.10/community/x86_64/APKINDEX.tar.gz
(1/1) Installing .phpize-deps (20191202.202400)
OK: 230 MiB in 63 packages
Configuring for:
PHP Api Version:         20190902
Zend Module Api No:      20190902
Zend Extension Api No:   320190902
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for a sed that does not truncate output... /bin/sed
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-pc-linux-musl
checking host system type... x86_64-pc-linux-musl
checking target system type... x86_64-pc-linux-musl
checking for PHP prefix... /usr/local
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
checking for PHP extension directory... /usr/local/lib/php/extensions/no-debug-non-zts-20190902
checking for PHP installed headers prefix... /usr/local/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for gawk... no
checking for nawk... no
checking for awk... awk
checking if awk is broken... no
checking whether to build with XSL support... yes, shared
checking for libxslt >= 1.1.0... yes
checking for libexslt... yes
checking for a sed that does not truncate output... /bin/sed
checking for ld used by cc... /usr/x86_64-alpine-linux-musl/bin/ld
checking if the linker (/usr/x86_64-alpine-linux-musl/bin/ld) is GNU ld... yes
checking for /usr/x86_64-alpine-linux-musl/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking whether ln -s works... yes
checking how to recognize dependent libraries... pass_all
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking the maximum length of command line arguments... 98304
checking command to parse /usr/bin/nm -B output from cc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking if cc supports -fno-rtti -fno-exceptions... no
checking for cc option to produce PIC... -fPIC
checking if cc PIC flag -fPIC works... yes
checking if cc static flag -static works... yes
checking if cc supports -c -o file.o... yes
checking whether the cc linker (/usr/x86_64-alpine-linux-musl/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no

creating libtool
appending configuration tag "CXX" to libtool
configure: patching config.h.in
configure: creating ./config.status
config.status: creating config.h
/bin/sh /usr/src/php/ext/xsl/libtool --mode=compile cc  -I. -I/usr/src/php/ext/xsl -DPHP_ATOM_INC -I/usr/src/php/ext/xsl/include -I/usr/src/php/ext/xsl/main -I/usr/src/php/ext/xsl -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 -I/usr/include/libxml2  -fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H  -fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64   -c /usr/src/php/ext/xsl/php_xsl.c -o php_xsl.lo
/bin/sh /usr/src/php/ext/xsl/libtool --mode=compile cc  -I. -I/usr/src/php/ext/xsl -DPHP_ATOM_INC -I/usr/src/php/ext/xsl/include -I/usr/src/php/ext/xsl/main -I/usr/src/php/ext/xsl -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 -I/usr/include/libxml2  -fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H  -fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64   -c /usr/src/php/ext/xsl/xsltprocessor.c -o xsltprocessor.lo
mkdir .libs
 cc -I. -I/usr/src/php/ext/xsl -DPHP_ATOM_INC -I/usr/src/php/ext/xsl/include -I/usr/src/php/ext/xsl/main -I/usr/src/php/ext/xsl -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 -I/usr/include/libxml2 -fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H -fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -c /usr/src/php/ext/xsl/php_xsl.c  -fPIC -DPIC -o .libs/php_xsl.o
 cc -I. -I/usr/src/php/ext/xsl -DPHP_ATOM_INC -I/usr/src/php/ext/xsl/include -I/usr/src/php/ext/xsl/main -I/usr/src/php/ext/xsl -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 -I/usr/include/libxml2 -fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H -fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -c /usr/src/php/ext/xsl/xsltprocessor.c  -fPIC -DPIC -o .libs/xsltprocessor.o
/bin/sh /usr/src/php/ext/xsl/libtool --mode=link cc -DPHP_ATOM_INC -I/usr/src/php/ext/xsl/include -I/usr/src/php/ext/xsl/main -I/usr/src/php/ext/xsl -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 -I/usr/include/libxml2  -fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H  -fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  -Wl,-O1 -Wl,--hash-style=both -pie  -o xsl.la -export-dynamic -avoid-version -prefer-pic -module -rpath /usr/src/php/ext/xsl/modules  php_xsl.lo xsltprocessor.lo -lxslt -lxml2 -lexslt -lxslt -lgcrypt -lgpg-error -lxml2
cc -shared  .libs/php_xsl.o .libs/xsltprocessor.o  -lexslt -lxslt -lgcrypt -lgpg-error -lxml2  -Wl,-O1 -Wl,--hash-style=both -Wl,-soname -Wl,xsl.so -o .libs/xsl.so
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: cannot find -lgcrypt
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: cannot find -lgpg-error
collect2: error: ld returned 1 exit status
make: *** [Makefile:199: xsl.la] Error 1
Removing intermediate container af5f8a91a9b5
The command '/bin/sh -c set -xe;         apk --update add --no-cache --virtual .php-ext-install-deps         $PHPIZE_DEPS         libxslt-dev         && docker-php-ext-install -j$(nproc)         xsl     && docker-php-source delete         && runDeps="$(         scanelf --needed --nobanner --format '%n#p' --recursive /usr/local             | tr ',' '\n'             | sort -u             | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }'     )"     && apk add --no-cache $runDeps         && apk del --no-network .php-ext-install-deps' returned a non-zero code: 2
Output for php:7.4.0-fpm-alpine
Sending build context to Docker daemon     532B
Step 1/2 : FROM php:7.4.0-zts-alpine
7.4.0-zts-alpine: Pulling from library/php
Digest: sha256:9d67ae7b8005879a3ae36e9d749819a2d19169759b3f8ee6c92f4fe3eda56549
Status: Image is up to date for php:7.4.0-zts-alpine
 ---> 9fed91274b50
Step 2/2 : RUN set -xe;         apk --update add --no-cache --virtual .php-ext-install-deps         $PHPIZE_DEPS         libxslt-dev         && docker-php-ext-install -j$(nproc)         xsl     && docker-php-source delete         && runDeps="$(         scanelf --needed --nobanner --format '%n#p' --recursive /usr/local             | tr ',' '\n'             | sort -u             | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }'     )"     && apk add --no-cache $runDeps         && apk del --no-network .php-ext-install-deps
 ---> Running in 8f411d5958f0
+ apk --update add --no-cache --virtual .php-ext-install-deps autoconf dpkg-dev dpkg file g++ gcc libc-dev make pkgconf re2c libxslt-dev
fetch http://dl-cdn.alpinelinux.org/alpine/v3.10/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.10/community/x86_64/APKINDEX.tar.gz
(1/31) Installing m4 (1.4.18-r1)
(2/31) Installing libbz2 (1.0.6-r7)
(3/31) Installing perl (5.28.2-r1)
(4/31) Installing autoconf (2.69-r2)
(5/31) Installing pkgconf (1.6.1-r1)
(6/31) Installing dpkg-dev (1.19.7-r0)
(7/31) Installing dpkg (1.19.7-r0)
(8/31) Installing libmagic (5.37-r1)
(9/31) Installing file (5.37-r1)
(10/31) Installing libgcc (8.3.0-r0)
(11/31) Installing libstdc++ (8.3.0-r0)
(12/31) Installing binutils (2.32-r0)
(13/31) Installing gmp (6.1.2-r1)
(14/31) Installing isl (0.18-r0)
(15/31) Installing libgomp (8.3.0-r0)
(16/31) Installing libatomic (8.3.0-r0)
(17/31) Installing mpfr3 (3.1.5-r1)
(18/31) Installing mpc1 (1.1.0-r0)
(19/31) Installing gcc (8.3.0-r0)
(20/31) Installing musl-dev (1.1.22-r3)
(21/31) Installing libc-dev (0.7.1-r0)
(22/31) Installing g++ (8.3.0-r0)
(23/31) Installing make (4.2.1-r2)
(24/31) Installing re2c (1.1.1-r0)
(25/31) Installing libgpg-error (1.36-r2)
(26/31) Installing libgcrypt (1.8.5-r0)
(27/31) Installing libxslt (1.1.33-r2)
(28/31) Installing zlib-dev (1.2.11-r1)
(29/31) Installing libxml2-dev (2.9.9-r2)
(30/31) Installing libxslt-dev (1.1.33-r2)
(31/31) Installing .php-ext-install-deps (20191202.202411)
Executing busybox-1.30.1-r2.trigger
OK: 230 MiB in 62 packages
+ nproc
+ docker-php-ext-install -j4 xsl
fetch http://dl-cdn.alpinelinux.org/alpine/v3.10/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.10/community/x86_64/APKINDEX.tar.gz
(1/1) Installing .phpize-deps (20191202.202419)
OK: 230 MiB in 63 packages
Configuring for:
PHP Api Version:         20190902
Zend Module Api No:      20190902
Zend Extension Api No:   320190902
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for a sed that does not truncate output... /bin/sed
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-pc-linux-musl
checking host system type... x86_64-pc-linux-musl
checking target system type... x86_64-pc-linux-musl
checking for PHP prefix... /usr/local
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
checking for PHP extension directory... /usr/local/lib/php/extensions/no-debug-zts-20190902
checking for PHP installed headers prefix... /usr/local/include/php
checking if debug is enabled... no
checking if zts is enabled... yes
checking for gawk... no
checking for nawk... no
checking for awk... awk
checking if awk is broken... no
checking whether to build with XSL support... yes, shared
checking for libxslt >= 1.1.0... yes
checking for libexslt... yes
checking for a sed that does not truncate output... /bin/sed
checking for ld used by cc... /usr/x86_64-alpine-linux-musl/bin/ld
checking if the linker (/usr/x86_64-alpine-linux-musl/bin/ld) is GNU ld... yes
checking for /usr/x86_64-alpine-linux-musl/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking whether ln -s works... yes
checking how to recognize dependent libraries... pass_all
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking the maximum length of command line arguments... 98304
checking command to parse /usr/bin/nm -B output from cc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking if cc supports -fno-rtti -fno-exceptions... no
checking for cc option to produce PIC... -fPIC
checking if cc PIC flag -fPIC works... yes
checking if cc static flag -static works... yes
checking if cc supports -c -o file.o... yes
checking whether the cc linker (/usr/x86_64-alpine-linux-musl/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no

creating libtool
appending configuration tag "CXX" to libtool
configure: patching config.h.in
configure: creating ./config.status
config.status: creating config.h
/bin/sh /usr/src/php/ext/xsl/libtool --mode=compile cc  -I. -I/usr/src/php/ext/xsl -DPHP_ATOM_INC -I/usr/src/php/ext/xsl/include -I/usr/src/php/ext/xsl/main -I/usr/src/php/ext/xsl -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 -I/usr/include/libxml2  -fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H  -fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64   -c /usr/src/php/ext/xsl/php_xsl.c -o php_xsl.lo
/bin/sh /usr/src/php/ext/xsl/libtool --mode=compile cc  -I. -I/usr/src/php/ext/xsl -DPHP_ATOM_INC -I/usr/src/php/ext/xsl/include -I/usr/src/php/ext/xsl/main -I/usr/src/php/ext/xsl -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 -I/usr/include/libxml2  -fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H  -fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64   -c /usr/src/php/ext/xsl/xsltprocessor.c -o xsltprocessor.lo
mkdir .libs
 cc -I. -I/usr/src/php/ext/xsl -DPHP_ATOM_INC -I/usr/src/php/ext/xsl/include -I/usr/src/php/ext/xsl/main -I/usr/src/php/ext/xsl -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 -I/usr/include/libxml2 -fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H -fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -c /usr/src/php/ext/xsl/php_xsl.c  -fPIC -DPIC -o .libs/php_xsl.o
 cc -I. -I/usr/src/php/ext/xsl -DPHP_ATOM_INC -I/usr/src/php/ext/xsl/include -I/usr/src/php/ext/xsl/main -I/usr/src/php/ext/xsl -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 -I/usr/include/libxml2 -fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H -fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -c /usr/src/php/ext/xsl/xsltprocessor.c  -fPIC -DPIC -o .libs/xsltprocessor.o
/bin/sh /usr/src/php/ext/xsl/libtool --mode=link cc -DPHP_ATOM_INC -I/usr/src/php/ext/xsl/include -I/usr/src/php/ext/xsl/main -I/usr/src/php/ext/xsl -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 -I/usr/include/libxml2  -fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H  -fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  -Wl,-O1 -Wl,--hash-style=both -pie  -o xsl.la -export-dynamic -avoid-version -prefer-pic -module -rpath /usr/src/php/ext/xsl/modules  php_xsl.lo xsltprocessor.lo -lxslt -lxml2 -lexslt -lxslt -lgcrypt -lgpg-error -lxml2
cc -shared  .libs/php_xsl.o .libs/xsltprocessor.o  -lexslt -lxslt -lgcrypt -lgpg-error -lxml2  -Wl,-O1 -Wl,--hash-style=both -Wl,-soname -Wl,xsl.so -o .libs/xsl.so
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: cannot find -lgcrypt
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: cannot find -lgpg-error
collect2: error: ld returned 1 exit status
make: *** [Makefile:199: xsl.la] Error 1
Removing intermediate container 8f411d5958f0
The command '/bin/sh -c set -xe;         apk --update add --no-cache --virtual .php-ext-install-deps         $PHPIZE_DEPS         libxslt-dev         && docker-php-ext-install -j$(nproc)         xsl     && docker-php-source delete         && runDeps="$(         scanelf --needed --nobanner --format '%n#p' --recursive /usr/local             | tr ',' '\n'             | sort -u             | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }'     )"     && apk add --no-cache $runDeps         && apk del --no-network .php-ext-install-deps' returned a non-zero code: 2

Do you have any idea how to fix this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionUsability question, not directly related to an error with the image

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions