swoole / phpy

Connecting the Python and PHP ecosystems together
Apache License 2.0
543 stars 44 forks source link

Build broken with python 3.6 #63

Closed remicollet closed 3 months ago

remicollet commented 3 months ago

Python 3.6 is the default version in RHEL-8 (and clones)

libtool: compile:  g++ -I. -I/builddir/build/BUILD/php83-php-pecl-phpy-1.0.6/phpy-1.0.6 -I/builddir/build/BUILD/php83-php-pecl-phpy-1.0.6/NTS/include -I/builddir/build/BUILD/php83-php-pecl-phpy-1.0.6/NTS/main -I/builddir/build/BUILD/php83-php-pecl-phpy-1.0.6/phpy-1.0.6 -I/opt/remi/php83/root/usr/include/php -I/opt/remi/php83/root/usr/include/php/main -I/opt/remi/php83/root/usr/include/php/TSRM -I/opt/remi/php83/root/usr/include/php/Zend -I/opt/remi/php83/root/usr/include/php/ext -I/opt/remi/php83/root/usr/include/php/ext/date/lib -I/usr/include/python3.6m -I/usr/include/python3.6m -I/builddir/build/BUILD/php83-php-pecl-phpy-1.0.6/phpy-1.0.6/include -DHAVE_CONFIG_H -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -Wall -Wno-unused-function -Wno-deprecated -Wno-deprecated-declarations -z now -std=c++14 -DZEND_COMPILE_DL_EXT=1 -c /builddir/build/BUILD/php83-php-pecl-phpy-1.0.6/phpy-1.0.6/src/python/resource.cc -MMD -MF src/python/resource.dep -MT src/python/resource.lo  -fPIC -DPIC -o src/python/.libs/resource.o
libtool: compile:  g++ -I. -I/builddir/build/BUILD/php83-php-pecl-phpy-1.0.6/phpy-1.0.6 -I/builddir/build/BUILD/php83-php-pecl-phpy-1.0.6/NTS/include -I/builddir/build/BUILD/php83-php-pecl-phpy-1.0.6/NTS/main -I/builddir/build/BUILD/php83-php-pecl-phpy-1.0.6/phpy-1.0.6 -I/opt/remi/php83/root/usr/include/php -I/opt/remi/php83/root/usr/include/php/main -I/opt/remi/php83/root/usr/include/php/TSRM -I/opt/remi/php83/root/usr/include/php/Zend -I/opt/remi/php83/root/usr/include/php/ext -I/opt/remi/php83/root/usr/include/php/ext/date/lib -I/usr/include/python3.6m -I/usr/include/python3.6m -I/builddir/build/BUILD/php83-php-pecl-phpy-1.0.6/phpy-1.0.6/include -DHAVE_CONFIG_H -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -Wall -Wno-unused-function -Wno-deprecated -Wno-deprecated-declarations -z now -std=c++14 -DZEND_COMPILE_DL_EXT=1 -c /builddir/build/BUILD/php83-php-pecl-phpy-1.0.6/phpy-1.0.6/src/python/string.cc -MMD -MF src/python/string.dep -MT src/python/string.lo  -fPIC -DPIC -o src/python/.libs/string.o
/bin/sh /builddir/build/BUILD/php83-php-pecl-phpy-1.0.6/NTS/libtool --tag=CXX --mode=link g++ -shared -I/builddir/build/BUILD/php83-php-pecl-phpy-1.0.6/NTS/include -I/builddir/build/BUILD/php83-php-pecl-phpy-1.0.6/NTS/main -I/builddir/build/BUILD/php83-php-pecl-phpy-1.0.6/phpy-1.0.6 -I/opt/remi/php83/root/usr/include/php -I/opt/remi/php83/root/usr/include/php/main -I/opt/remi/php83/root/usr/include/php/TSRM -I/opt/remi/php83/root/usr/include/php/Zend -I/opt/remi/php83/root/usr/include/php/ext -I/opt/remi/php83/root/usr/include/php/ext/date/lib -I/usr/include/python3.6m -I/usr/include/python3.6m -I/builddir/build/BUILD/php83-php-pecl-phpy-1.0.6/phpy-1.0.6/include  -DHAVE_CONFIG_H  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE  -Wl,-z,relro -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld Usage: /usr/libexec/platform-python3.6m-x86_64-config --prefix|--exec-prefix|--includes|--libs|--cflags|--ldflags|--extension-suffix|--help|--abiflags|--configdir  -o phpy.la -export-dynamic -avoid-version -prefer-pic -module -rpath /builddir/build/BUILD/php83-php-pecl-phpy-1.0.6/NTS/modules  phpy.lo src/bridge/core.lo src/php/core.lo src/php/dict.lo src/php/error.lo src/php/fn.lo src/php/iter.lo src/php/list.lo src/php/module.lo src/php/object.lo src/php/sequence.lo src/php/set.lo src/php/str.lo src/php/tuple.lo src/php/type.lo src/python/array.lo src/python/callable.lo src/python/class.lo src/python/module.lo src/python/object.lo src/python/reference.lo src/python/resource.lo src/python/string.lo 
/bin/sh: --exec-prefix: command not found
/bin/sh: --includes: command not found
/bin/sh: --libs: command not found
/bin/sh: --cflags: command not found
/bin/sh: --ldflags: command not found
/bin/sh: --extension-suffix: command not found
/bin/sh: --help: command not found
/bin/sh: --abiflags: command not found
/bin/sh: --configdir: command not found
make: *** [Makefile:281: phpy.la] Error 127

No issue with 3.9 in RHEL-9 or higher version in Fedora

remicollet commented 3 months ago

Removing "--embed" fix the build

matyhtf commented 3 months ago

The current minimum python version requirement is 3.8. The version 3.6 is not yet supported. I will see if it can be supported later.

remicollet commented 3 months ago

The current minimum python version requirement is 3.8.

Please add a check for this in config.m4 ;)

BTW, why not using (instead of complex way using python3-config)

  if test "$PHP_PYTHON_VERSION" = "no"; then
    PKG_CHECK_MODULES([PYTHON], [python3-embed >= 3.8])
  else
    PKG_CHECK_MODULES([PYTHON], [python-${PHP_PYTHON_VERSION}-embed >= 3.8])
  fi
  PHP_EVAL_LIBLINE($PYTHON_LIBS, PHPY_SHARED_LIBADD)
  PHP_EVAL_INCLINE($PYTHON_CFLAGS)

PKG_CHECK_MODULES being the preffered way since 7.4

remicollet commented 3 months ago

FYI, this extension was added in my RPMS repository among others https://blog.remirepo.net/pages/PECL-extensions-RPM-status https://x.com/RemiRepository/status/1825833901547291012

Nothing for EL-8, I will wait for 3.6 support or think about using python 3.12 also available

remicollet commented 3 months ago

PKG_CHECK_MODULES being the preffered way since 7.4

See #65

matyhtf commented 3 months ago

https://github.com/swoole/phpy/commit/59c2cb07b6a1214209ad8e8ae87a15cc3d807718

Fixed.