You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cabal (3.4.0) does not build documentation for ghci, even when
cabal build --enable-documentation
To Reproduce
cabal v2-build --enable-documentation
cabal v2-repl
Prelude Test.Util> import qualified Data.Vector as V
Prelude V Test.Util> :doc V.partition
ghc: Can't find any documentation for Data.Vector.
This is probably because the module was compiled without '-haddock',
but it's also possible that the module contains no documentation.
Expected behavior
obtain documentation, this used to work in previous versions?
System information
Build profile: -w ghc-8.8.4 -O1
linux debian
ghc, cabal from ghcup
Reacted by Julius Marozas, makeartandgames, Noah Luck Easterly and Daniel Wagner
All v2 commands except for configure are stateless, so you should either do cabal v2-repl --enable-documentation, or you can first do cabal v2-configure --enable-documentation, then cabal v2-repl
I can reproduce this or a similar issue like this:
$ cabal repl -b vector --enable-documentation
Resolving dependencies...
Build profile: -w ghc-9.0.1 -O1
In order, the following will be built (use -v for more details):
- primitive-0.7.1.0 (lib) (requires build)
- vector-0.12.2.0 (lib) (requires build)
- fake-package-0 (lib) (first run)
Starting primitive-0.7.1.0 (lib)
Building primitive-0.7.1.0 (lib)
Haddock primitive-0.7.1.0 (lib)
Installing primitive-0.7.1.0 (lib)
Completed primitive-0.7.1.0 (lib)
Starting vector-0.12.2.0 (lib)
Building vector-0.12.2.0 (lib)
Haddock vector-0.12.2.0 (lib)
Installing vector-0.12.2.0 (lib)
Completed vector-0.12.2.0 (lib)
Configuring library for fake-package-0..
Preprocessing library for fake-package-0..
Warning: No exposed modules
GHCi, version 9.0.1: https://www.haskell.org/ghc/ :? for help
Loaded GHCi configuration from /tmp/cabal-repl.-59300/setcwd.ghci
ghci> import qualified Data.Vector as V
ghci> :doc V.partition
ghc: Can't find any documentation for Data.Vector.
This is probably because the module was compiled without '-haddock',
but it's also possible that the module contains no documentation.
Try re-compiling with '-haddock'.
It's weird that the documentation can't be found, because it was apparently built.
Activity
fgaz commentedon Feb 26, 2021
All v2 commands except for configure are stateless, so you should either do
cabal v2-repl --enable-documentation, or you can first docabal v2-configure --enable-documentation, thencabal v2-reploivulf commentedon Feb 26, 2021
I tried cabal v2-repl --enable-documentation,
but the effect is the same, no documentation in the repl
sjakobi commentedon Mar 1, 2021
I can reproduce this or a similar issue like this:
It's weird that the documentation can't be found, because it was apparently built.
dmwit commentedon Apr 21, 2023
Thought I'd quickly mention a workaround for this. For packages that you are currently developing, you can request docs at
repltime:If you want docs available for dependencies, too, then as far as I can tell you must use a
cabal.project(or.local), but it is still possible:This is a full rebuild, so beware of adding or removing this chunk if you've already got the project built!