snowflakedb / pdo_snowflake

PHP PDO driver for snowflake

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PHP 8/8.1 support

daum opened this issue · comments

commented

Currently this only supports PHP 7.3 and 7.4, both which are out of active support. 7.3 only had security fixes until Dec 6, 2021, and 7.4 until Nov 28, 2022.

Is there a timeline for official support for PHP 8 and 8.1?

@sfc-gh-sbommakanty PHP 8.0 is supported already since 1.2.0. #262
I've pinged @sfc-gh-sleslie to update the document on October.
Please let me know if 8.1 is specifically needed as it's released just two weeks ago. Otherwise I think this issue can be closed after updating documentation.

@SimbaGithub Thank you for the 8.0 support. It would be great if we can have 8.1 support too. Errors on building for PHP 8.1 now:

Step 9/24 : RUN cd /tmp/ && git clone --depth 1 --branch v1.2.0 https://github.com/snowflakedb/pdo_snowflake.git     && cd pdo_snowflake     && export PHP_HOME=/usr     && ./scripts/build_pdo_snowflake.sh
 ---> Running in 9a6a4a36b29d
Cloning into 'pdo_snowflake'...
Note: switching to '354b3b23de006150699c73dff72731b1e8fad232'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

Updating files:  40% (1231/3076)
Updating files:  41% (1262/3076)
Updating files:  42% (1292/3076)
Updating files:  43% (1323/3076)
Updating files:  44% (1354/3076)
Updating files:  45% (1385/3076)
Updating files:  46% (1415/3076)
Updating files:  47% (1446/3076)
Updating files:  48% (1477/3076)
Updating files:  49% (1508/3076)
Updating files:  50% (1538/3076)
Updating files:  51% (1569/3076)
Updating files:  52% (1600/3076)
Updating files:  52% (1621/3076)
Updating files:  53% (1631/3076)
Updating files:  54% (1662/3076)
Updating files:  55% (1692/3076)
Updating files:  56% (1723/3076)
Updating files:  57% (1754/3076)
Updating files:  58% (1785/3076)
Updating files:  59% (1815/3076)
Updating files:  59% (1819/3076)
Updating files:  60% (1846/3076)
Updating files:  61% (1877/3076)
Updating files:  62% (1908/3076)
Updating files:  63% (1938/3076)
Updating files:  64% (1969/3076)
Updating files:  65% (2000/3076)
Updating files:  66% (2031/3076)
Updating files:  67% (2061/3076)
Updating files:  68% (2092/3076)
Updating files:  69% (2123/3076)
Updating files:  70% (2154/3076)
Updating files:  71% (2184/3076)
Updating files:  71% (2211/3076)
Updating files:  72% (2215/3076)
Updating files:  73% (2246/3076)
Updating files:  74% (2277/3076)
Updating files:  75% (2307/3076)
Updating files:  76% (2338/3076)
Updating files:  77% (2369/3076)
Updating files:  78% (2400/3076)
Updating files:  78% (2408/3076)
Updating files:  78% (2418/3076)
Updating files:  79% (2431/3076)
Updating files:  80% (2461/3076)
Updating files:  81% (2492/3076)
Updating files:  82% (2523/3076)
Updating files:  83% (2554/3076)
Updating files:  84% (2584/3076)
Updating files:  85% (2615/3076)
Updating files:  86% (2646/3076)
Updating files:  87% (2677/3076)
Updating files:  88% (2707/3076)
Updating files:  89% (2738/3076)
Updating files:  90% (2769/3076)
Updating files:  91% (2800/3076)
Updating files:  92% (2830/3076)
Updating files:  93% (2861/3076)
Updating files:  94% (2892/3076)
Updating files:  95% (2923/3076)
Updating files:  96% (2953/3076)
Updating files:  97% (2984/3076)
Updating files:  98% (3015/3076)
Updating files:  98% (3016/3076)
Updating files:  99% (3046/3076)
Updating files: 100% (3076/3076)
Updating files: 100% (3076/3076), done.
Options:
  target       = Release
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
Configuring for:
PHP Api Version:         20210902
Zend Module Api No:      20210902
Zend Extension Api No:   420210902
./configure --enable-pdo_snowflake
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/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-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for PHP prefix... /usr
checking for PHP includes... -I/usr/include/php/20210902 -I/usr/include/php/20210902/main -I/usr/include/php/20210902/TSRM -I/usr/include/php/20210902/Zend -I/usr/include/php/20210902/ext -I/usr/include/php/20210902/ext/date/lib
checking for PHP extension directory... /usr/lib/php/20210902
checking for PHP installed headers prefix... /usr/include/php/20210902
checking if debug is enabled... no
checking if zts is enabled... no
checking for gawk... no
checking for nawk... nawk
checking if nawk is broken... no
checking for Snowflake DB support for PDO... yes, shared
checking whether to include code coverage symbols... no
checking for libsnowflakeclient files in default path... found in libsnowflakeclient
checking how to print strings... printf
checking for a sed that does not truncate output... (cached) /usr/bin/sed
checking for fgrep... /usr/bin/grep -F
checking for ld used by cc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking for gawk... (cached) nawk
checking command to parse /usr/bin/nm -B output from cc object... failed
checking for sysroot... no
checking for a working dd... /usr/bin/dd
checking how to truncate binary pipes... /usr/bin/dd bs=4096 count=1
checking for mt... no
checking if : is a manifest tool... no
checking for ANSI C header files... no
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 for dlfcn.h... yes
checking for objdir... .libs
checking if cc supports -fno-rtti -fno-exceptions... no
checking for cc option to produce PIC... -fPIC -DPIC
checking if cc PIC flag -fPIC -DPIC works... yes
checking if cc static flag -static works... no
checking if cc supports -c -o file.o... yes
checking if cc supports -c -o file.o... (cached) yes
checking whether the cc linker (/usr/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
configure: patching config.h.in
configure: creating ./config.status
config.status: creating config.h
config.status: executing libtool commands
/bin/bash /tmp/pdo_snowflake/libtool --mode=compile cc -I. -I/tmp/pdo_snowflake -I/tmp/pdo_snowflake/include -I/tmp/pdo_snowflake/main -I/tmp/pdo_snowflake -I/usr/include/php/20210902 -I/usr/include/php/20210902/main -I/usr/include/php/20210902/TSRM -I/usr/include/php/20210902/Zend -I/usr/include/php/20210902/ext -I/usr/include/php/20210902/ext/date/lib -I/tmp/pdo_snowflake/libsnowflakeclient/include  -DHAVE_CONFIG_H  -std=c99 -Werror -g -O2   -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -c /tmp/pdo_snowflake/pdo_snowflake.c -o pdo_snowflake.lo  -MMD -MF pdo_snowflake.dep -MT pdo_snowflake.lo
libtool: compile:  cc -I. -I/tmp/pdo_snowflake -I/tmp/pdo_snowflake/include -I/tmp/pdo_snowflake/main -I/tmp/pdo_snowflake -I/usr/include/php/20210902 -I/usr/include/php/20210902/main -I/usr/include/php/20210902/TSRM -I/usr/include/php/20210902/Zend -I/usr/include/php/20210902/ext -I/usr/include/php/20210902/ext/date/lib -I/tmp/pdo_snowflake/libsnowflakeclient/include -DHAVE_CONFIG_H -std=c99 -Werror -g -O2 -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -c /tmp/pdo_snowflake/pdo_snowflake.c -MMD -MF pdo_snowflake.dep -MT pdo_snowflake.lo  -fPIC -DPIC -o .libs/pdo_snowflake.o
/bin/bash /tmp/pdo_snowflake/libtool --mode=compile cc -I. -I/tmp/pdo_snowflake -I/tmp/pdo_snowflake/include -I/tmp/pdo_snowflake/main -I/tmp/pdo_snowflake -I/usr/include/php/20210902 -I/usr/include/php/20210902/main -I/usr/include/php/20210902/TSRM -I/usr/include/php/20210902/Zend -I/usr/include/php/20210902/ext -I/usr/include/php/20210902/ext/date/lib -I/tmp/pdo_snowflake/libsnowflakeclient/include  -DHAVE_CONFIG_H  -std=c99 -Werror -g -O2   -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -c /tmp/pdo_snowflake/snowflake_driver.c -o snowflake_driver.lo  -MMD -MF snowflake_driver.dep -MT snowflake_driver.lo
libtool: compile:  cc -I. -I/tmp/pdo_snowflake -I/tmp/pdo_snowflake/include -I/tmp/pdo_snowflake/main -I/tmp/pdo_snowflake -I/usr/include/php/20210902 -I/usr/include/php/20210902/main -I/usr/include/php/20210902/TSRM -I/usr/include/php/20210902/Zend -I/usr/include/php/20210902/ext -I/usr/include/php/20210902/ext/date/lib -I/tmp/pdo_snowflake/libsnowflakeclient/include -DHAVE_CONFIG_H -std=c99 -Werror -g -O2 -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -c /tmp/pdo_snowflake/snowflake_driver.c -MMD -MF snowflake_driver.dep -MT snowflake_driver.lo  -fPIC -DPIC -o .libs/snowflake_driver.o
/tmp/pdo_snowflake/snowflake_driver.c:434:5: error: initialization of ‘void (*)(pdo_dbh_t *)’ {aka ‘void (*)(struct _pdo_dbh_t *)’} from incompatible pointer type ‘int (*)(pdo_dbh_t *)’ {aka ‘int (*)(struct _pdo_dbh_t *)’} [-Werror=incompatible-pointer-types]
  434 |     snowflake_handle_closer,
      |     ^~~~~~~~~~~~~~~~~~~~~~~
/tmp/pdo_snowflake/snowflake_driver.c:434:5: note: (near initialization for ‘snowflake_methods.closer’)
/tmp/pdo_snowflake/snowflake_driver.c:435:5: error: initialization of ‘_Bool (*)(pdo_dbh_t *, zend_string *, pdo_stmt_t *, zval *)’ {aka ‘_Bool (*)(struct _pdo_dbh_t *, struct _zend_string *, struct _pdo_stmt_t *, struct _zval_struct *)’} from incompatible pointer type ‘int (*)(pdo_dbh_t *, const char *, size_t,  pdo_stmt_t *, zval *)’ {aka ‘int (*)(struct _pdo_dbh_t *, const char *, long unsigned int,  struct _pdo_stmt_t *, struct _zval_struct *)’} [-Werror=incompatible-pointer-types]
  435 |     snowflake_handle_preparer,
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pdo_snowflake/snowflake_driver.c:435:5: note: (near initialization for ‘snowflake_methods.preparer’)
/tmp/pdo_snowflake/snowflake_driver.c:436:5: error: initialization of ‘zend_long (*)(pdo_dbh_t *, const zend_string *)’ {aka ‘long int (*)(struct _pdo_dbh_t *, const struct _zend_string *)’} from incompatible pointer type ‘zend_long (*)(pdo_dbh_t *, const char *, size_t)’ {aka ‘long int (*)(struct _pdo_dbh_t *, const char *, long unsigned int)’} [-Werror=incompatible-pointer-types]
  436 |     snowflake_handle_doer,
      |     ^~~~~~~~~~~~~~~~~~~~~
/tmp/pdo_snowflake/snowflake_driver.c:436:5: note: (near initialization for ‘snowflake_methods.doer’)
/tmp/pdo_snowflake/snowflake_driver.c:437:5: error: initialization of ‘zend_string * (*)(pdo_dbh_t *, const zend_string *, enum pdo_param_type)’ {aka ‘struct _zend_string * (*)(struct _pdo_dbh_t *, const struct _zend_string *, enum pdo_param_type)’} from incompatible pointer type ‘int (*)(pdo_dbh_t *, const char *, size_t,  char **, size_t *, enum pdo_param_type)’ {aka ‘int (*)(struct _pdo_dbh_t *, const char *, long unsigned int,  char **, long unsigned int *, enum pdo_param_type)’} [-Werror=incompatible-pointer-types]
  437 |     snowflake_handle_quoter,
      |     ^~~~~~~~~~~~~~~~~~~~~~~
/tmp/pdo_snowflake/snowflake_driver.c:437:5: note: (near initialization for ‘snowflake_methods.quoter’)
/tmp/pdo_snowflake/snowflake_driver.c:438:5: error: initialization of ‘_Bool (*)(pdo_dbh_t *)’ {aka ‘_Bool (*)(struct _pdo_dbh_t *)’} from incompatible pointer type ‘int (*)(pdo_dbh_t *)’ {aka ‘int (*)(struct _pdo_dbh_t *)’} [-Werror=incompatible-pointer-types]
  438 |     snowflake_handle_begin,
      |     ^~~~~~~~~~~~~~~~~~~~~~
/tmp/pdo_snowflake/snowflake_driver.c:438:5: note: (near initialization for ‘snowflake_methods.begin’)
/tmp/pdo_snowflake/snowflake_driver.c:439:5: error: initialization of ‘_Bool (*)(pdo_dbh_t *)’ {aka ‘_Bool (*)(struct _pdo_dbh_t *)’} from incompatible pointer type ‘int (*)(pdo_dbh_t *)’ {aka ‘int (*)(struct _pdo_dbh_t *)’} [-Werror=incompatible-pointer-types]
  439 |     snowflake_handle_commit,
      |     ^~~~~~~~~~~~~~~~~~~~~~~
/tmp/pdo_snowflake/snowflake_driver.c:439:5: note: (near initialization for ‘snowflake_methods.commit’)
/tmp/pdo_snowflake/snowflake_driver.c:440:5: error: initialization of ‘_Bool (*)(pdo_dbh_t *)’ {aka ‘_Bool (*)(struct _pdo_dbh_t *)’} from incompatible pointer type ‘int (*)(pdo_dbh_t *)’ {aka ‘int (*)(struct _pdo_dbh_t *)’} [-Werror=incompatible-pointer-types]
  440 |     snowflake_handle_rollback,
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pdo_snowflake/snowflake_driver.c:440:5: note: (near initialization for ‘snowflake_methods.rollback’)
/tmp/pdo_snowflake/snowflake_driver.c:441:5: error: initialization of ‘_Bool (*)(pdo_dbh_t *, zend_long,  zval *)’ {aka ‘_Bool (*)(struct _pdo_dbh_t *, long int,  struct _zval_struct *)’} from incompatible pointer type ‘int (*)(pdo_dbh_t *, zend_long,  zval *)’ {aka ‘int (*)(struct _pdo_dbh_t *, long int,  struct _zval_struct *)’} [-Werror=incompatible-pointer-types]
  441 |     pdo_snowflake_set_attribute,
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pdo_snowflake/snowflake_driver.c:441:5: note: (near initialization for ‘snowflake_methods.set_attribute’)
/tmp/pdo_snowflake/snowflake_driver.c:442:5: error: initialization of ‘zend_string * (*)(pdo_dbh_t *, const zend_string *)’ {aka ‘struct _zend_string * (*)(struct _pdo_dbh_t *, const struct _zend_string *)’} from incompatible pointer type ‘char * (*)(pdo_dbh_t *, const char *, size_t *)’ {aka ‘char * (*)(struct _pdo_dbh_t *, const char *, long unsigned int *)’} [-Werror=incompatible-pointer-types]
  442 |     pdo_snowflake_last_insert_id,
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pdo_snowflake/snowflake_driver.c:442:5: note: (near initialization for ‘snowflake_methods.last_id’)
/tmp/pdo_snowflake/snowflake_driver.c:443:5: error: initialization of ‘void (*)(pdo_dbh_t *, pdo_stmt_t *, zval *)’ {aka ‘void (*)(struct _pdo_dbh_t *, struct _pdo_stmt_t *, struct _zval_struct *)’} from incompatible pointer type ‘int (*)(pdo_dbh_t *, pdo_stmt_t *, zval *)’ {aka ‘int (*)(struct _pdo_dbh_t *, struct _pdo_stmt_t *, struct _zval_struct *)’} [-Werror=incompatible-pointer-types]
  443 |     pdo_snowflake_fetch_error_func,
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pdo_snowflake/snowflake_driver.c:443:5: note: (near initialization for ‘snowflake_methods.fetch_err’)
cc1: all warnings being treated as errors
make: *** [Makefile:204: snowflake_driver.lo] Error 1
The command '/bin/sh -c cd /tmp/ && git clone --depth 1 --branch v1.2.0 https://github.com/snowflakedb/pdo_snowflake.git     && cd pdo_snowflake     && export PHP_HOME=/usr     && ./scripts/build_pdo_snowflake.sh' returned a non-zero code: 2

Hi @popadko,
Seems there are interface changes in PHP8.1 that needs some code changes in the connector. I think it would take some time to support PHP 8.1.

@popadko - We will look into prioritizing support for PHP 8.1, but don't have a timeline yet on when it will be supported. Will close this issue as PHP 8 support already exists. cc @SimbaGithub

Thank you, @sfc-gh-sbommakanty and @SimbaGithub

Then I will create an issue for the php8.1 support.