postgres-plr / plr

PL/R - R Procedural Language for PostgreSQL
GNU General Public License v2.0
122 stars 27 forks source link

PostgreSQL 17 support #156

Open devrimgunduz opened 1 month ago

devrimgunduz commented 1 month ago

Hi,

8.4.6 fails to build against PostgreSQL 17. v17 beta2 is already out. Can you please take a look?

Thanks, Devrim

/usr/bin/clang -Wno-ignored-attributes -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -Wno-format-truncation -O2 -I"./" -I"-I/usr/include/R" -I/usr/include/R -I. -I./ -I/usr/pgsql-17/include/server -I/usr/pgsql-17/include/internal -D_GNU_SOURCE -I/usr/include/libxml2 -DWITH_GZFILEOP -I/usr/include -DPKGLIBDIR=\"/usr/pgsql-17/lib\" -DDLSUFFIX=\".so\" -DR_HOME_DEFAULT=\"/usr/lib64/R\" -flto=thin -emit-llvm -c -o pg_rsupport.bc pg_rsupport.c In file included from plr.h:117, from plr.c:33: plr.c: In function ‘plr_convertargs’: /usr/include/R/Rdefines.h:148:33: warning: ‘el’ may be used uninitialized [-Wmaybe-uninitialized] 148 | #define GET_LENGTH(x) Rf_length(x) | ^~~~ plr.c:1628:25: note: ‘el’ was declared here 1628 | el; | ^~ pg_userfuncs.c:414:2: error: call to undeclared function 'tuplestore_donestoring'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 414 | tuplestore_donestoring(tupstore); | ^ 1 error generated. make[1]: [/usr/pgsql-17/lib/pgxs/src/makefiles/../../src/Makefile.global:1085: pg_userfuncs.bc] Error 1 make[1]: Waiting for unfinished jobs.... pg_conversion.c:2137:2: error: call to undeclared function 'tuplestore_donestoring'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 2137 | tuplestore_donestoring(tupstore); | ^ pg_conversion.c:2200:2: error: call to undeclared function 'tuplestore_donestoring'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 2200 | tuplestore_donestoring(tupstore); | ^ pg_conversion.c:2260:2: error: call to undeclared function 'tuplestore_donestoring'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 2260 | tuplestore_donestoring(tupstore); | ^ 3 errors generated. make[1]: [/usr/pgsql-17/lib/pgxs/src/makefiles/../../src/Makefile.global:1085: pg_conversion.bc] Error 1 pg_userfuncs.c: In function ‘plr_environ’: pg_userfuncs.c:414:9: error: implicit declaration of function ‘tuplestore_donestoring’; did you mean ‘tuplestore_rescan’? [-Wimplicit-function-declaration] 414 | tuplestore_donestoring(tupstore); | ^~~~~~ | tuplestore_rescan make[1]: [: pg_userfuncs.o] Error 1 pg_conversion.c: In function ‘get_frame_tuplestore’: pg_conversion.c:2137:9: error: implicit declaration of function ‘tuplestore_donestoring’; did you mean ‘tuplestore_rescan’? [-Wimplicit-function-declaration] 2137 | tuplestore_donestoring(tupstore); | ^~~~~~ | tuplestore_rescan make[1]: *** [: pg_conversion.o] Error 1

davecramer commented 1 month ago

sure, thanks for the report

AndreMikulec commented 1 month ago

@devrimgunduz

Dave is building every day using the pg "master". How exactly are you trying to build plr?

plr/.github/workflows/build.yml uses pg master https://github.com/davecramer/plr/blob/release_17/.github/workflows/build.yml#L25C10-L25C34

git clone --depth=1 https://github.com/postgres/postgres.git

Job https://github.com/davecramer/plr/actions/runs/10161280166/job/28099428293#step:5:28

# using postmaster on Unix socket, default port
ok 1         - plr                                      1985 ms
ok 2         - bad_fun                                   126 ms
ok 3         - opt_window                                128 ms
ok 4         - do                                        125 ms
ok 5         - out_args                                  127 ms
ok 6         - plr_transaction                           147 ms
ok 7         - opt_window_frame                          128 ms
1..7
# All 7 tests passed.

The Job workflow file https://github.com/davecramer/plr/actions/runs/10161280166/workflow

The Job workflow file uses pg master https://github.com/davecramer/plr/actions/runs/10161280166/workflow#L31

git clone --depth=1 https://github.com/postgres/postgres.git

Can you build in the same way as the workflow file? Next, can you build using pg 17 beta2? One needs to replace

git clone --depth=1 https://github.com/postgres/postgres.git

with

git clone --branch REL_17_BETA2 --depth=1 https://github.com/postgres/postgres.git

Compare?

davecramer commented 1 month ago

@AndreMikulec He needs a tag to build off of, we need to release 8_4_7 which is why I was trying to get CI to build clean.

I think we can release and fix it later. Most of the CI is succeeding.

Thoughts ?

AndreMikulec commented 1 month ago

Dave,

What is being done about 8_4_7? I did not see any plr C code changes here except pg versions and file renaming. https://github.com/davecramer/plr/commits/release_17/

Within a week, I will try to make a pull request. based off (but actually from my online clone of postgres-plr):

https://github.com/AndreMikulec/plr/tree/July_2024_updated_builds and SOME successful 17 recent actions https://github.com/AndreMikulec/plr/actions

davecramer commented 1 month ago

There are no code changes other than versioning and sql files. So really I can back out any changes to CI and just merge that and tag it. I'm OK with the current failing tests.

AndreMikulec commented 1 month ago

@devrimgunduz

REL17 had built here on ubuntu x64. https://github.com/postgres-plr/plr/actions/runs/10238114376/job/28322183597

@devrimgunduz, please verify, and if successful one may close the issue.