Problems having Kopano Core recognize libkcoidc
-
I’m compiling my own build based on the sources from the Kopano “stash” and seem to be not able to have the core ./configure script recognize that I have libkcoidc installed.
Build system: Alpine Edge (musl)
libkcoidc version tried:0.9.2
+master
Go Version for building libkcoidc: 1.15.4
Python 3.8I build libkcoidc like so:
autoreconf -fiv && \ ./configure \ --prefix /usr \ && \ \ make -j $(nproc) all && \ make install all bash-5.0# make all install running gofmt ... retrieving dependencies ... building C libs lib/kcoidc ... CGO_ENABLED=1 /usr/bin/go build \ -mod=vendor \ -tags release \ -trimpath \ -buildmode=c-shared \ -asmflags '' \ -gcflags '' \ -ldflags ' -buildid=reproducible/0.9.2 -X stash.kopano.io/kc/libkcoidc/internal/version.Version=0.9.2 -X stash.kopano.io/kc/libkcoidc/internal/version.BuildDate=2020-12-22T00:15:40Z -linkmode external "-extldflags=-Wl,-soname,libkcoidc.so.0 "' \ -o ./.libs/kcoidc.so ./lib/kcoidc cd ./.libs && ln -sfn libkcoidc.so.0 libkcoidc.so (cd python && /usr/bin/python3 setup.py build) running build running build_py running build_ext installing ... cp -af libkcoidc.pc /usr/lib/pkgconfig cp -f ./.libs/libkcoidc.so.0 /usr/lib chmod 755 /usr/lib/libkcoidc.so.0 rm -f /usr/lib/libkcoidc.so ln -s libkcoidc.so.0 /usr/lib/libkcoidc.so cp -f ./.libs/include/kcoidc/kcoidc_callbacks.h /usr/include/kcoidc (ldconfig || true) >/dev/null 2>&1
Which seems to install both the C libraries and the Python libraries.
What is interesting is that inside the /.libs folder iskdcoidc.h
which does not get installed to /usr/include/kcoidc. I have tried to manually copy it.A look on the filesystem shows libkcoidc.so modules in /usr/lib where it should.
I then try to run the configure script for kopano-core. Here’s the juicy bits:
Kopano Core tag
kopanocore-10.0.6
PYTHON=/usr/bin/python3 CPPFLAGS="$CPPFLAGS -fPIC -fPIE -g3 -O0 -Wall -Wextra -Wunused-macros" CFLAGS="$CFLAGS -O0 -g3 -Wall -Wextra" ./configure --prefix=/usr --localstatedir=/var --sysconfdir=/etc --exec-prefix=/usr --sbindir=/usr/bin --datarootdir=/usr/share --enable-release --enable-epoll --enable-python --disable-static --with-quotatemplate-prefix=/etc/kopano/quotamail --with-searchscripts-prefix=/etc/kopano/searchscripts | grep oidc checking kcoidc.h usability... no checking kcoidc.h presence... no checking for kcoidc.h... no checking for library containing kcoidc_initialize... -lkcoidc
I can’t for the life of me figure out what I’m doing wrong here. Obviously the symptom for not being able to get this to work is kopano-server throwing errors on startup when
enable_sso=yes
is enabled along with the kcoidc_ options.Unknown option kcoidc_issuer_identifier" found! Unknown option "kcoidc_insecure_skip_verify" found!
Any advice would be appreciated.
-
Hi @tiredofit,
you also have to pass
--enable-kcoidc
when running configure. -
@fbartels Hi Felix, that’s what I thought as well (and have always done) - Sadly configure outputs this when I include it:
bash-5.0# PYTHON=/usr/bin/python3 CPPFLAGS="$CPPFLAGS -fPIC -fPIE -g3 -O0 -Wall -Wextra -Wunused-macros" CFLAGS="$CFLAGS -O0 -g3 -Wall -Wextra" ./configure --prefix=/usr --localstatedir=/var --sysconfdir=/etc --exec-prefix=/usr --sbindir=/usr/bin --datarootdir=/usr/share --enable-release --enable-epoll --enable-python --enable-kcoidc --disable-static --with-quotatemplate-prefix=/etc/kopano/quotamail --with-searchscripts-prefix=/etc/kopano/searchscripts | grep oidc configure: WARNING: unrecognized options: --enable-kcoidc checking kcoidc.h usability... no checking kcoidc.h presence... no checking for kcoidc.h... no checking for library containing kcoidc_initialize... -lkcoidc bash-5.0#
It seems something has changed recently with either the changes in libkcoidc (0.9.1 + introduces pkgconfig support!) and kopanocore-10.0.6.
-
@tiredofit said in Problems having Kopano Core recognize libkcoidc:
What is interesting is that inside the /.libs folder is kdcoidc.h which does not get installed to /usr/include/kcoidc. I have tried to manually copy it.
Confirmed. Seems to be a bug in
make install
, not installing that file. Manually copy it is the workaround.A look on the filesystem shows libkcoidc.so modules in /usr/lib where it should.
I then try to run the configure script for kopano-core. Here’s the juicy bits:
Kopano Core tag kopanocore-10.0.6kopanocore-10.0.6 is not build compatible with libkcoidc 0.9.x without modification - either use a newer kopanocore or use libkcoidc 0.8.x.
Hope that helps.
-
@longsleep Thank you.
I had to focus my energies elsewhere but have circled back to this. I have now moved to 11.0…0 version (actually master) from the sources.
Using libkcoidc from the master branch compiles however I get immediate segfaults when trying to execute kopano-server with libkcoidc support compiled in.
Alpine 3.13 (musl based)
libkcoidc commit: fd3bbf2de7dcc25d9d8aa4a5fe6be5cba88b12ca
kopano-core commit: 464ecb3f265427c8440ccca386aba74064a8de8dNothing appears in logs on debug mode other than
Segmentation fault (core dumped)
When I run
gdb kopano-server
the following is output.(gdb) run Starting program: /usr/bin/kopano-server warning: Error disabling address space randomization: Operation not permitted warning: Missing auto-load script at offset 0 in section .debug_gdb_scripts of file /usr/lib/libkcoidc.so.0. Use `info auto-load python-scripts [REGEXP]' to list them. [New LWP 9874] Thread 2 "kopano-server" received signal SIGSEGV, Segmentation fault. [Switching to LWP 9874] 0x00007fedbe4c788c in runtime.argv_index (argv=0x0, i=-1096968751) at runtime/runtime1.go:57 57 runtime/runtime1.go: No such file or directory.
I don’t fully understand gdb sadly so I’ve hit a wall, and perhaps being sent down a wild goose chase with the last output stating there is no such file or directory. I have learned all what I know by reading the Jenkins files in the source trees, so I may be off, but FWIW this is how I compile libkcoidc:
autoreconf -fiv && \ ./configure \ --prefix /usr \ --exec-prefix=/usr \ --localstatedir=/var \ --libdir=/usr/lib \ && \ \ make -j $(nproc) all && \ PYTHON="$(which python3)" make install all && \ PYTHON="$(which python3)" make python && \ cp .libs/include/kcoidc/kcoidc.h /usr/include/kcoidc/
If I don’t compile libkcoidc and compile Kopano-core everything runs as expected (without konnect support obviously), which is where I am trying to solve.
-
@tiredofit well this is an issue with muslc - or viewed the other way around, It only works with glibc. We do not support muslc for the time being.
See https://github.com/golang/go/issues/13492 which needs to be fixed before this works. I don’t know if a workaround can be found.
-
@longsleep Thanks for identifying this. This seems to be a long standing issue and you are right, unlikely to be resolved at any time soon. Back to the drawing board for me to use a libc based system. I was so close!
-
I think that there is a mistake in your code