alexwl / haskell-code-explorer

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

Indexing stack sub-project fails to find dist directory #13

Closed pwaller closed 5 years ago

pwaller commented 5 years ago

I have a number of cabal packages which live within a stack project.

MyProjectFoo/stack.yaml
MyProjectFoo/MyProjectFoo.cabal
MyProjectFoo/bar/bar.cabal
MyProjectFoo/baz/baz.cabal

I'm new to Haskell, stack and cabal, so things are a little confusing. Indexing works fine on MyProjectFoo, but fails on the subprojects bar and baz because it fails to find the dist directory and setup-config.

In this issue I found that using --dist $(stack path --dist-dir) from the bar or baz directory works.

Would it be reasonable for the indexer to use this if there exists a stack.yaml at any level in the filesystem above the current working directory?

Moved from https://github.com/alexwl/haskell-code-explorer/issues/4#issuecomment-438203905.

alexwl commented 5 years ago

Yes, I think it would be reasonable to check for the presence of stack.yaml in the parent directories.

I will add that logic to haskell-code-indexer.