snowflakedb / pdo_snowflake

PHP PDO driver for snowflake
Apache License 2.0
63 stars 30 forks source link

Why is there no compiled pdo_snowflake.so available? #164

Closed tvpmb closed 6 years ago

tvpmb commented 6 years ago

The build process isn't simple to understand and lacks some context, why is there no pre-compiled version (like many other PHP extensions)?

sfc-gh-kwagner commented 6 years ago

We know that the build process is a bit complex and we're working to make the build process easier for people to use while also providing prebuilt libraries for Windows, Linux and OS X. Are you having trouble building pdo_snowflake.so?

tvpmb commented 6 years ago

Yeah - its just not clear what I need to do.... I ended up running build_pdo_snowflake.sh, but it failed, wouldn't it be easier to publish a "dist" folder to the repo that contains that file? I could be up and running in 2 minutes if I had that.

tvpmb commented 6 years ago

Here's the build log:

$ ./scripts/build_pdo_snowflake.sh Configuring for: PHP Api Version: 20131106 Zend Module Api No: 20131226 Zend Extension Api No: 220131226 ./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 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 whether cc understands -c and -o together... yes 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-apple-darwin16.7.0 checking host system type... x86_64-apple-darwin16.7.0 checking target system type... x86_64-apple-darwin16.7.0 checking for PHP prefix... /usr checking for PHP includes... -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib checking for PHP extension directory... /usr/lib/php/extensions/no-debug-non-zts-20131226 checking for PHP installed headers prefix... /usr/include/php checking if debug is enabled... no checking if zts is enabled... no checking for re2c... no configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers. checking for gawk... no checking for nawk... no checking for awk... awk checking if awk 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 for ld used by cc... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld checking if the linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) is GNU ld... no checking for /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/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... 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 dlfcn.h usability... yes checking dlfcn.h presence... yes checking for dlfcn.h... yes checking the maximum length of command line arguments... 196608 checking command to parse /usr/bin/nm -B output from cc object... failed checking for objdir... .libs checking for ar... ar checking for ranlib... ranlib checking for strip... strip checking for dsymutil... dsymutil checking for nmedit... nmedit checking for -single_module linker flag... ld: unknown option: --whole-archive clang: error: linker command failed with exit code 1 (use -v to see invocation) no checking for -exported_symbols_list linker flag... #line 6542 "configure"

include "confdefs.h"

int main() { ; return 0; } no checking if cc supports -fno-rtti -fno-exceptions... yes checking for cc option to produce PIC... -fno-common checking if cc PIC flag -fno-common works... yes checking if cc static flag -static works... no checking if cc supports -c -o file.o... yes checking whether the cc linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries... yes checking dynamic linker characteristics... darwin16.7.0 dyld 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: creating ./config.status config.status: creating config.h /bin/sh /Users/mbabineau/Documents/pdo_snowflake/libtool --mode=compile cc -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -I. -I/Users/mbabineau/Documents/pdo_snowflake -DPHP_ATOM_INC -I/Users/mbabineau/Documents/pdo_snowflake/include -I/Users/mbabineau/Documents/pdo_snowflake/main -I/Users/mbabineau/Documents/pdo_snowflake -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/Users/mbabineau/Documents/pdo_snowflake/libsnowflakeclient/include -DHAVE_CONFIG_H -std=c99 -Werror -g -O2 -c /Users/mbabineau/Documents/pdo_snowflake/pdo_snowflake.c -o pdo_snowflake.lo mkdir .libs cc -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -I. -I/Users/mbabineau/Documents/pdo_snowflake -DPHP_ATOM_INC -I/Users/mbabineau/Documents/pdo_snowflake/include -I/Users/mbabineau/Documents/pdo_snowflake/main -I/Users/mbabineau/Documents/pdo_snowflake -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/Users/mbabineau/Documents/pdo_snowflake/libsnowflakeclient/include -DHAVE_CONFIG_H -std=c99 -Werror -g -O2 -c /Users/mbabineau/Documents/pdo_snowflake/pdo_snowflake.c -fno-common -DPIC -o .libs/pdo_snowflake.o /Users/mbabineau/Documents/pdo_snowflake/pdo_snowflake.c:53:20: error: implicit declaration of function 'PDO_SNOWFLAKE_G' is invalid in C99 [-Werror,-Wimplicit-function-declaration] char cacert = PDO_SNOWFLAKE_G(cacert); ^ /Users/mbabineau/Documents/pdo_snowflake/pdo_snowflake.c:53:11: error: incompatible integer to pointer conversion initializing 'char ' with an expression of type 'int' [-Werror,-Wint-conversion] char cacert = PDO_SNOWFLAKE_G(cacert); ^ ~~~~~~~ /Users/mbabineau/Documents/pdo_snowflake/pdo_snowflake.c:54:11: error: incompatible integer to pointer conversion initializing 'char ' with an expression of type 'int' [-Werror,-Wint-conversion] char logdir = PDO_SNOWFLAKE_G(logdir); ^ ~~~~~~~ /Users/mbabineau/Documents/pdo_snowflake/pdo_snowflake.c:55:11: error: incompatible integer to pointer conversion initializing 'char ' with an expression of type 'int' [-Werror,-Wint-conversion] char loglevel = PDO_SNOWFLAKE_G(loglevel); ^ ~~~~~ /Users/mbabineau/Documents/pdo_snowflake/pdo_snowflake.c:56:11: error: incompatible integer to pointer conversion initializing 'char ' with an expression of type 'int' [-Werror,-Wint-conversion] char* debug = PDO_SNOWFLAKE_G(debug); ^ ~~~~~~ 5 errors generated. make: *** [pdo_snowflake.lo] Error 1 14:45:24 Wed Nov 14: ~/Documents/pdo_snowflake

sfc-gh-kwagner commented 6 years ago

Ah I see you're building it on OS X and PHP 5.X (I'm guessing the PHP version based on the PHP API version). Right now it is only available for Linux and only for PHP 7.X. We are working on getting OS X and Windows builds working and then the current plan is to have a dist folder for the repo with prebuilt libraries for each platform/supported PHP version.

We don't have any plans of supporting PHP 5.X since the PDO interface between PHP 5.X and 7.X is quite different.

tvpmb commented 6 years ago

Ok - I think I realized this as well, trying on an Ubuntu machine now.

sfc-gh-kwagner commented 6 years ago

Let me know how building on Ubuntu works out. I'll keep this ticket open and comment here when OS X support is ready and I have a prebuilt library for you to use.