tds-fdw / tds_fdw

A PostgreSQL foreign data wrapper to connect to TDS databases (Sybase and Microsoft SQL Server)
Other
357 stars 99 forks source link

Error during installation "error: unknown argument: '-no-opaque-pointers'" #328

Open tomaszwozniak opened 1 year ago

tomaszwozniak commented 1 year ago

Issue report

Hi! Today I noticed it can't install fdw on docker postgres-alpine. That was working really well for few months. See more details below:

My dockerfile is:

FROM library/postgres:13.9-alpine3.17
RUN apk add --update freetds-dev && \
    apk add git gcc libc-dev make && \
    apk add postgresql-dev postgresql-contrib && \
    git clone https://github.com/tds-fdw/tds_fdw.git && \
    cd tds_fdw && \
    make USE_PGXS=1 && \
    make USE_PGXS=1 install && \
    apk del git gcc libc-dev make && \
    cd ..  && \
    rm -rf tds_fdw

Operating system

alpine3.17

Version of tds_fdw

Latest

Version of PostgreSQL

13.9

Logs

Cloning into 'tds_fdw'...
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -O2 -fPIC -I./include/ -fvisibility=hidden  -I. -I./ -I/usr/local/include/postgresql/server -I/usr/local/include/postgresql/internal  -D_GNU_SOURCE -I/usr/include/libxml2   -c -o src/tds_fdw.o src/tds_fdw.c
In file included from /usr/local/include/postgresql/server/postgres.h:47,
                 from src/tds_fdw.c:32:
src/tds_fdw.c: In function 'tdsGetRowCountShowPlanAll':
/usr/local/include/postgresql/server/utils/elog.h:125:12: warning: this statement may fall through [-Wimplicit-fallthrough=]
  125 |         do { \
      |            ^
/usr/local/include/postgresql/server/utils/elog.h:145:9: note: in expansion of macro 'ereport_domain'
  145 |         ereport_domain(elevel, TEXTDOMAIN, __VA_ARGS__)
      |         ^~~~~~~~~~~~~~
src/tds_fdw.c:808:41: note: in expansion of macro 'ereport'
  808 |                                         ereport(ERROR,
      |                                         ^~~~~~~
src/tds_fdw.c:813:33: note: here
  813 |                                 case FAIL:
      |                                 ^~~~
/usr/local/include/postgresql/server/utils/elog.h:125:12: warning: this statement may fall through [-Wimplicit-fallthrough=]
  125 |         do { \
      |            ^
/usr/local/include/postgresql/server/utils/elog.h:145:9: note: in expansion of macro 'ereport_domain'
  145 |         ereport_domain(elevel, TEXTDOMAIN, __VA_ARGS__)
      |         ^~~~~~~~~~~~~~
src/tds_fdw.c:814:41: note: in expansion of macro 'ereport'
  814 |                                         ereport(ERROR,
      |                                         ^~~~~~~
src/tds_fdw.c:819:33: note: here
  819 |                                 default:
      |                                 ^~~~~~~
src/tds_fdw.c: In function 'tdsGetRowCountExecute':
/usr/local/include/postgresql/server/utils/elog.h:125:12: warning: this statement may fall through [-Wimplicit-fallthrough=]
  125 |         do { \
      |            ^
/usr/local/include/postgresql/server/utils/elog.h:145:9: note: in expansion of macro 'ereport_domain'
  145 |         ereport_domain(elevel, TEXTDOMAIN, __VA_ARGS__)
      |         ^~~~~~~~~~~~~~
src/tds_fdw.c:973:41: note: in expansion of macro 'ereport'
  973 |                                         ereport(ERROR,
      |                                         ^~~~~~~
src/tds_fdw.c:978:33: note: here
  978 |                                 case FAIL:
      |                                 ^~~~
/usr/local/include/postgresql/server/utils/elog.h:125:12: warning: this statement may fall through [-Wimplicit-fallthrough=]
  125 |         do { \
      |            ^
/usr/local/include/postgresql/server/utils/elog.h:145:9: note: in expansion of macro 'ereport_domain'
  145 |         ereport_domain(elevel, TEXTDOMAIN, __VA_ARGS__)
      |         ^~~~~~~~~~~~~~
src/tds_fdw.c:979:41: note: in expansion of macro 'ereport'
  979 |                                         ereport(ERROR,
      |                                         ^~~~~~~
src/tds_fdw.c:984:33: note: here
  984 |                                 default:
      |                                 ^~~~~~~
src/tds_fdw.c: In function 'tdsConvertToCString':
src/tds_fdw.c:1167:28: warning: this statement may fall through [-Wimplicit-fallthrough=]
 1167 |                         if (erc == SUCCEED)
      |                            ^
src/tds_fdw.c:1178:17: note: here
 1178 |                 default:
      |                 ^~~~~~~
src/tds_fdw.c: In function 'tdsImportForeignSchema':
/usr/local/include/postgresql/server/utils/elog.h:125:12: warning: this statement may fall through [-Wimplicit-fallthrough=]
  125 |         do { \
      |            ^
/usr/local/include/postgresql/server/utils/elog.h:145:9: note: in expansion of macro 'ereport_domain'
  145 |         ereport_domain(elevel, TEXTDOMAIN, __VA_ARGS__)
      |         ^~~~~~~~~~~~~~
src/tds_fdw.c:3891:33: note: in expansion of macro 'ereport'
 3891 |                                 ereport(ERROR,
      |                                 ^~~~~~~
src/tds_fdw.c:3896:25: note: here
 3896 |                         case FAIL:
      |                         ^~~~
/usr/local/include/postgresql/server/utils/elog.h:125:12: warning: this statement may fall through [-Wimplicit-fallthrough=]
  125 |         do { \
      |            ^
/usr/local/include/postgresql/server/utils/elog.h:145:9: note: in expansion of macro 'ereport_domain'
  145 |         ereport_domain(elevel, TEXTDOMAIN, __VA_ARGS__)
      |         ^~~~~~~~~~~~~~
src/tds_fdw.c:3897:33: note: in expansion of macro 'ereport'
 3897 |                                 ereport(ERROR,
      |                                 ^~~~~~~
src/tds_fdw.c:3902:25: note: here
 3902 |                         default:
      |                         ^~~~~~~
src/tds_fdw.c: In function 'tdsImportSqlServerSchema':
/usr/local/include/postgresql/server/utils/elog.h:125:12: warning: this statement may fall through [-Wimplicit-fallthrough=]
  125 |         do { \
      |            ^
/usr/local/include/postgresql/server/utils/elog.h:145:9: note: in expansion of macro 'ereport_domain'
  145 |         ereport_domain(elevel, TEXTDOMAIN, __VA_ARGS__)
      |         ^~~~~~~~~~~~~~
src/tds_fdw.c:3334:41: note: in expansion of macro 'ereport'
 3334 |                                         ereport(ERROR,
      |                                         ^~~~~~~
src/tds_fdw.c:3339:33: note: here
 3339 |                                 case FAIL:
      |                                 ^~~~
/usr/local/include/postgresql/server/utils/elog.h:125:12: warning: this statement may fall through [-Wimplicit-fallthrough=]
  125 |         do { \
      |            ^
/usr/local/include/postgresql/server/utils/elog.h:145:9: note: in expansion of macro 'ereport_domain'
  145 |         ereport_domain(elevel, TEXTDOMAIN, __VA_ARGS__)
      |         ^~~~~~~~~~~~~~
src/tds_fdw.c:3340:41: note: in expansion of macro 'ereport'
 3340 |                                         ereport(ERROR,
      |                                         ^~~~~~~
src/tds_fdw.c:3345:33: note: here
 3345 |                                 default:
      |                                 ^~~~~~~
src/tds_fdw.c: In function 'tdsImportSybaseSchema':
/usr/local/include/postgresql/server/utils/elog.h:125:12: warning: this statement may fall through [-Wimplicit-fallthrough=]
  125 |         do { \
      |            ^
/usr/local/include/postgresql/server/utils/elog.h:145:9: note: in expansion of macro 'ereport_domain'
  145 |         ereport_domain(elevel, TEXTDOMAIN, __VA_ARGS__)
      |         ^~~~~~~~~~~~~~
src/tds_fdw.c:3714:41: note: in expansion of macro 'ereport'
 3714 |                                         ereport(ERROR,
      |                                         ^~~~~~~
src/tds_fdw.c:3719:33: note: here
 3719 |                                 case FAIL:
      |                                 ^~~~
/usr/local/include/postgresql/server/utils/elog.h:125:12: warning: this statement may fall through [-Wimplicit-fallthrough=]
  125 |         do { \
      |            ^
/usr/local/include/postgresql/server/utils/elog.h:145:9: note: in expansion of macro 'ereport_domain'
  145 |         ereport_domain(elevel, TEXTDOMAIN, __VA_ARGS__)
      |         ^~~~~~~~~~~~~~
src/tds_fdw.c:3720:41: note: in expansion of macro 'ereport'
 3720 |                                         ereport(ERROR,
      |                                         ^~~~~~~
src/tds_fdw.c:3725:33: note: here
 3725 |                                 default:
      |                                 ^~~~~~~
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -O2 -fPIC -I./include/ -fvisibility=hidden  -I. -I./ -I/usr/local/include/postgresql/server -I/usr/local/include/postgresql/internal  -D_GNU_SOURCE -I/usr/include/libxml2   -c -o src/options.o src/options.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -O2 -fPIC -I./include/ -fvisibility=hidden  -I. -I./ -I/usr/local/include/postgresql/server -I/usr/local/include/postgresql/internal  -D_GNU_SOURCE -I/usr/include/libxml2   -c -o src/deparse.o src/deparse.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -O2 -fPIC -shared -o tds_fdw.so src/tds_fdw.o src/options.o src/deparse.o -L/usr/local/lib   -L/usr/lib/llvm15/lib  -L/usr/local/lib -Wl,--as-needed  -lsybdb
cp sql/tds_fdw.sql sql/tds_fdw--2.0.3.sql
cp README.md README.tds_fdw.md
/usr/bin/clang -Wno-ignored-attributes -fno-strict-aliasing -fwrapv -Xclang -no-opaque-pointers -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -Wno-deprecated-non-prototype -O2  -I./include/ -fvisibility=hidden  -I. -I./ -I/usr/local/include/postgresql/server -I/usr/local/include/postgresql/internal  -D_GNU_SOURCE -I/usr/include/libxml2  -flto=thin -emit-llvm -c -o src/tds_fdw.bc src/tds_fdw.c
warning: unknown warning option '-Wno-deprecated-non-prototype'; did you mean '-Wno-deprecated-coroutine'? [-Wunknown-warning-option]
error: unknown argument: '-no-opaque-pointers'
make: *** [/usr/local/lib/postgresql/pgxs/src/makefiles/../../src/Makefile.global:1070: src/tds_fdw.bc] Error 1

Thanks in advance for looking into this. Tomasz

orx57 commented 1 year ago

Same issue here with FROM postgres:14.7-alpine3.17.

And still the same by fixing the dependencies version for postgresql14-dev and postgresql14-contrib (with clang14 and llvm14):

# [...]
apk --no-cache add postgresql14-dev postgresql14-contrib && \
# [...]
GeoffMontee commented 1 year ago

The fatal error appears to be that your clang compiler does not support the -no-opaque-pointers option:

error: unknown argument: '-no-opaque-pointers'
make: *** [/usr/local/lib/postgresql/pgxs/src/makefiles/../../src/Makefile.global:1070: src/tds_fdw.bc] Error 1

It looks like this option was added in Clang 15.0.0.

What version of Clang are you using?

This option is not used in the Makefile defined by tds_fdw, so it is probably coming from your PostgreSQL installation, your Clang installation, or your environment variables.