I noticed that the Travis Haskell build job fails after commit 4972338 in PR #1940. The problem seems to be that some Markdown Shell Recorder tests print warnings about missing modules to stderr. The tests work correctly otherwise. Does anybody know how we can fix this problem?
Configure a minimal build of Elektra:
mkdir build
cd build
cmake -GNinja \
-DTOOLS='kdb' \
-DBINDINGS='' \
-DPLUGINS='resolver_fm_hpu_b;dump' \
-DBUILD_DOCUMENTATION=OFF ..
Build Elektra
ninja
Try to retrieve an non-existent key via kdb
kdb get user/does/not/exist
The command above should print the following error message to stdout:
Did not find key 'user/does/not/exist'
.
The command kdb get user/does/not/exist prints the following error message:
Did not find key 'user/does/not/exist'
Sorry, 15 warnings were issued ;(
Warning (#1):
Description: could not load module, dlopen failed
Ingroup: modules
Module: dl
At: ../src/libs/loader/dl.c:89
Reason: of module: libelektra-list.so, because: dlopen(libelektra-list.so, 2): image not found
Mountpoint: system/elektra/mountpoints
Configfile: kdbOpen(): mountGlobals
Warning (#64):
Description: could not load plugin in process plugin
Ingroup: modules
Module: kdb
At: ../src/libs/elektra/mount.c:301
Reason: list
Mountpoint: system/elektra/mountpoints
Configfile: kdbOpen(): mountGlobals
Warning (#1):
Description: could not load module, dlopen failed
Ingroup: modules
Module: dl
At: ../src/libs/loader/dl.c:89
Reason: of module: libelektra-list.so, because: dlopen(libelektra-list.so, 2): image not found
Mountpoint: system/elektra/mountpoints
Configfile: kdbOpen(): mountGlobals
Warning (#64):
Description: could not load plugin in process plugin
Ingroup: modules
Module: kdb
At: ../src/libs/elektra/mount.c:301
Reason: list
Mountpoint: system/elektra/mountpoints
Configfile: kdbOpen(): mountGlobals
Warning (#1):
Description: could not load module, dlopen failed
Ingroup: modules
Module: dl
At: ../src/libs/loader/dl.c:89
Reason: of module: libelektra-list.so, because: dlopen(libelektra-list.so, 2): image not found
Mountpoint: system/elektra/mountpoints
Configfile: kdbOpen(): mountGlobals
Warning (#64):
Description: could not load plugin in process plugin
Ingroup: modules
Module: kdb
At: ../src/libs/elektra/mount.c:301
Reason: list
Mountpoint: system/elektra/mountpoints
Configfile: kdbOpen(): mountGlobals
Warning (#1):
Description: could not load module, dlopen failed
Ingroup: modules
Module: dl
At: ../src/libs/loader/dl.c:89
Reason: of module: libelektra-list.so, because: dlopen(libelektra-list.so, 2): image not found
Mountpoint: system/elektra/mountpoints
Configfile: kdbOpen(): mountGlobals
Warning (#64):
Description: could not load plugin in process plugin
Ingroup: modules
Module: kdb
At: ../src/libs/elektra/mount.c:301
Reason: list
Mountpoint: system/elektra/mountpoints
Configfile: kdbOpen(): mountGlobals
Warning (#1):
Description: could not load module, dlopen failed
Ingroup: modules
Module: dl
At: ../src/libs/loader/dl.c:89
Reason: of module: libelektra-list.so, because: dlopen(libelektra-list.so, 2): image not found
Mountpoint: system/elektra/mountpoints
Configfile: kdbOpen(): mountGlobals
Warning (#64):
Description: could not load plugin in process plugin
Ingroup: modules
Module: kdb
At: ../src/libs/elektra/mount.c:301
Reason: list
Mountpoint: system/elektra/mountpoints
Configfile: kdbOpen(): mountGlobals
Warning (#1):
Description: could not load module, dlopen failed
Ingroup: modules
Module: dl
At: ../src/libs/loader/dl.c:89
Reason: of module: libelektra-list.so, because: dlopen(libelektra-list.so, 2): image not found
Mountpoint: system/elektra/mountpoints
Configfile: kdbOpen(): mountGlobals
Warning (#64):
Description: could not load plugin in process plugin
Ingroup: modules
Module: kdb
At: ../src/libs/elektra/mount.c:301
Reason: list
Mountpoint: system/elektra/mountpoints
Configfile: kdbOpen(): mountGlobals
Warning (#1):
Description: could not load module, dlopen failed
Ingroup: modules
Module: dl
At: ../src/libs/loader/dl.c:89
Reason: of module: libelektra-list.so, because: dlopen(libelektra-list.so, 2): image not found
Mountpoint: system/elektra/mountpoints
Configfile: kdbOpen(): mountGlobals
Warning (#64):
Description: could not load plugin in process plugin
Ingroup: modules
Module: kdb
At: ../src/libs/elektra/mount.c:301
Reason: list
Mountpoint: system/elektra/mountpoints
Configfile: kdbOpen(): mountGlobals
Warning (#139):
Description: failed to mount global plugins
Ingroup: kdb
Module:
At: ../src/libs/elektra/kdb.c:309
Reason: Mounting global plugins failed
Mountpoint: system/elektra/mountpoints
Configfile: kdbOpen(): mountGlobals
.
Thank you for reporting this problem!
The plugin list currently needs to be a part of PLUGINS because it is hard-coded in elektraDefaultGlobalConfig (mount.c 315)
We probably should fail in src/plugins/CMakeLists.txt line 70 if list is not part of ADDED_PLUGINS.
The plugin
listcurrently needs to be a part of PLUGINS because it is hard-coded in elektraDefaultGlobalConfig (mount.c 315)
Thank you for the quick and very helpful response.
We probably should fail in src/plugins/CMakeLists.txt line 70 if list is not part of ADDED_PLUGINS.
I added this check to PR #1940.
I added the list plugin to the build configuration, but it seems like spec is also required? At least kdb get user/does/not/exist now prints the following message:
Did not find key 'user/does/not/exist'
Sorry, 1 warning was issued ;(
Warning (#1):
Description: could not load module, dlopen failed
Ingroup: modules
Module: dl
At: ../src/libs/loader/dl.c:89
Reason: of module: libelektra-spec.so, because: dlopen(libelektra-spec.so, 2): image not found
Mountpoint: user/does/not/exist
Configfile: /Users/rene/.config/default.ecf
.
Yes, you are absolutely right: within elektraDefaultGlobalConfig we also refer to the spec plugin.
Unfortunately spec does not compile on elektra-gcc-configure-mingw-w64 since MinGW does not provide the header file fnmatch.h.
Should we
spec plugin to build Elektra, orelektra-gcc-configure-mingw-w64? Another option would be to use an fnmatch replacement on Windows.
Yet another option might be to just not require the spec plugin on Windows and use a macro to only enable the lines
keyNew ("system/elektra/globalplugins/postcommit/user/plugins", KEY_VALUE, "", KEY_END),
keyNew ("system/elektra/globalplugins/postcommit/user/plugins/#0", KEY_VALUE, "spec", KEY_END),
keyNew ("system/elektra/globalplugins/postcommit/user/plugins/#0/placements", KEY_VALUE, "spec", KEY_END),
keyNew ("system/elektra/globalplugins/postcommit/user/plugins/#0/placements/get", KEY_VALUE, "postgetstorage", KEY_END),
keyNew ("system/elektra/globalplugins/postcommit/user/plugins/#0/placements/set", KEY_VALUE, "presetstorage", KEY_END),
in mount.c on non-Windows systems. I just pushed a commit that uses this approach.