gearman / gearmand

http://gearman.org/
Other
741 stars 138 forks source link

broken postgres compatibility #282

Closed p-alik closed 2 years ago

p-alik commented 4 years ago

Well, otherwise make dies

libgearman-server/plugins/queue/postgres/queue.cc:55:11: fatal error: libpq-fe.h: No such file or directory
 # include <libpq-fe.h>
           ^~~~~~~~~~~~

Digging deeper:

$ locate libpq-fe.h
/usr/include/postgresql/libpq-fe.h
$ git diff libgearman-server/plugins/queue/postgres/queue.cc
diff --git a/libgearman-server/plugins/queue/postgres/queue.cc b/libgearman-server/plugins/queue/postgres/queue.cc
index ed834aab..c7735dd6 100644
--- a/libgearman-server/plugins/queue/postgres/queue.cc
+++ b/libgearman-server/plugins/queue/postgres/queue.cc
@@ -52,7 +52,7 @@
 #pragma GCC diagnostic push
 #if defined(HAVE_LIBPQ) and HAVE_LIBPQ
 # pragma GCC diagnostic ignored "-Wundef"
-# include <libpq-fe.h>
+# include <postgresql/libpq-fe.h>
 #endif

 #include <cerrno>

$ make
libgearman-server/.libs/libgearman-server.a(lt5-libgearman_server_libgearman_server_la-queue.o): In function `gearmand::plugins::queue::Postgres::~Postgres()':
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:128: undefined reference to `PQfinish'
libgearman-server/.libs/libgearman-server.a(lt5-libgearman_server_libgearman_server_la-queue.o): In function `_libpq_add(gearman_server_st*, void*, char const*, unsigned long, char const*, unsigned long, void const*, unsigned long, gearman_job_priority_t, long)':
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:285: undefined reference to `PQexecParams'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:286: undefined reference to `PQresultStatus'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:288: undefined reference to `PQerrorMessage'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:289: undefined reference to `PQclear'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:293: undefined reference to `PQclear'
libgearman-server/.libs/libgearman-server.a(lt5-libgearman_server_libgearman_server_la-queue.o): In function `_libpq_done(gearman_server_st*, void*, char const*, unsigned long, char const*, unsigned long)':
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:327: undefined reference to `PQexec'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:328: undefined reference to `PQresultStatus'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:330: undefined reference to `PQerrorMessage'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:331: undefined reference to `PQclear'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:335: undefined reference to `PQclear'
libgearman-server/.libs/libgearman-server.a(lt5-libgearman_server_libgearman_server_la-queue.o): In function `_libpq_replay(gearman_server_st*, void*, gearmand_error_t (*)(gearman_server_st*, void*, char const*, unsigned long, char const*, unsigned long, void const*, unsigned long, gearman_job_priority_t, long), void*)':
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:350: undefined reference to `PQexecParams'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:351: undefined reference to `PQresultStatus'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:353: undefined reference to `PQerrorMessage'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:354: undefined reference to `PQclear'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:374: undefined reference to `PQgetlength'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:382: undefined reference to `PQgetvalue'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:392: undefined reference to `PQgetvalue'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:391: undefined reference to `PQgetvalue'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:389: undefined reference to `PQgetlength'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:388: undefined reference to `PQgetvalue'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:387: undefined reference to `PQgetlength'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:386: undefined reference to `PQgetvalue'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:358: undefined reference to `PQntuples'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:360: undefined reference to `PQgetvalue'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:360: undefined reference to `PQgetlength'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:367: undefined reference to `PQgetlength'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:400: undefined reference to `PQclear'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:395: undefined reference to `PQclear'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:378: undefined reference to `PQclear'
libgearman-server/.libs/libgearman-server.a(lt5-libgearman_server_libgearman_server_la-queue.o): In function `_initialize':
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:196: undefined reference to `PQconnectdb'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:198: undefined reference to `PQstatus'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:201: undefined reference to `PQerrorMessage'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:204: undefined reference to `PQsetNoticeProcessor'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:208: undefined reference to `PQexec'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:209: undefined reference to `PQresultStatus'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:212: undefined reference to `PQerrorMessage'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:214: undefined reference to `PQclear'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:218: undefined reference to `PQntuples'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:220: undefined reference to `PQclear'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:224: undefined reference to `PQexec'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:225: undefined reference to `PQresultStatus'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:227: undefined reference to `PQerrorMessage'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:229: undefined reference to `PQclear'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:235: undefined reference to `PQclear'
collect2: error: ld returned 1 exit status
libgearman-server/.libs/libgearman-server.a(lt5-libgearman_server_libgearman_server_la-queue.o): In function `gearmand::plugins::queue::Postgres::~Postgres()':
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:128: undefined reference to `PQfinish'
libgearman-server/.libs/libgearman-server.a(lt5-libgearman_server_libgearman_server_la-queue.o): In function `_libpq_add(gearman_server_st*, void*, char const*, unsigned long, char const*, unsigned long, void const*, unsigned long, gearman_job_priority_t, long)':
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:285: undefined reference to `PQexecParams'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:286: undefined reference to `PQresultStatus'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:288: undefined reference to `PQerrorMessage'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:289: undefined reference to `PQclear'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:293: undefined reference to `PQclear'
libgearman-server/.libs/libgearman-server.a(lt5-libgearman_server_libgearman_server_la-queue.o): In function `_libpq_done(gearman_server_st*, void*, char const*, unsigned long, char const*, unsigned long)':
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:327: undefined reference to `PQexec'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:328: undefined reference to `PQresultStatus'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:330: undefined reference to `PQerrorMessage'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:331: undefined reference to `PQclear'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:335: undefined reference to `PQclear'
libgearman-server/.libs/libgearman-server.a(lt5-libgearman_server_libgearman_server_la-queue.o): In function `_libpq_replay(gearman_server_st*, void*, gearmand_error_t (*)(gearman_server_st*, void*, char const*, unsigned long, char const*, unsigned long, void const*, unsigned long, gearman_job_priority_t, long), void*)':
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:350: undefined reference to `PQexecParams'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:351: undefined reference to `PQresultStatus'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:353: undefined reference to `PQerrorMessage'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:354: undefined reference to `PQclear'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:374: undefined reference to `PQgetlength'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:382: undefined reference to `PQgetvalue'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:392: undefined reference to `PQgetvalue'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:391: undefined reference to `PQgetvalue'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:389: undefined reference to `PQgetlength'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:388: undefined reference to `PQgetvalue'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:387: undefined reference to `PQgetlength'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:386: undefined reference to `PQgetvalue'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:358: undefined reference to `PQntuples'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:360: undefined reference to `PQgetvalue'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:360: undefined reference to `PQgetlength'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:367: undefined reference to `PQgetlength'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:400: undefined reference to `PQclear'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:395: undefined reference to `PQclear'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:378: undefined reference to `PQclear'
libgearman-server/.libs/libgearman-server.a(lt5-libgearman_server_libgearman_server_la-queue.o): In function `_initialize':
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:196: undefined reference to `PQconnectdb'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:198: undefined reference to `PQstatus'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:201: undefined reference to `PQerrorMessage'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:204: undefined reference to `PQsetNoticeProcessor'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:208: undefined reference to `PQexec'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:209: undefined reference to `PQresultStatus'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:212: undefined reference to `PQerrorMessage'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:214: undefined reference to `PQclear'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:218: undefined reference to `PQntuples'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:220: undefined reference to `PQclear'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:224: undefined reference to `PQexec'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:225: undefined reference to `PQresultStatus'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:227: undefined reference to `PQerrorMessage'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:229: undefined reference to `PQclear'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:235: undefined reference to `PQclear'
Makefile:4472: recipe for target 'gearmand/hostile_gearmand' failed
make[2]: *** [gearmand/hostile_gearmand] Error 1
collect2: error: ld returned 1 exit status
make[2]: *** Waiting for unfinished jobs....
Makefile:4460: recipe for target 'gearmand/gearmand' failed
make[2]: *** [gearmand/gearmand] Error 1
ar: `u' modifier ignored since `D' is the default (see `U')
make[2]: Leaving directory '/opt/devel/Gearman/gearmand'
Makefile:8319: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/opt/devel/Gearman/gearmand'
Makefile:3082: recipe for target 'all' failed
make: *** [all] Error 2

As to me (and not only to me) it is convenient and pragmatic solution.

Originally posted by @p-alik in https://github.com/gearman/gearmand/pull/280

esabol commented 3 years ago

I think this was fixed by the 1.1.19.1 release (which reverted the m4 files)? Can I close this?

p-alik commented 3 years ago

I don't think so and I couldn't find any related commit.

esabol commented 3 years ago

That's because the problem was with the m4 files that were mistakenly modified in the 1.1.19 release. That was the whole reason for the 1.1.19.1 release. No commit was necessary to fix the problem because the m4 files in the repository work correctly.

Can you reproduce the issue with the 1.1.19.1 release?

p-alik commented 3 years ago

If I didn't oversee anything, the release 1.1.19.1 contains following m4-commits. 45bd954 59c6bac f859451 c67c766 0019a07 106b140 It appears to me none of them is related to this issue.

SpamapS commented 3 years ago

It was not a commit, it was a distribution build issue.

On Thu, Aug 26, 2021, 6:34 AM Алексей Пастухов @.***> wrote:

If I didn't oversee anything, the release 1.1.19.1 contains following m4-commits. 45bd954 https://github.com/gearman/gearmand/commit/45bd95402d71c583c4737496cc0b48930d548c14 59c6bac https://github.com/gearman/gearmand/commit/59c6bac39ffcee59f64b17dabc36af512c920b2a f859451 https://github.com/gearman/gearmand/commit/f859451456790406a00b28e3438b594344fc51be c67c766 https://github.com/gearman/gearmand/commit/c67c76659cbd462ef2cec5ef816b4b3bc5845d4f 0019a07 https://github.com/gearman/gearmand/commit/0019a076d1ef46f1bf9bf2186f8f071c102b4973 106b140 https://github.com/gearman/gearmand/commit/106b14078b31c9886d2474d66b420fb2d4c40b27 It appears to me none of them is related to this issue.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/gearman/gearmand/issues/282#issuecomment-906419149, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADS6YCHCP6CJZUZSHGQHDDT6Y7GXANCNFSM4K47H6QQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .