Coder Social home page Coder Social logo

Comments (6)

NoiseByNorthwest avatar NoiseByNorthwest commented on August 20, 2024 2

@Neofox Although I cannot explain exactly why, the ld issue can be fixed by the removal of the configure flag --build=x86_64-linux-musl.
If you want a full explanation I recommend you ask this to the alpine / musl maintainers. (BTW The fact there is not an implementation for qsort_r yet in musl libc make me really sad.)

Here is a patched Dockerfile to handle this:

FROM php:7.0-fpm-alpine

RUN apk update \
    && apk add --no-cache zlib-dev pcre-dev

RUN apk --no-cache add ca-certificates \
    && wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://raw.githubusercontent.com/sgerrand/alpine-pkg-glibc/master/sgerrand.rsa.pub \
    && wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.23-r3/glibc-2.23-r3.apk \
    && apk add glibc-2.23-r3.apk

## Install spx extension

# git clone of the project
RUN apk add git
RUN mkdir -p /usr/src/php/ext \
    && cd /usr/src/php/ext \
    && git clone https://github.com/NoiseByNorthwest/php-spx.git spx \
    && cd spx/ \
    && git checkout compat-alpine_linux

COPY ./spx.ini /usr/local/etc/php/conf.d/

# run the classic extension installation (same one as indicated in the documentation)
RUN apk add --no-cache --virtual .phpize-deps-configure $PHPIZE_DEPS
RUN cd /usr/src/php/ext/spx && phpize && ./configure
RUN docker-php-ext-install spx

# For debugging
RUN php -i | grep -i spx
RUN SPX_ENABLED=1 SPX_BUILTINS=1 php -r 'echo "OK " . time();'

EXPOSE 9000

CMD ["php-fpm"]

As you can see I use the compat-alpine_linux branch. I will merge it once you confirm this resolves the issue.

from php-spx.

NoiseByNorthwest avatar NoiseByNorthwest commented on August 20, 2024

Hello,

Thanks for reporting this detailled issue. It sounds like a minor build failure, I will fix it in the evening !

from php-spx.

NoiseByNorthwest avatar NoiseByNorthwest commented on August 20, 2024

Your setup use a fairly recent version of gcc (5.3) as opposed to the one (4.8) I use & used by Travis CI.

The first error is just the use of stdout & stderr as identifier which appears to violate gnu99 rules (the default std switch used on gcc 5). Easy to fix.

But there is still another issue: qsort_r, which is used in src/spx_reporter_fp.c, is simply not available.
So I have to think on workaround, not so easy. I knew I will face compatibility issues by using it, but I m surprised to encounter a "no definition" on a GNU/Linux plateform.

It will be a matter of days.

from php-spx.

NoiseByNorthwest avatar NoiseByNorthwest commented on August 20, 2024

This is in fact musl libc which is used on this image, I will investigate.

68a55f228c48:/usr/src/php/ext/spx# /usr/lib/libc.so
musl libc (x86_64)
Version 1.1.14
Dynamic Program Loader
Usage: /usr/lib/libc.so [options] [--] pathname [args]

EDIT:

Once build, there is still an ld issue

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20151012/spx.so' - Error relocating /usr/local/lib/php/extensions/no-debug-non-zts-20151012/spx.so: __snprintf_chk: symbol not found in Unknown on line 0

I've find lot of similar issues with Alpine on google.

from php-spx.

Neofox avatar Neofox commented on August 20, 2024

looks alright for me, thanks for the insight and your time !

from php-spx.

NoiseByNorthwest avatar NoiseByNorthwest commented on August 20, 2024

Thanks for your feedback !

from php-spx.

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.