Skip to content
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

Fix building db service with pg_amqp and new base image #268

Merged
merged 1 commit into from
Feb 9, 2024

Conversation

yvanzo
Copy link
Contributor

@yvanzo yvanzo commented Feb 8, 2024

The official Docker images for Postgres updated their base image to more recent versions of Debian, breaking the compilation of pg_amqp.

This patch sets image variant, to prevent further breakage, and compilation flag, to address the three following errors:

2.857 /usr/bin/clang-16 -Wno-ignored-attributes -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Xclang -no-opaque-pointers -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -Wno-deprecated-non-prototype -O2  -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 src/pg_amqp.bc src/pg_amqp.c
2.989 src/pg_amqp.c:99:10: warning: 5 enumeration values not handled in switch: 'XACT_EVENT_PARALLEL_COMMIT', 'XACT_EVENT_PARALLEL_ABORT', 'XACT_EVENT_PRE_COMMIT'... [-Wswitch]
2.989   switch(event) {
2.989          ^~~~~
2.989 src/pg_amqp.c:140:21: error: parameter 'broker_id' was not declared, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int]
2.989 local_amqp_get_a_bs(broker_id) {
2.989                     ^
2.989 src/pg_amqp.c:152:19: error: parameter 'broker_id' was not declared, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int]
2.989 local_amqp_get_bs(broker_id) {
2.989                   ^
2.990 src/pg_amqp.c:239:23: error: parameter 'broker_id' was not declared, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int]
2.991 local_amqp_disconnect(broker_id) {
2.991                       ^
2.994 1 warning and 3 errors generated.
2.997 make: *** [/usr/lib/postgresql/12/lib/pgxs/src/makefiles/../../src/Makefile.global:1076: src/pg_amqp.bc] Error 1

The official Docker images for Postgres updated their base image to more
recent versions of Debian, breaking the compilation of pg_amqp.

This patch sets image variant, to prevent further breakage,
and compilation flag, to address the three following errors:

    2.857 /usr/bin/clang-16 -Wno-ignored-attributes -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Xclang -no-opaque-pointers -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -Wno-deprecated-non-prototype -O2  -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 src/pg_amqp.bc src/pg_amqp.c
    2.989 src/pg_amqp.c:99:10: warning: 5 enumeration values not handled in switch: 'XACT_EVENT_PARALLEL_COMMIT', 'XACT_EVENT_PARALLEL_ABORT', 'XACT_EVENT_PRE_COMMIT'... [-Wswitch]
    2.989   switch(event) {
    2.989          ^~~~~
    2.989 src/pg_amqp.c:140:21: error: parameter 'broker_id' was not declared, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int]
    2.989 local_amqp_get_a_bs(broker_id) {
    2.989                     ^
    2.989 src/pg_amqp.c:152:19: error: parameter 'broker_id' was not declared, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int]
    2.989 local_amqp_get_bs(broker_id) {
    2.989                   ^
    2.990 src/pg_amqp.c:239:23: error: parameter 'broker_id' was not declared, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int]
    2.991 local_amqp_disconnect(broker_id) {
    2.991                       ^
    2.994 1 warning and 3 errors generated.
    2.997 make: *** [/usr/lib/postgresql/12/lib/pgxs/src/makefiles/../../src/Makefile.global:1076: src/pg_amqp.bc] Error 1
@yvanzo yvanzo requested review from mwiencek and amCap1712 February 8, 2024 20:59
Copy link
Member

@mwiencek mwiencek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes look sensible and correct, though I did not execute them (I assume you did already :)).

@yvanzo yvanzo changed the title Fix building pg_amqp with debian bookworm Fix building db service with pg_amqp and new base image Feb 9, 2024
@yvanzo
Copy link
Contributor Author

yvanzo commented Feb 9, 2024

Tested by creating AMQP extension, installing search triggers, enabling live indexing, and searching for changes in sample data.

@yvanzo yvanzo merged commit b02c61b into metabrainz:master Feb 9, 2024
@yvanzo yvanzo deleted the fix-pg-amqp-build branch February 9, 2024 15:01
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

Successfully merging this pull request may close these issues.

2 participants