commercialhaskell / stack

The Haskell Tool Stack
http://haskellstack.org
BSD 3-Clause "New" or "Revised" License
3.99k stars 845 forks source link

stack haddock ignores the dependencies of test suites and executables #2620

Open UnkindPartition opened 8 years ago

UnkindPartition commented 8 years ago

General summary/comments (optional)

stack haddock generates the documentation for the dependencies of the library component, but not of the executable or test components.

Steps to reproduce

  1. Create a cabal package where some packages are required by the executable or test but not the library
  2. Run stack haddock

    Expected

If I go to the doc index (.stack-work/install/x86_64-linux/lts-7.0/8.0.1/doc/all/index.html), I expect to see the executables and test suite dependencies docs.

Actual

They're not there.

Stack version

$ stack --version
Version 1.2.1, Git revision f28002bdea51468566fd9370f7f9e801c2b51bc5 (4141 commits) x86_64 hpack-0.14.1

Method of installation

Built from git.

mgsloan commented 8 years ago

Duplicate of https://github.com/commercialhaskell/stack/issues/729 , I agree it should be fixed. PRs appreciated!

UnkindPartition commented 8 years ago

I've seen #729, but I think it's mostly unrelated, albeit similar. It talks about generating haddocks for the executable code. I'm talking about generating haddocks for libraries that are dependencies of executables, tests, and benchmarks.

In particular, I feel like the dependencies for all components should be treated uniformly by stack haddock. I shouldn't have to say --executables to generate the docs for executable deps. Also, I doubt there are going to be similar switches for test and benchmark code, but having the docs for their dependencies is just as important.

mgsloan commented 8 years ago

I see! Thanks for the clarification @feuerbach !

MaxGabriel commented 6 years ago

Just ran into this, and wanted to add in case anyone else is googling this, that this means stack hoogle also won't work for e.g. hspec functions.