Skip to content

PostgreSQL 13 build error #88

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
feld opened this issue Sep 9, 2020 · 9 comments
Closed

PostgreSQL 13 build error #88

feld opened this issue Sep 9, 2020 · 9 comments

Comments

@feld
Copy link

feld commented Sep 9, 2020

Trying to test PostgreSQL 13 beta for a few projects, one requires rum indexes and this extension cannot be built as of version 1.3.6.

src/rum_ts_utils.c:302:8: error: use of undeclared identifier 'TS_EXEC_CALC_NOT'
                                                 TS_EXEC_CALC_NOT,
                                                 ^
src/rum_ts_utils.c:347:8: error: use of undeclared identifier 'TS_EXEC_CALC_NOT'
                                                 TS_EXEC_CALC_NOT | TS_EXEC_PHRASE_NO_POS,
                                                 ^
src/rum_ts_utils.c:905:9: warning: incompatible pointer types passing 'bool (void *, QueryOperand *, ExecPhraseData *)' (aka 'bool (void *, QueryOperand *, struct ExecPhraseData *)') to parameter of type 'TSExec
uteCallback' (aka 'TSTernaryValue (*)(void *, QueryOperand *, struct ExecPhraseData *)') [-Wincompatible-pointer-types]
                                           checkcondition_QueryOperand))
                                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/postgresql/server/tsearch/ts_utils.h:201:27: note: passing argument to parameter 'chkcond' here
                                           TSExecuteCallback chkcond);
                                                             ^
