snowflakedb / pdo_snowflake

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

SNOW-919763: Unable to build the driver for v1.2.7 on linux, unused-functions #339

Closed vaikas closed 6 months ago

vaikas commented 12 months ago

I'm trying to build the driver of the latest release (v1.2.7) from this commit: https://github.com/snowflakedb/pdo_snowflake/commit/b68db720b2babdcc4ef8923ee2f35293296e0ced

But it's failing like this:

⚠️  aarch64   | /home/build/snowflake_driver.c: In function 'pdo_snowflake_get_attribute':
⚠️  aarch64   | /home/build/snowflake_driver.c:397:30: error: unused variable 'H' [-Werror=unused-variable]
⚠️  aarch64   |   397 |     pdo_snowflake_db_handle *H = (pdo_snowflake_db_handle *) dbh->driver_data;
⚠️  aarch64   |       |                              ^
⚠️  aarch64   | /home/build/snowflake_driver.c: In function 'pdo_snowflake_handle_factory':
⚠️  aarch64   | /home/build/snowflake_driver.c:539:15: error: unused variable 'int_attr_value' [-Werror=unused-variable]
⚠️  aarch64   |   539 |         int64 int_attr_value = 0;
⚠️  aarch64   |       |               ^~~~~~~~~~~~~~
⚠️  aarch64   | /home/build/snowflake_driver.c: At top level:
⚠️  aarch64   | /home/build/snowflake_driver.c:299:12: error: 'snowflake_handle_quoter' defined but not used [-Werror=unused-function]
⚠️  aarch64   |   299 | static int snowflake_handle_quoter(pdo_dbh_t *dbh, const char *unquoted,
⚠️  aarch64   |       |            ^~~~~~~~~~~~~~~~~~~~~~~
⚠️  aarch64   | /home/build/snowflake_driver.c:275:14: error: 'pdo_snowflake_last_insert_id' defined but not used [-Werror=unused-function]
⚠️  aarch64   |   275 | static char *pdo_snowflake_last_insert_id(pdo_dbh_t *dbh, const char *name,
⚠️  aarch64   |       |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
⚠️  aarch64   | cc1: all warnings being treated as errors
⚠️  aarch64   | make: *** [Makefile:211: snowflake_driver.lo] Error 1

I can work around by modifying the CFLAGS to have -Wno-unused-function

But then I run into #338 but at least things compile :)

Guess maybe newer version of compiler? Just a heads up.

Please answer these questions before submitting your issue. In order to accurately debug the issue this information is required. Thanks!

  1. What version of PDO/PHP driver are you using? N/A: Just trying to build

  2. What operating system and processor architecture are you using? Linux docker container on mac m2.

  3. What version of C/C++ compiler are you using? 13.2

  4. What did you do? Followed the instructions here: https://github.com/snowflakedb/pdo_snowflake#building-the-driver-on-linux-and-macos

  5. What did you expect to see?

Build to succeed

sfc-gh-dszmolka commented 6 months ago

marking this as a duplicate for https://github.com/snowflakedb/pdo_snowflake/issues/351 as ARM is not supported yet