alexwl / haskell-code-explorer

Web application for exploring and understanding Haskell codebases
MIT License
509 stars 20 forks source link

Problem indexing xeno package #3

Closed qrilka closed 5 years ago

qrilka commented 5 years ago

It fails with the following message:

$ stack exec -- haskell-code-indexer -p ../xeno
2018-10-05 00:33:44.493431958 MSK : [info] haskell-code-indexer version 0.1.0.0, GHC version 8.2.2.0
cabal-helper-wrapper: /home/qrilka/ws/h/xeno/.stack-work/dist/x86_64-linux-tinfo6/Cabal-2.0.1.0/setup-config: openFile: does not exist (No such file or directory)
2018-10-05 00:33:44.688234312 MSK : [error] readCreateProcess: /home/qrilka/ws/h/haskell-code-explorer/.stack-work/install/x86_64-linux-tinfo6/lts-11.3/8.2.2/libexec/x86_64-linux-ghc-8.2.2/cabal-helper-0.8.0.2/cabal-helper-wrapper "--with-ghc=ghc" "--with-ghc-pkg=ghc-pkg" "--with-cabal=cabal" "/home/qrilka/ws/h/haskell-code-explorer/../xeno" ".stack-work/dist/x86_64-linux-tinfo6/Cabal-2.0.1.0" "package-db-stack" "flags" "compiler-version" "ghc-merged-pkg-options" "config-flags" "non-default-config-flags" "ghc-src-options" "ghc-pkg-options" "ghc-lang-options" "ghc-options" "source-dirs" "entrypoints" "needs-build-output" (exit 1): failed

The output of that command could be found at https://gist.github.com/qrilka/422fefa3208bb94e7d1093bf450f6116

alexwl commented 5 years ago

It seems that file /home/qrilka/ws/h/xeno/.stack-work/dist/x86_64-linux-tinfo6/Cabal-2.0.1.0/setup-config doesn't exist. Does the directory /home/qrilka/ws/h/xeno/.stack-work/dist/x86_64-linux-tinfo6/Cabal-2.0.1.0/ exist?

Can you execute the command stack path --dist-dir in a directory with the source code of xeno package? stack path --dist-dir returns relative path of a dist-dir where setup-config file should be. (For example, I installed xeno-0.3.4 on my machine and the dist-dir is .stack-work/dist/x86_64-linux/Cabal-2.0.1.0).

Then you can try to add --dist option to haskell-code-indexer: stack exec -- haskell-code-indexer -p ../xeno --dist DIST_DIR

qrilka commented 5 years ago

You're right, that was the case. Running stack build on the project fixed the problem. I think it's worth to document this requirement.

hasufell commented 5 years ago

That doesn't sound like a reasonable requirement to force everyone to use stack.

alexwl commented 5 years ago

Stack is not a requirement. It is possible to index packages built by cabal-install (cabal). You need Stack only to build haskell-code-indexer and haskell-code-server.