New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build Fails If Cabal is Installed #1616

Closed
sanssecours opened this Issue Oct 6, 2017 · 3 comments

Comments

Projects
None yet
3 participants
@sanssecours
Contributor

sanssecours commented Oct 6, 2017

Steps to Reproduce

  1. Install Cabal via Homebrew

    brew install cabal-install
  2. Create the build system

    mkdir -p build
    cd build; cmake ..                                 \
          -GNinja                                      \
          -DENABLE_ASAN=OFF                            \
          -DENABLE_LOGGER=ON                           \
          -DENABLE_DEBUG=ON                            \
          -DCMAKE_EXPORT_COMPILE_COMMANDS=ON           \
          -DBUILD_DOCUMENTATION=OFF                    \
          -DBUILD_DOCSET=OFF                           \
          -DBUILD_PDF=OFF                              \
          -DPDFLATEX_COMPILER=`which latexmk`          \
          -DPDFLATEX_COMPILER_OPTIONS='-pdf;-f;-quiet' \
          -DCMAKE_PREFIX_PATH=/usr/local/opt/qt5       \
          -DTOOLS="ALL"                                \
          -DBINDINGS="ALL;-swig_python2;-swig_ruby"    \
          -DPLUGINS="ALL;-jni;-python2;-lua"

Expected Result

CMake configures the project without any problems.

Actual Result

CMake prints the following error message:

CMake Error at cmake/Modules/LibAddPlugin.cmake:393 (add_dependencies):
  The dependency target "c2hs_haskell" of target "elektra-haskell" does not
  exist.
Call Stack (most recent call first):
  cmake/Modules/LibAddHaskellPlugin.cmake:141 (add_plugin)
  src/plugins/haskell/CMakeLists.txt:3 (add_haskell_plugin)


CMake Error at cmake/Modules/LibAddPlugin.cmake:353 (add_dependencies):
  The dependency target "c2hs_haskell" of target "elektra-haskell-objects"
  does not exist.
Call Stack (most recent call first):
  cmake/Modules/LibAddHaskellPlugin.cmake:141 (add_plugin)
  src/plugins/haskell/CMakeLists.txt:3 (add_haskell_plugin)

.

System Information

  • Elektra Version: master
  • OS: macOS 10.13
@markus2330

This comment has been minimized.

Show comment
Hide comment
@markus2330

markus2330 Oct 6, 2017

Contributor

Thank you for reporting this problem!

@e1528532 could you please fix it?

Contributor

markus2330 commented Oct 6, 2017

Thank you for reporting this problem!

@e1528532 could you please fix it?

@markus2330

This comment has been minimized.

Show comment
Hide comment
@markus2330

markus2330 Oct 10, 2017

Contributor

I get the error:

 CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
 Please set them or make sure they are set and tested correctly in the CMake files:
 GHC_FFI_LIB
     linked by target "elektra-haskell" in directory /home/markus/Projekte/Elektra/current/src/plugins/haskell
     linked by target "testmod_haskell" in directory /home/markus/Projekte/Elektra/current/src/plugins
 GHC_RTS_LIB
     linked by target "elektra-haskell" in directory /home/markus/Projekte/Elektra/current/src/plugins/haskell
     linked by target "testmod_haskell" in directory /home/markus/Projekte/Elektra/current/src/plugins

And we should tag all the GHC_ cmake variables as INTERNAL.

Contributor

markus2330 commented Oct 10, 2017

I get the error:

 CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
 Please set them or make sure they are set and tested correctly in the CMake files:
 GHC_FFI_LIB
     linked by target "elektra-haskell" in directory /home/markus/Projekte/Elektra/current/src/plugins/haskell
     linked by target "testmod_haskell" in directory /home/markus/Projekte/Elektra/current/src/plugins
 GHC_RTS_LIB
     linked by target "elektra-haskell" in directory /home/markus/Projekte/Elektra/current/src/plugins/haskell
     linked by target "testmod_haskell" in directory /home/markus/Projekte/Elektra/current/src/plugins

And we should tag all the GHC_ cmake variables as INTERNAL.

@markus2330

This comment has been minimized.

Show comment
Hide comment
@markus2330

markus2330 Oct 10, 2017

Contributor

As quick workaround, something like:

diff --git a/src/plugins/haskell/CMakeLists.txt b/src/plugins/haskell/CMakeLists.txt
index 65545f5..3659b6e 100644
--- a/src/plugins/haskell/CMakeLists.txt
+++ b/src/plugins/haskell/CMakeLists.txt
@@ -1,3 +1,13 @@
 include (LibAddHaskellPlugin)
 
+if (GHC_FFI_LIB)
+if (GHC_RTS_LIB)
+
 add_haskell_plugin (haskell)
+
+else (GHC_RTS_LIB)
+       remove_plugin (haskell "GHC_RTS_LIB not found")
+endif (GHC_RTS_LIB)
+else (GHC_FFI_LIB)
+       remove_plugin (haskell "GHC_FFI_LIB not found")
+endif (GHC_FFI_LIB)

might be useful. For a real fix we need a proper check if haskell+binding is available.

Contributor

markus2330 commented Oct 10, 2017

As quick workaround, something like:

diff --git a/src/plugins/haskell/CMakeLists.txt b/src/plugins/haskell/CMakeLists.txt
index 65545f5..3659b6e 100644
--- a/src/plugins/haskell/CMakeLists.txt
+++ b/src/plugins/haskell/CMakeLists.txt
@@ -1,3 +1,13 @@
 include (LibAddHaskellPlugin)
 
+if (GHC_FFI_LIB)
+if (GHC_RTS_LIB)
+
 add_haskell_plugin (haskell)
+
+else (GHC_RTS_LIB)
+       remove_plugin (haskell "GHC_RTS_LIB not found")
+endif (GHC_RTS_LIB)
+else (GHC_FFI_LIB)
+       remove_plugin (haskell "GHC_FFI_LIB not found")
+endif (GHC_FFI_LIB)

might be useful. For a real fix we need a proper check if haskell+binding is available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment