Skip to content

Ошибка при сборке расширения под PostgreSQL 17 #9

@sgrinko

Description

@sgrinko

Добрый день,
при сборке расширения в докере на DEBIAN_RELEASE=bookworm
код сборки:

git clone ...
cd shared_ispell
make USE_PGXS=1
make USE_PGXS=1 install

получаю вот такую ошибку на HEAD (Commits on Sep 4, 2025)

------
 > [ 3/12] RUN      cd /tmp/build_ext       && git clone https://github.com/postgrespro/shared_ispell       && cd shared_ispell       && make USE_PGXS=1       && make USE_PGXS=1 install:
0.792 Клонирование в «shared_ispell»...
1.621 gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wshadow=compatible-local -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -g -O2 -Werror=implicit-function-declaration -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -fno-omit-frame-pointer -fPIC -fvisibility=hidden -I. -I./ -I/usr/include/postgresql/17/server -I/usr/include/postgresql/internal -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE  -I/usr/include/libxml2   -c -o src/shared_ispell.o src/shared_ispell.c
1.707 src/shared_ispell.c: In function ‘init_shared_dict’:
1.707 src/shared_ispell.c:351:41: error: assignment to ‘char **’ from incompatible pointer type ‘const char **’ [-Wincompatible-pointer-types]
1.707   351 |                         dict->AffixData = (const char **) palloc0(dict->nAffixData * sizeof(char *));
1.707       |                                         ^
1.708 src/shared_ispell.c:397:59: error: passing argument 3 of ‘readstoplist’ from incompatible pointer type [-Wincompatible-pointer-types]
1.708   397 |                         readstoplist(stopFile, &stoplist, str_tolower);
1.708       |                                                           ^~~~~~~~~~~
1.708       |                                                           |
1.708       |                                                           char * (*)(const char *, size_t,  Oid) {aka char * (*)(const char *, long unsigned int,  unsigned int)}
1.708 In file included from /usr/include/postgresql/17/server/tsearch/dicts/spell.h:19,
1.708                  from src/shared_ispell.h:7,
1.708                  from src/shared_ispell.c:66:
1.708 /usr/include/postgresql/17/server/tsearch/ts_public.h:107:58: note: expected ‘char * (*)(const char *)’ but argument is of type ‘char * (*)(const char *, size_t,  Oid)’ {aka ‘char * (*)(const char *, long unsigned int,  unsigned int)’}
1.708   107 |                                                  char *(*wordop) (const char *));
1.708       |                                                  ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
1.710 src/shared_ispell.c: In function ‘copyIspellDict’:
1.711 src/shared_ispell.c:823:30: error: assignment to ‘char **’ from incompatible pointer type ‘const char **’ [-Wincompatible-pointer-types]
1.711   823 |         copy->dict.AffixData = (const char **) shalloc(sizeof(char *) * dict->nAffixData);
1.711       |                              ^
1.718 make: *** [<встроенное>: src/shared_ispell.o] Ошибка 1
------

если исключаю проблемные коммиты
git checkout 56c47f0 ## Commits on Feb 20, 2025
то получаю другую ошибку:

1.644 HEAD сейчас на bd5eeb2 PGPRO-12044: Add output variant for PG18 for contrib/shared_ispell/sql/security.sql  test.
1.731 gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wshadow=compatible-local -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -g -O2 -Werror=implicit-function-declaration -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -fno-omit-frame-pointer -fPIC -fvisibility=hidden -I. -I./ -I/usr/include/postgresql/17/server -I/usr/include/postgresql/internal -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE  -I/usr/include/libxml2   -c -o src/shared_ispell.o src/shared_ispell.c
1.813 src/shared_ispell.c: In function ‘init_shared_dict’:
1.813 src/shared_ispell.c:400:59: error: passing argument 3 of ‘readstoplist’ from incompatible pointer type [-Wincompatible-pointer-types]
1.813   400 |                         readstoplist(stopFile, &stoplist, str_tolower);
1.813       |                                                           ^~~~~~~~~~~
1.813       |                                                           |
1.813       |                                                           char * (*)(const char *, size_t,  Oid) {aka char * (*)(const char *, long unsigned int,  unsigned int)}
1.813 In file included from /usr/include/postgresql/17/server/tsearch/dicts/spell.h:19,
1.813                  from src/shared_ispell.h:7,
1.813                  from src/shared_ispell.c:66:
1.813 /usr/include/postgresql/17/server/tsearch/ts_public.h:107:58: note: expected ‘char * (*)(const char *)’ but argument is of type ‘char * (*)(const char *, size_t,  Oid)’ {aka ‘char * (*)(const char *, long unsigned int,  unsigned int)’}
1.813   107 |                                                  char *(*wordop) (const char *));
1.813       |                                                  ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
1.828 make: *** [<встроенное>: src/shared_ispell.o] Ошибка 1

если исключаю и эти проблемные коммиты
git checkout 6c335c4 ## Commits on Jan 24, 2025
то расширение успешно строится.

По наименованиям коммитов сделал предположение, что шла адаптация под будущую 18-ю версию.
Может быть стоит тогда ввести тэги или вести выпуск релизов, чтобы облегчить сборку под разные версии PostgreSQL?
Но может просто нужно теперь иначе выполнять компиляцию?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions