Bug 264306 - databases/pgadmin3: compiler error: kwlist.h:28:50: error: too many arguments
Summary: databases/pgadmin3: compiler error: kwlist.h:28:50: error: too many arguments
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Dima Panov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-05-28 07:11 UTC by O. Hartmann
Modified: 2022-07-18 11:10 UTC (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description O. Hartmann 2022-05-28 07:11:32 UTC
This is happening on poudriere running on host 14-CURRENT, jail is 13-STABLE:

In file included from db/keywords.c:33:
/usr/local/include/postgresql/server/parser/kwlist.h:28:50: error: too many arguments provided to function-like macro invocation
PG_KEYWORD("abort", ABORT_P, UNRESERVED_KEYWORD, BARE_LABEL)
                                                 ^
db/keywords.c:31:9: note: macro 'PG_KEYWORD' defined here
#define PG_KEYWORD(a,b,c) {a,c},

Same happens on 13-STABLE and 14-URRENT when compiling the port via /usr/ports and make.

PostgreSQL 13 and 14 are in use.
Comment 1 Vladimir Druzenko freebsd_committer freebsd_triage 2022-06-15 10:12:34 UTC
My patch is:
# cat /usr/ports/databases/pgadmin3/files/patch-pgadmin_db_keywords.c
--- pgadmin/db/keywords.c.orig  2015-02-25 10:44:26 UTC
+++ pgadmin/db/keywords.c
@@ -28,7 +28,7 @@
 /*
  * List of (keyword-name, keyword-token-value) pairs.
  */
-#define PG_KEYWORD(a,b,c) {a,c},
+#define PG_KEYWORD(a,b,c,d) {a,c},
 const ScanKeyword ScanKeywords[] = {
 #include <parser/kwlist.h>
 };

But PostgreSQL 10, 11 and 12 have 3 arguments in PG_KEYWORD and pgadmin3 build will fail with this patch.
I don't know how correct check version of the PostgreSQL during build in this case.
Comment 2 Dima Panov freebsd_committer freebsd_triage 2022-07-13 12:03:21 UTC
It can be added as extra-patch under condition .if ${PGSQL_VER}>=13, for example.
I'll handle this
Comment 3 commit-hook freebsd_committer freebsd_triage 2022-07-17 15:30:17 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=b396608f52094b80f0f4af88e908b7e94ba15fb4

commit b396608f52094b80f0f4af88e908b7e94ba15fb4
Author:     Dima Panov <fluffy@FreeBSD.org>
AuthorDate: 2022-07-17 15:28:13 +0000
Commit:     Dima Panov <fluffy@FreeBSD.org>
CommitDate: 2022-07-17 15:28:13 +0000

    databases/pgadmin3: unbreak build with PgSQL 13+

    PR:     264306
    MFH:    2022Q3

 databases/pgadmin3/Makefile                    |  8 +++++++-
 databases/pgadmin3/files/extrapatch-pg13 (new) | 11 +++++++++++
 2 files changed, 18 insertions(+), 1 deletion(-)
Comment 4 commit-hook freebsd_committer freebsd_triage 2022-07-17 15:30:19 UTC
A commit in branch 2022Q3 references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=1278cf655f091b602e673b576fdebcf3df7b3323

commit 1278cf655f091b602e673b576fdebcf3df7b3323
Author:     Dima Panov <fluffy@FreeBSD.org>
AuthorDate: 2022-07-17 15:28:13 +0000
Commit:     Dima Panov <fluffy@FreeBSD.org>
CommitDate: 2022-07-17 15:29:47 +0000

    databases/pgadmin3: unbreak build with PgSQL 13+

    PR:     264306
    MFH:    2022Q3
    (cherry picked from commit b396608f52094b80f0f4af88e908b7e94ba15fb4)

 databases/pgadmin3/Makefile                    |  8 +++++++-
 databases/pgadmin3/files/extrapatch-pg13 (new) | 11 +++++++++++
 2 files changed, 18 insertions(+), 1 deletion(-)
Comment 5 Dima Panov freebsd_committer freebsd_triage 2022-07-17 15:31:10 UTC
Thanks, VVD! Patch is landed
Comment 6 Vladimir Druzenko freebsd_committer freebsd_triage 2022-07-17 21:37:02 UTC
(In reply to Dima Panov from comment #2)
> .if ${PGSQL_VER}>=13
I didn't know about this variable.
Thanks!
Comment 7 O. Hartmann 2022-07-18 07:58:50 UTC
Thank you for fixing this issue, much appreciated.

I didn't know about the variable PGSQL_VER either, good to know.

Kind regards
Comment 8 Vladimir Druzenko freebsd_committer freebsd_triage 2022-07-18 09:35:49 UTC
(In reply to O. Hartmann from comment #7)
I create ports databases/pgadmin3-lts from this project https://github.com/allentc/pgadmin3-lts (fork of BigSQL, fork of pgadmin3).
Do you want to test it before I create PR?
Or maybe better I create PR and other users can to test it too…
Comment 9 Vladimir Druzenko freebsd_committer freebsd_triage 2022-07-18 11:10:08 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=265294