EnterpriseDB / mongo_fdw

PostgreSQL foreign data wrapper for MongoDB
GNU Lesser General Public License v3.0
330 stars 70 forks source link

Provide a script to make it easier for users to install #157

Closed cobolbaby closed 2 years ago

cobolbaby commented 2 years ago

When trying to install the mongo_fdw extension in the container, there will always be some problems. Can you clarify the installation operation a little more, or provide a script to make it easier for users to install?

The operation process is as follows.

docker run --rm -ti --name pgtest --user root postgres:12.10 bash
root@170f137d551a:/# apt-get update -y  && apt-get install -y wget postgresql-server-dev-12 make gcc cmake 
root@170f137d551a:/# ...
root@170f137d551a:/# curl -sSL -o /tmp/mongo_fdw-5.3.0.tar.gz https://github.com/EnterpriseDB/mongo_fdw/archive/refs/tags/REL-5_3_0.tar.gz
root@170f137d551a:/# tar -xzf /tmp/mongo_fdw-5.3.0.tar.gz -C /tmp/ 
root@170f137d551a:/# cd /tmp/mongo_fdw-REL-5_3_0
root@170f137d551a:/tmp/mongo_fdw-REL-5_3_0# ./autogen.sh --with-master
root@170f137d551a:/tmp/mongo_fdw-REL-5_3_0# ...
root@170f137d551a:/tmp/mongo_fdw-REL-5_3_0# make USE_PGXS=1 && make USE_PGXS=1 install
make: pkg-config: No such file or directory
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fno-omit-frame-pointer -fPIC --std=c99  -Ijson-c -DMETA_DRIVER -I. -I./ -I/usr/include/postgresql/12/server -I/usr/include/postgresql/internal  -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2   -c -o connection.o connection.c
In file included from mongo_wrapper.h:18,
                 from connection.c:21:
mongo_fdw.h:22:10: fatal error: mongoc.h: No such file or directory
   22 | #include "mongoc.h"
      |          ^~~~~~~~~~
compilation terminated.
make: *** [<builtin>: connection.o] Error 1
root@170f137d551a:/tmp/mongo_fdw-REL-5_3_0# 
root@170f137d551a:/tmp/mongo_fdw-REL-5_3_0# apt-get install -y pkg-config
root@170f137d551a:/tmp/mongo_fdw-REL-5_3_0# export YOUR_MONGO_FDW_SOURCE_DIR=/tmp/mongo_fdw-REL-5_3_0
root@170f137d551a:/tmp/mongo_fdw-REL-5_3_0# export PKG_CONFIG_PATH=$YOUR_MONGO_FDW_SOURCE_DIR/mongo-c-driver/src/libmongoc/src:$YOUR_MONGO_FDW_SOURCE_DIR/mongo-c-driver/src/libbson/src
root@170f137d551a:/tmp/mongo_fdw-REL-5_3_0# 
root@170f137d551a:/tmp/mongo_fdw-REL-5_3_0# make USE_PGXS=1 && make USE_PGXS=1 install
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fno-omit-frame-pointer -fPIC --std=c99 -I/include/libmongoc-1.0 -I/include/libbson-1.0 -Ijson-c -DMETA_DRIVER -I. -I./ -I/usr/include/postgresql/12/server -I/usr/include/postgresql/internal  -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2   -c -o connection.o connection.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fno-omit-frame-pointer -fPIC --std=c99 -I/include/libmongoc-1.0 -I/include/libbson-1.0 -Ijson-c -DMETA_DRIVER -I. -I./ -I/usr/include/postgresql/12/server -I/usr/include/postgresql/internal  -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2   -c -o option.o option.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fno-omit-frame-pointer -fPIC --std=c99 -I/include/libmongoc-1.0 -I/include/libbson-1.0 -Ijson-c -DMETA_DRIVER -I. -I./ -I/usr/include/postgresql/12/server -I/usr/include/postgresql/internal  -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2   -c -o mongo_wrapper_meta.o mongo_wrapper_meta.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fno-omit-frame-pointer -fPIC --std=c99 -I/include/libmongoc-1.0 -I/include/libbson-1.0 -Ijson-c -DMETA_DRIVER -I. -I./ -I/usr/include/postgresql/12/server -I/usr/include/postgresql/internal  -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2   -c -o mongo_fdw.o mongo_fdw.c
mongo_fdw.c: In function ‘MongoGetForeignPlan’:
mongo_fdw.c:725:44: warning: ‘jqinfo’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  725 |   fdw_private = lappend(fdw_private, jqinfo->colNumList);
      |                                      ~~~~~~^~~~~~~~~~~~
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fno-omit-frame-pointer -fPIC --std=c99 -I/include/libmongoc-1.0 -I/include/libbson-1.0 -Ijson-c -DMETA_DRIVER -I. -I./ -I/usr/include/postgresql/12/server -I/usr/include/postgresql/internal  -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2   -c -o mongo_query.o mongo_query.c
mongo_query.c: In function ‘QueryDocument’:
mongo_query.c:235:9: warning: variable ‘natts’ set but not used [-Wunused-but-set-variable]
  235 |   int   natts;
      |         ^~~~~