src/rum_ts_utils.c:945:52: error: use of undeclared identifier 'TS_EXEC_CALC_NOT'
                if (TS_execute(GETQUERY(qr->query), (void *) qr, TS_EXEC_CALC_NOT,
                                                                 ^
2 warnings and 3 errors generated.
gmake[1]: *** [<builtin>: src/rum_ts_utils.o] Error 1
gmake[1]: Leaving directory '/wrkdirs/usr/ports/databases/postgresql-rum/work/rum-1.3.6'
@feld
Copy link
Author

feld commented Sep 9, 2020

Looks like it has been changed upstream

https://www.mail-archive.com/[email protected]/msg14157.html

@feld
Copy link
Author

feld commented Sep 9, 2020

Patching TS_EXEC_CALC_NOT is simple, but now we run into add_.*_reloption() functions in src/rumutil.c expecting 6 args in PostgreSQL 13 instead of 5 in previous versions as they added a LOCKMODE flag.

https://doxygen.postgresql.org/reloptions_8h.html

https://doxygen.postgresql.org/lockdefs_8h_source.html#l00026

I do not know the appropriate flag, but after setting 0 as the new arg for these functions the module compiles successfully.

@feld
Copy link
Author

feld commented Sep 9, 2020

Just spotted the #68 PR which covers it. In that case we're in good shape.

@feld
Copy link
Author

feld commented Sep 9, 2020

Successfully built, tried to migrate database with rum and ran into:

/usr/local/lib/postgresql/rum.so: Undefined symbol "parseRelOptions"

edit: major refactoring in this area. Need to utilize the new build_reloptions()

postgres/postgres@3534fa2

edit2: enabling errors for implicit function definitions would have caught this earlier

@devrimgunduz
Copy link

ping... v13 is already out.

@andreak
Copy link

andreak commented Oct 13, 2020

1.3.6 doesn't build with pg13 (of course), but master does.
A fresh checkout works just fine:

$ make USE_PGXS=1 installcheck
/home/andreak/programs/postgresql-master/lib/pgxs/src/makefiles/../../src/test/regress/pg_regress --inputdir=./ --bindir='/home/andreak/programs/postgresql-master/bin'    --dbname=contrib_regression rum rum_validate rum_hash ruminv timestamp orderby orderby_hash altorder altorder_hash limits int2 int4 int8 float4 float8 money oid time timetz date interval macaddr inet cidr text varchar char bytea bit varbit numeric rum_weight array
(using postmaster on Unix socket, port 5433)
============== dropping database "contrib_regression" ==============
NOTICE:  database "contrib_regression" does not exist, skipping
DROP DATABASE
============== creating database "contrib_regression" ==============
CREATE DATABASE
ALTER DATABASE
============== running regression test queries        ==============
test rum                          ... ok          460 ms
test rum_validate                 ... ok           19 ms
test rum_hash                     ... ok          426 ms
test ruminv                       ... ok            7 ms
test timestamp                    ... ok            8 ms
test orderby                      ... ok           51 ms
test orderby_hash                 ... ok           49 ms
test altorder                     ... ok           76 ms
test altorder_hash                ... ok           25 ms
test limits                       ... ok          179 ms
test int2                         ... ok            6 ms
test int4                         ... ok           60 ms
test int8                         ... ok           61 ms
test float4                       ... ok            5 ms
test float8                       ... ok            5 ms
test money                        ... ok            5 ms
test oid                          ... ok            5 ms
test time                         ... ok            5 ms
test timetz                       ... ok            5 ms
test date                         ... ok            5 ms
test interval                     ... ok            5 ms
test macaddr                      ... ok            5 ms
test inet                         ... ok            6 ms
test cidr                         ... ok            6 ms
test text                         ... ok           56 ms
test varchar                      ... ok            6 ms
test char                         ... ok            5 ms
test bytea                        ... ok            6 ms
test bit                          ... ok            5 ms
test varbit                       ... ok            6 ms
test numeric                      ... ok            5 ms
test rum_weight                   ... ok            9 ms
test array                        ... ok          175 ms

======================
 All 33 tests passed. 
======================

[andreak@spaceballs-ng] ~/dev/rum (master)
$ createdb rum_test
[andreak@spaceballs-ng] ~/dev/rum (master)
$ psql rum_test
psql (13.0)
Type "help" for help.

andreak@[local]:5433 13.0 rum_test=# CREATE EXTENSION rum;
CREATE EXTENSION

@encoreshao
Copy link

Does anyone know how to solve this error?

  • Mac OS: macOS Big Sur
  • PostgreSQL 13
➜  rum git:(master) make USE_PGXS=1 installcheck
/usr/local/lib/postgresql/pgxs/src/makefiles/../../src/test/regress/pg_regress --inputdir=./ --bindir='/usr/local/Cellar/postgresql/13.0/bin'    --dbname=contrib_regression rum rum_validate rum_hash ruminv timestamp orderby orderby_hash altorder altorder_hash limits int2 int4 int8 float4 float8 money oid time timetz date interval macaddr inet cidr text varchar char bytea bit varbit numeric rum_weight array
(using postmaster on Unix socket, default port)
============== dropping database "contrib_regression" ==============
NOTICE:  database "contrib_regression" does not exist, skipping
DROP DATABASE
============== creating database "contrib_regression" ==============
CREATE DATABASE
ALTER DATABASE
============== running regression test queries        ==============
test rum                          ... FAILED      551 ms
test rum_validate                 ... FAILED       63 ms
test rum_hash                     ... FAILED      431 ms
test ruminv                       ... FAILED       27 ms
test timestamp                    ... FAILED       25 ms
test orderby                      ... FAILED       43 ms
test orderby_hash                 ... FAILED       42 ms
test altorder                     ... FAILED       66 ms
test altorder_hash                ... FAILED       35 ms
test limits                       ... FAILED      303 ms
test int2                         ... FAILED       21 ms
test int4                         ... FAILED       74 ms
test int8                         ... FAILED       49 ms
test float4                       ... FAILED       24 ms
test float8                       ... FAILED       22 ms
test money                        ... FAILED       27 ms
test oid                          ... FAILED       22 ms
test time                         ... FAILED       27 ms
test timetz                       ... FAILED       22 ms
test date                         ... FAILED       23 ms
test interval                     ... FAILED       23 ms
test macaddr                      ... FAILED       24 ms
test inet                         ... FAILED       26 ms
test cidr                         ... FAILED       23 ms
test text                         ... FAILED       43 ms
test varchar                      ... FAILED       24 ms
test char                         ... FAILED       24 ms
test bytea                        ... FAILED       22 ms
test bit                          ... FAILED       23 ms
test varbit                       ... FAILED       22 ms
test numeric                      ... FAILED       24 ms
test rum_weight                   ... FAILED       38 ms
test array                        ... FAILED       81 ms

========================
 33 of 33 tests failed.
========================

The differences that caused some tests to fail can be viewed in the
file "/Users/encore/Dev/Github/rum/regression.diffs".  A copy of the test summary that you see
above is saved in the file "/Users/encore/Dev/Github/rum/regression.out".

make: *** [installcheck] Error 1
➜  rum git:(master) make USE_PGXS=1 install
clang -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -O2  -bundle -multiply_defined suppress -o rum.so src/rumsort.o src/rum_ts_utils.o src/rumtsquery.o src/rumbtree.o src/rumbulk.o src/rumdatapage.o src/rumentrypage.o src/rumget.o src/ruminsert.o src/rumscan.o src/rumutil.o src/rumvacuum.o src/rumvalidate.o src/btree_rum.o src/rum_arr_utils.o  -L/usr/local/lib  -L/usr/local/opt/[email protected]/lib -L/usr/local/opt/readline/lib  -Wl,-dead_strip_dylibs  -lm  -bundle_loader /usr/local/Cellar/postgresql/13.0/bin/postgres
Undefined symbols for architecture x86_64:
  "_allocateReloptStruct", referenced from:
      _rumoptions in rumutil.o
  "_elog_finish", referenced from:
      _rumStep.cold.1 in rumbtree.o
      _rumStep.cold.2 in rumbtree.o
      _rumFindParents.cold.1 in rumbtree.o
      _rumPlaceToDataPageLeaf.cold.1 in rumdatapage.o
      _rumPlaceToDataPageLeaf.cold.2 in rumdatapage.o
      _rumDataPageLeafRead.cold.1 in rumdatapage.o
      _rumReadTuple.cold.1 in rumentrypage.o
      ...
  "_elog_start", referenced from:
      _rumStep.cold.1 in rumbtree.o
      _rumStep.cold.2 in rumbtree.o
      _rumFindParents.cold.1 in rumbtree.o
      _rumPlaceToDataPageLeaf.cold.1 in rumdatapage.o
      _rumPlaceToDataPageLeaf.cold.2 in rumdatapage.o
      _rumDataPageLeafRead.cold.1 in rumdatapage.o
      _rumReadTuple.cold.1 in rumentrypage.o
      ...
  "_fillRelOptions", referenced from:
      _rumoptions in rumutil.o
  "_parseRelOptions", referenced from:
      _rumoptions in rumutil.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [rum.so] Error 1

Thank you!

@obartunov
Copy link

obartunov commented Nov 16, 2020 via email

@pashkinelfe
Copy link
Contributor

It's been fixed long ago. I close the ticket. Big thanks for reporting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants