pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

databases/postgresql12-client: threads can be enabled on DragonFly BSD



Hello,

Recently I tried to use nextcloud built from pkgsrc. I immediately stumbled upon a problem with php module for postgresql - it hangs. I attached gdb to the hanged process and found that the problem is somewhere in postgresql client library, more specifically in gssapi support. I compared the compilation options with ones in Dragonfly's dports collection and noticed that gssapi is disabled by default in there. Since I don't need it I disable it too. That solved the problem, but while looking at the differences with pkgsrc and dports I noticed the following in databases/postgresql12-client/Makefile:

# 1. The thread-safety test in ${WRSRC}/src/tools/thread does not pass on
# NetBSD earlier than 4.0 or DragonFly.
# 2. configure with --enable-thread-safety fails on OpenBSD.
.if (${OPSYS} == "NetBSD" && !empty(OS_VERSION:M[0-3].*)) || \
    ${OPSYS} == "DragonFly" || ${OPSYS} == "OpenBSD" || ${OPSYS} == "MirBSD"
PGSQL_THREAD_SAFETY?=   no
.endif
PGSQL_THREAD_SAFETY?=   yes
BUILD_DEFS+=            PGSQL_THREAD_SAFETY

But the threads are enabled by default on Dragonfly, so I enabled threads and compiled src/test/thread/thread_test.c I had to do some manual tweaks in order to link it against port/libpgport.a, but in the end the test indeed passed:

a@fi:/usr/pkgsrc/databases/postgresql12-client$ uname -a
DragonFly fi.zta.lk 5.8-RELEASE DragonFly v5.8.1.49.ge8202-RELEASE #2: Tue Aug  4 11:56:41 CEST 2020     root%fi.zta.lk@localhost:/usr/obj/usr/src/sys/X86_64_GENERIC  x86_64
a@fi:/usr/pkgsrc/databases/postgresql12-client$ (cd /var/tmp/pkgsrc-obj/databases/postgresql12-client/work/postgresql-12.3/src/test/thread && ./thread_test)
Your errno is thread-safe.
Your system has strerror_r(); it does not need strerror().
Your system has getpwuid_r();  it does not need getpwuid().
Your system has getaddrinfo();  it does not need gethostbyname()
  or gethostbyname_r().

Your platform is thread-safe.

So I suggest enabling the threads support on Dragonfly as it is done in dpolts. Here is the patch:

diff --git a/databases/postgresql12-client/Makefile b/databases/postgresql12-client/Makefile
index 4808c103589..73f2db8eca0 100644
--- a/databases/postgresql12-client/Makefile
+++ b/databases/postgresql12-client/Makefile
@@ -22,10 +22,10 @@ INSTALLATION_DIRS+= bin
 .endif
 
 # 1. The thread-safety test in ${WRSRC}/src/tools/thread does not pass on
-# NetBSD earlier than 4.0 or DragonFly.
+# NetBSD earlier than 4.0.
 # 2. configure with --enable-thread-safety fails on OpenBSD.
 .if (${OPSYS} == "NetBSD" && !empty(OS_VERSION:M[0-3].*)) || \
-    ${OPSYS} == "DragonFly" || ${OPSYS} == "OpenBSD" || ${OPSYS} == "MirBSD"
+    ${OPSYS} == "OpenBSD" || ${OPSYS} == "MirBSD"
 PGSQL_THREAD_SAFETY?=  no
 .endif
 PGSQL_THREAD_SAFETY?=  yes

P. S. I still don't know what was the problem with gssapi - if I have time I might try to investigate. Meanwhile it might make sense to disable it for postgresql on Dragonfly by default?

--
Aleksej Lebedev


Home | Main Index | Thread Index | Old Index