mongo_query.c:398:4: warning: ‘columnName’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  398 |    BsonAppendStartObject(filter, columnName, &childDocument);
      |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mongo_query.c:339:5: warning: ‘columnName’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  339 |     AppendConstantValue(filter, columnName, constant);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mongo_query.c:520:6: warning: ‘jointype’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  520 |   if (jointype == JOIN_INNER)
      |      ^
mongo_query.c:384:39: warning: ‘columnInfoHash’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  384 |     columnInfo = (ColInfoHashEntry *) hash_search(columnInfoHash,
      |                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~
  385 |                  (void *) &key,
      |                  ~~~~~~~~~~~~~~        
  386 |                  HASH_FIND,
      |                  ~~~~~~~~~~            
  387 |                  &found);
      |                  ~~~~~~~               
mongo_query.c:532:25: warning: ‘outer_relname’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  532 |   fmstate->outerRelName = outer_relname;
      |   ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
mongo_query.c:454:3: warning: ‘inner_relname’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  454 |   BsonAppendUTF8(&lookup, "from", inner_relname);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/postgresql/12/server/access/tupdesc.h:19,
                 from /usr/include/postgresql/12/server/utils/relcache.h:17,
                 from /usr/include/postgresql/12/server/access/genam.h:21,
                 from /usr/include/postgresql/12/server/access/amapi.h:15,
                 from /usr/include/postgresql/12/server/access/reloptions.h:22,
                 from mongo_fdw.h:26,
                 from mongo_wrapper.h:18,
                 from mongo_query.c:16:
/usr/include/postgresql/12/server/nodes/pg_list.h:79:21: warning: ‘joinclauses’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   79 |  return l ? l->head : NULL;
      |                     ^
mongo_query.c:219:11: note: ‘joinclauses’ was declared here
  219 |  List    *joinclauses;
      |           ^~~~~~~~~~~
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fno-omit-frame-pointer -fPIC --std=c99 -I/include/libmongoc-1.0 -I/include/libbson-1.0 -Ijson-c -DMETA_DRIVER -I. -I./ -I/usr/include/postgresql/12/server -I/usr/include/postgresql/internal  -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2   -c -o deparse.o deparse.c
deparse.c: In function ‘mongo_check_qual’:
deparse.c:214:5: warning: ‘tabname’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  214 |  if (tabname == NULL)
      |     ^
deparse.c:161:11: note: ‘tabname’ was declared here
  161 |  char    *tabname;
      |           ^~~~~~~
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fno-omit-frame-pointer -fPIC --std=c99 -I/include/libmongoc-1.0 -I/include/libbson-1.0 -Ijson-c -DMETA_DRIVER -I. -I./ -I/usr/include/postgresql/12/server -I/usr/include/postgresql/internal  -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2   -c -o json-c/json_util.o json-c/json_util.c
json-c/json_util.c:71:6: warning: no previous prototype for ‘_json_c_set_last_err’ [-Wmissing-prototypes]
   71 | void _json_c_set_last_err(const char *err_fmt, ...)
      |      ^~~~~~~~~~~~~~~~~~~~
json-c/json_util.c: In function ‘_json_c_set_last_err’:
json-c/json_util.c:76:2: warning: function ‘_json_c_set_last_err’ might be a candidate for ‘gnu_printf’ format attribute [-Wsuggest-attribute=format]
   76 |  (void)vsnprintf(_last_err, sizeof(_last_err), err_fmt, ap);
      |  ^
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fno-omit-frame-pointer -fPIC --std=c99 -I/include/libmongoc-1.0 -I/include/libbson-1.0 -Ijson-c -DMETA_DRIVER -I. -I./ -I/usr/include/postgresql/12/server -I/usr/include/postgresql/internal  -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2   -c -o json-c/json_object.o json-c/json_object.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fno-omit-frame-pointer -fPIC --std=c99 -I/include/libmongoc-1.0 -I/include/libbson-1.0 -Ijson-c -DMETA_DRIVER -I. -I./ -I/usr/include/postgresql/12/server -I/usr/include/postgresql/internal  -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2   -c -o json-c/json_tokener.o json-c/json_tokener.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fno-omit-frame-pointer -fPIC --std=c99 -I/include/libmongoc-1.0 -I/include/libbson-1.0 -Ijson-c -DMETA_DRIVER -I. -I./ -I/usr/include/postgresql/12/server -I/usr/include/postgresql/internal  -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2   -c -o json-c/json_object_iterator.o json-c/json_object_iterator.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fno-omit-frame-pointer -fPIC --std=c99 -I/include/libmongoc-1.0 -I/include/libbson-1.0 -Ijson-c -DMETA_DRIVER -I. -I./ -I/usr/include/postgresql/12/server -I/usr/include/postgresql/internal  -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2   -c -o json-c/printbuf.o json-c/printbuf.c
json-c/printbuf.c: In function ‘sprintbuf’:
json-c/printbuf.c:139:2: warning: function ‘sprintbuf’ might be a candidate for ‘gnu_printf’ format attribute [-Wsuggest-attribute=format]
  139 |  size = vsnprintf(buf, 128, msg, ap);
      |  ^~~~
json-c/printbuf.c:149:3: warning: function ‘sprintbuf’ might be a candidate for ‘gnu_printf’ format attribute [-Wsuggest-attribute=format]
  149 |   if ((size = vasprintf(&t, msg, ap)) < 0)
      |   ^~
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fno-omit-frame-pointer -fPIC --std=c99 -I/include/libmongoc-1.0 -I/include/libbson-1.0 -Ijson-c -DMETA_DRIVER -I. -I./ -I/usr/include/postgresql/12/server -I/usr/include/postgresql/internal  -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2   -c -o json-c/linkhash.o json-c/linkhash.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fno-omit-frame-pointer -fPIC --std=c99 -I/include/libmongoc-1.0 -I/include/libbson-1.0 -Ijson-c -DMETA_DRIVER -I. -I./ -I/usr/include/postgresql/12/server -I/usr/include/postgresql/internal  -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2   -c -o json-c/arraylist.o json-c/arraylist.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fno-omit-frame-pointer -fPIC --std=c99 -I/include/libmongoc-1.0 -I/include/libbson-1.0 -Ijson-c -DMETA_DRIVER -I. -I./ -I/usr/include/postgresql/12/server -I/usr/include/postgresql/internal  -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2   -c -o json-c/random_seed.o json-c/random_seed.c
json-c/random_seed.c: In function ‘get_dev_random_seed’:
json-c/random_seed.c:190:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
  190 |  int fd = open(dev_random_file, O_RDONLY);
      |  ^~~
json-c/random_seed.c:197:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
  197 |  int r;
      |  ^~~
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fno-omit-frame-pointer -fPIC --std=c99 -I/include/libmongoc-1.0 -I/include/libbson-1.0 -Ijson-c -DMETA_DRIVER -I. -I./ -I/usr/include/postgresql/12/server -I/usr/include/postgresql/internal  -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2   -c -o json-c/debug.o json-c/debug.c
json-c/debug.c: In function ‘mc_debug’:
json-c/debug.c:59:4: warning: function ‘mc_debug’ might be a candidate for ‘gnu_printf’ format attribute [-Wsuggest-attribute=format]
   59 |    vsyslog(LOG_DEBUG, msg, ap);
      |    ^~~~~~~
json-c/debug.c:63:4: warning: function ‘mc_debug’ might be a candidate for ‘gnu_printf’ format attribute [-Wsuggest-attribute=format]
   63 |    vprintf(msg, ap);
      |    ^~~~~~~
json-c/debug.c: In function ‘mc_error’:
json-c/debug.c:75:3: warning: function ‘mc_error’ might be a candidate for ‘gnu_printf’ format attribute [-Wsuggest-attribute=format]
   75 |   vsyslog(LOG_ERR, msg, ap);
      |   ^~~~~~~
json-c/debug.c:79:3: warning: function ‘mc_error’ might be a candidate for ‘gnu_printf’ format attribute [-Wsuggest-attribute=format]
   79 |   vfprintf(stderr, msg, ap);
      |   ^~~~~~~~
json-c/debug.c: In function ‘mc_info’:
json-c/debug.c:90:3: warning: function ‘mc_info’ might be a candidate for ‘gnu_printf’ format attribute [-Wsuggest-attribute=format]
   90 |   vsyslog(LOG_INFO, msg, ap);
      |   ^~~~~~~
json-c/debug.c:94:3: warning: function ‘mc_info’ might be a candidate for ‘gnu_printf’ format attribute [-Wsuggest-attribute=format]
   94 |   vfprintf(stderr, msg, ap);
      |   ^~~~~~~~
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fno-omit-frame-pointer -fPIC --std=c99 -I/include/libmongoc-1.0 -I/include/libbson-1.0 -Ijson-c -DMETA_DRIVER -I. -I./ -I/usr/include/postgresql/12/server -I/usr/include/postgresql/internal  -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2   -c -o json-c/strerror_override.o json-c/strerror_override.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fno-omit-frame-pointer -fPIC -shared -o mongo_fdw.so connection.o option.o mongo_wrapper_meta.o mongo_fdw.o mongo_query.o deparse.o json-c/json_util.o json-c/json_object.o json-c/json_tokener.o json-c/json_object_iterator.o json-c/printbuf.o json-c/linkhash.o json-c/arraylist.o json-c/random_seed.o json-c/debug.o json-c/strerror_override.o -L/usr/lib/x86_64-linux-gnu  -Wl,-z,relro -Wl,-z,now -L/usr/lib/llvm-11/lib  -Wl,--as-needed  -lmongoc-1.0 -lbson-1.0 
/usr/bin/clang-11 -Wno-ignored-attributes -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -O2  --std=c99 -I/include/libmongoc-1.0 -I/include/libbson-1.0 -Ijson-c -DMETA_DRIVER -I. -I./ -I/usr/include/postgresql/12/server -I/usr/include/postgresql/internal  -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2  -flto=thin -emit-llvm -c -o connection.bc connection.c
/usr/bin/clang-11 -Wno-ignored-attributes -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -O2  --std=c99 -I/include/libmongoc-1.0 -I/include/libbson-1.0 -Ijson-c -DMETA_DRIVER -I. -I./ -I/usr/include/postgresql/12/server -I/usr/include/postgresql/internal  -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2  -flto=thin -emit-llvm -c -o option.bc option.c
/usr/bin/clang-11 -Wno-ignored-attributes -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -O2  --std=c99 -I/include/libmongoc-1.0 -I/include/libbson-1.0 -Ijson-c -DMETA_DRIVER -I. -I./ -I/usr/include/postgresql/12/server -I/usr/include/postgresql/internal  -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2  -flto=thin -emit-llvm -c -o mongo_wrapper_meta.bc mongo_wrapper_meta.c
mongo_wrapper_meta.c:228:34: warning: implicit conversion from enumeration type 'mongoc_delete_flags_t' to different enumeration type 'mongoc_remove_flags_t' [-Wenum-conversion]
        r = mongoc_collection_remove(c, MONGOC_DELETE_SINGLE_REMOVE, b, NULL,
            ~~~~~~~~~~~~~~~~~~~~~~~~    ^~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
/usr/bin/clang-11 -Wno-ignored-attributes -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -O2  --std=c99 -I/include/libmongoc-1.0 -I/include/libbson-1.0 -Ijson-c -DMETA_DRIVER -I. -I./ -I/usr/include/postgresql/12/server -I/usr/include/postgresql/internal  -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2  -flto=thin -emit-llvm -c -o mongo_fdw.bc mongo_fdw.c
/usr/bin/clang-11 -Wno-ignored-attributes -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -O2  --std=c99 -I/include/libmongoc-1.0 -I/include/libbson-1.0 -Ijson-c -DMETA_DRIVER -I. -I./ -I/usr/include/postgresql/12/server -I/usr/include/postgresql/internal  -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2  -flto=thin -emit-llvm -c -o mongo_query.bc mongo_query.c
/usr/bin/clang-11 -Wno-ignored-attributes -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -O2  --std=c99 -I/include/libmongoc-1.0 -I/include/libbson-1.0 -Ijson-c -DMETA_DRIVER -I. -I./ -I/usr/include/postgresql/12/server -I/usr/include/postgresql/internal  -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2  -flto=thin -emit-llvm -c -o deparse.bc deparse.c
/usr/bin/clang-11 -Wno-ignored-attributes -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -O2  --std=c99 -I/include/libmongoc-1.0 -I/include/libbson-1.0 -Ijson-c -DMETA_DRIVER -I. -I./ -I/usr/include/postgresql/12/server -I/usr/include/postgresql/internal  -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2  -flto=thin -emit-llvm -c -o json-c/json_util.bc json-c/json_util.c
/usr/bin/clang-11 -Wno-ignored-attributes -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -O2  --std=c99 -I/include/libmongoc-1.0 -I/include/libbson-1.0 -Ijson-c -DMETA_DRIVER -I. -I./ -I/usr/include/postgresql/12/server -I/usr/include/postgresql/internal  -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2  -flto=thin -emit-llvm -c -o json-c/json_object.bc json-c/json_object.c
/usr/bin/clang-11 -Wno-ignored-attributes -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -O2  --std=c99 -I/include/libmongoc-1.0 -I/include/libbson-1.0 -Ijson-c -DMETA_DRIVER -I. -I./ -I/usr/include/postgresql/12/server -I/usr/include/postgresql/internal  -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2  -flto=thin -emit-llvm -c -o json-c/json_tokener.bc json-c/json_tokener.c
/usr/bin/clang-11 -Wno-ignored-attributes -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -O2  --std=c99 -I/include/libmongoc-1.0 -I/include/libbson-1.0 -Ijson-c -DMETA_DRIVER -I. -I./ -I/usr/include/postgresql/12/server -I/usr/include/postgresql/internal  -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2  -flto=thin -emit-llvm -c -o json-c/json_object_iterator.bc json-c/json_object_iterator.c
/usr/bin/clang-11 -Wno-ignored-attributes -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -O2  --std=c99 -I/include/libmongoc-1.0 -I/include/libbson-1.0 -Ijson-c -DMETA_DRIVER -I. -I./ -I/usr/include/postgresql/12/server -I/usr/include/postgresql/internal  -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2  -flto=thin -emit-llvm -c -o json-c/printbuf.bc json-c/printbuf.c
/usr/bin/clang-11 -Wno-ignored-attributes -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -O2  --std=c99 -I/include/libmongoc-1.0 -I/include/libbson-1.0 -Ijson-c -DMETA_DRIVER -I. -I./ -I/usr/include/postgresql/12/server -I/usr/include/postgresql/internal  -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2  -flto=thin -emit-llvm -c -o json-c/linkhash.bc json-c/linkhash.c
/usr/bin/clang-11 -Wno-ignored-attributes -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -O2  --std=c99 -I/include/libmongoc-1.0 -I/include/libbson-1.0 -Ijson-c -DMETA_DRIVER -I. -I./ -I/usr/include/postgresql/12/server -I/usr/include/postgresql/internal  -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2  -flto=thin -emit-llvm -c -o json-c/arraylist.bc json-c/arraylist.c
/usr/bin/clang-11 -Wno-ignored-attributes -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -O2  --std=c99 -I/include/libmongoc-1.0 -I/include/libbson-1.0 -Ijson-c -DMETA_DRIVER -I. -I./ -I/usr/include/postgresql/12/server -I/usr/include/postgresql/internal  -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2  -flto=thin -emit-llvm -c -o json-c/random_seed.bc json-c/random_seed.c
/usr/bin/clang-11 -Wno-ignored-attributes -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -O2  --std=c99 -I/include/libmongoc-1.0 -I/include/libbson-1.0 -Ijson-c -DMETA_DRIVER -I. -I./ -I/usr/include/postgresql/12/server -I/usr/include/postgresql/internal  -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2  -flto=thin -emit-llvm -c -o json-c/debug.bc json-c/debug.c
/usr/bin/clang-11 -Wno-ignored-attributes -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -O2  --std=c99 -I/include/libmongoc-1.0 -I/include/libbson-1.0 -Ijson-c -DMETA_DRIVER -I. -I./ -I/usr/include/postgresql/12/server -I/usr/include/postgresql/internal  -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2  -flto=thin -emit-llvm -c -o json-c/strerror_override.bc json-c/strerror_override.c
root@170f137d551a:/tmp/mongo_fdw-REL-5_3_0# make USE_PGXS=1 install
/bin/mkdir -p '/usr/lib/postgresql/12/lib'
/bin/mkdir -p '/usr/share/postgresql/12/extension'
/bin/mkdir -p '/usr/share/postgresql/12/extension'
/usr/bin/install -c -m 755  mongo_fdw.so '/usr/lib/postgresql/12/lib/mongo_fdw.so'
/usr/bin/install -c -m 644 .//mongo_fdw.control '/usr/share/postgresql/12/extension/'
/usr/bin/install -c -m 644 .//mongo_fdw--1.0.sql .//mongo_fdw--1.1.sql .//mongo_fdw--1.0--1.1.sql  '/usr/share/postgresql/12/extension/'
/bin/mkdir -p '/usr/lib/postgresql/12/lib/bitcode/mongo_fdw'
/bin/mkdir -p '/usr/lib/postgresql/12/lib/bitcode'/mongo_fdw/ '/usr/lib/postgresql/12/lib/bitcode'/mongo_fdw/json-c/
/usr/bin/install -c -m 644 connection.bc '/usr/lib/postgresql/12/lib/bitcode'/mongo_fdw/./
/usr/bin/install -c -m 644 option.bc '/usr/lib/postgresql/12/lib/bitcode'/mongo_fdw/./
/usr/bin/install -c -m 644 mongo_wrapper_meta.bc '/usr/lib/postgresql/12/lib/bitcode'/mongo_fdw/./
/usr/bin/install -c -m 644 mongo_fdw.bc '/usr/lib/postgresql/12/lib/bitcode'/mongo_fdw/./
/usr/bin/install -c -m 644 mongo_query.bc '/usr/lib/postgresql/12/lib/bitcode'/mongo_fdw/./
/usr/bin/install -c -m 644 deparse.bc '/usr/lib/postgresql/12/lib/bitcode'/mongo_fdw/./
/usr/bin/install -c -m 644 json-c/json_util.bc '/usr/lib/postgresql/12/lib/bitcode'/mongo_fdw/json-c/
/usr/bin/install -c -m 644 json-c/json_object.bc '/usr/lib/postgresql/12/lib/bitcode'/mongo_fdw/json-c/
/usr/bin/install -c -m 644 json-c/json_tokener.bc '/usr/lib/postgresql/12/lib/bitcode'/mongo_fdw/json-c/
/usr/bin/install -c -m 644 json-c/json_object_iterator.bc '/usr/lib/postgresql/12/lib/bitcode'/mongo_fdw/json-c/
/usr/bin/install -c -m 644 json-c/printbuf.bc '/usr/lib/postgresql/12/lib/bitcode'/mongo_fdw/json-c/
/usr/bin/install -c -m 644 json-c/linkhash.bc '/usr/lib/postgresql/12/lib/bitcode'/mongo_fdw/json-c/
/usr/bin/install -c -m 644 json-c/arraylist.bc '/usr/lib/postgresql/12/lib/bitcode'/mongo_fdw/json-c/
/usr/bin/install -c -m 644 json-c/random_seed.bc '/usr/lib/postgresql/12/lib/bitcode'/mongo_fdw/json-c/
/usr/bin/install -c -m 644 json-c/debug.bc '/usr/lib/postgresql/12/lib/bitcode'/mongo_fdw/json-c/
/usr/bin/install -c -m 644 json-c/strerror_override.bc '/usr/lib/postgresql/12/lib/bitcode'/mongo_fdw/json-c/
cd '/usr/lib/postgresql/12/lib/bitcode' && /usr/lib/llvm-11/bin/llvm-lto -thinlto -thinlto-action=thinlink -o mongo_fdw.index.bc mongo_fdw/connection.bc mongo_fdw/option.bc mongo_fdw/mongo_wrapper_meta.bc mongo_fdw/mongo_fdw.bc mongo_fdw/mongo_query.bc mongo_fdw/deparse.bc mongo_fdw/json-c/json_util.bc mongo_fdw/json-c/json_object.bc mongo_fdw/json-c/json_tokener.bc mongo_fdw/json-c/json_object_iterator.bc mongo_fdw/json-c/printbuf.bc mongo_fdw/json-c/linkhash.bc mongo_fdw/json-c/arraylist.bc mongo_fdw/json-c/random_seed.bc mongo_fdw/json-c/debug.bc mongo_fdw/json-c/strerror_override.bc
root@170f137d551a:/tmp/mongo_fdw-REL-5_3_0# 
root@170f137d551a:/tmp/mongo_fdw-REL-5_3_0# 
cobolbaby commented 2 years ago

In addition, I would like to ask, do errors in the compilation process affect the actual use of functions?

vaibhavdalvi93 commented 2 years ago

Thanks, @cobolbaby for reaching out to us.

I think you missed exporting PKG_CONFIG_PATH and that step is there in README.

In addition, I would like to ask, do errors in the compilation process affect the actual use of functions? Do you mean compilation warnings? If Yes, then there won't be an issue.

cobolbaby commented 2 years ago

I think you missed exporting PKG_CONFIG_PATH and that step is there in README.

Indeed, the environment variable is missing.

Do you mean compilation warnings? If Yes, then there won't be an issue.

Ok.