Configure Elektra
mkdir build
cd build
cmake -GNinja -DBINDINGS="ALL;haskell" ..
Build Elektra
ninja
Run Haskell tests
ctest -V -R 'haskell'
All tests work without any problems
UpdateCTestConfiguration from :build/DartConfiguration.tcl
Parse Config file:build/DartConfiguration.tcl
UpdateCTestConfiguration from :build/DartConfiguration.tcl
Parse Config file:build/DartConfiguration.tcl
Test project build
Constructing a list of tests
Done constructing a list of tests
Updating test list for fixtures
Added 0 tests to meet fixture requirements
Checking test dependency graph...
Checking test dependency graph end
test 32
Start 32: testhaskell_cabal
32: Test command: /usr/local/bin/cabal "test" "libelektra-haskell-test" "libelektra-haskell-test-optimized"
32: Test timeout computed to be: 1500
32: Resolving dependencies...
32: Configuring libelektra-haskell-0.8.19...
32: cabal: Missing dependencies on foreign libraries:
32: * Missing C libraries: elektra, elektra, elektra, elektra
32: This problem can usually be solved by installing the system packages that
32: provide these libraries (you may need the "-dev" versions). If the libraries
32: are already installed but in a non-standard location then you can use the
32: flags --extra-include-dirs= and --extra-lib-dirs= to specify where they are.
1/2 Test #32: testhaskell_cabal ................***Failed 2.37 sec
test 33
Start 33: testhaskell_realworld_cabal
33: Test command: /usr/local/bin/cabal "test" "libelektra-haskell-test-realworld" "libelektra-haskell-test-realworld-optimized"
33: Test timeout computed to be: 1500
33: Preprocessing library for libelektra-haskell-0.8.19..
33: Building library for libelektra-haskell-0.8.19..
33: [1 of 4] Compiling Elektra.Key ( dist/build/Elektra/Key.hs, dist/build/Elektra/Key.o )
33: [2 of 4] Compiling Elektra.KeySet ( dist/build/Elektra/KeySet.hs, dist/build/Elektra/KeySet.o )
33: [3 of 4] Compiling Elektra.KDB ( dist/build/Elektra/KDB.hs, dist/build/Elektra/KDB.o )
33: [4 of 4] Compiling Elektra.Plugin ( dist/build/Elektra/Plugin.hs, dist/build/Elektra/Plugin.o )
33: Preprocessing test suite 'libelektra-haskell-test-realworld' for libelektra-haskell-0.8.19..
33: Building test suite 'libelektra-haskell-test-realworld' for libelektra-haskell-0.8.19..
33: [1 of 1] Compiling Main ( src/bindings/haskell/test/ElektraRealWorld.hs, dist/build/libelektra-haskell-test-realworld/libelektra-haskell-test-realworld-tmp/Main.o )
33: Linking dist/build/libelektra-haskell-test-realworld/libelektra-haskell-test-realworld ...
33: ld: library not found for -lelektra
33: clang: error: linker command failed with exit code 1 (use -v to see invocation)
33: `clang' failed in phase `Linker'. (Exit code: 1)
2/2 Test #33: testhaskell_realworld_cabal ......***Failed 4.21 sec
0% tests passed, 2 tests failed out of 2
Label Time Summary:
bindings = 6.58 sec (2 tests)
kdbtests = 4.21 sec (1 test)
Total Test time (real) = 6.60 sec
The following tests FAILED:
32 - testhaskell_cabal (Failed)
33 - testhaskell_realworld_cabal (Failed)
Errors while running CTest
Resolving dependencies...
Configuring libelektra-haskell-0.8.19...
cabal: Missing dependencies on foreign libraries:
* Missing C libraries: elektra, elektra, elektra, elektra
This problem can usually be solved by installing the system packages that
provide these libraries (you may need the "-dev" versions). If the libraries
are already installed but in a non-standard location then you can use the
flags --extra-include-dirs= and --extra-lib-dirs= to specify where they are.
Start 34: testhaskell_realworld_cabal
34/158 Test #34: testhaskell_realworld_cabal ..............***Failed 2.23 sec
Preprocessing library for libelektra-haskell-0.8.19..
Building library for libelektra-haskell-0.8.19..
Preprocessing test suite 'libelektra-haskell-test-realworld' for libelektra-haskell-0.8.19..
Building test suite 'libelektra-haskell-test-realworld' for libelektra-haskell-0.8.19..
[1 of 1] Compiling Main ( /Users/travis/build/ElektraInitiative/libelektra/src/bindings/haskell/test/ElektraRealWorld.hs, dist/build/libelektra-haskell-test-realworld/libelektra-haskell-test-realworld-tmp/Main.o )
Linking dist/build/libelektra-haskell-test-realworld/libelektra-haskell-test-realworld ...
ld: library not found for -lelektra
clang: error: linker command failed with exit code 1 (use -v to see invocation)
`clang' failed in phase `Linker'. (Exit code: 1)
HASKELL TESTS
==================
test basics
There are 1 warnings
buffer is: warnings/#00
number: 1
description: could not load module, dlopen failed
ingroup: modules
module: dl
file: /Users/travis/build/ElektraInitiative/libelektra/src/libs/loader/dl.c
line: 88
reason: of module: libelektra-haskelltemplate.so, because: dlopen(libelektra-haskelltemplate.so, 130): image not found
reason:
reason:
/Users/travis/build/ElektraInitiative/libelektra/src/plugins/haskell/testmod_haskell.c:23: error in test_basics: warnings in kdbOpen for plugin haskelltemplate
/Users/travis/build/ElektraInitiative/libelektra/src/plugins/haskell/testmod_haskell.c:23: fatal in test_basics: could not open haskelltemplate plugin
Thank you for reporting this issue!
We should also reconsider if we need a separate travis build job just for haskell. Was it only added because of this issue?
We should also reconsider if we need a separate travis build job just for haskell. Was it only added because of this issue?
Yes. Since some of the macOS build jobs already time out occasionally, I added an extra build job that only installs the dependencies of the Haskell binding/plugin. I fear, if we really install Haskell in the regular macOS build, then the build job will not finish in time anymore.
Is this fixed?
Otherwise I would suggest to remove it from the 0.8.21 milestone due its low priority.
Is this fixed?
As far as I can tell, yes. At least the tests work on my local machine.
I'd say almost. I still see some linking-related issue when running kdb run_all which i haven't fixed so far, calling the tests from the build directory works fine. But yes it shouldn't block this milestone and should be fine for 0.8.22 also, as the bindings are still tagged as experimental.
... this should all be done in the meanwhile, primarily fixed in #1698 and #1784 and #1787
Thank you for cleaning up the issues!