-
Notifications
You must be signed in to change notification settings - Fork 701
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
cabal new-haddock
produces no documentation for single module executables
#5890
Comments
The hasHaddocks = not (null (elabPkgDescription ^. componentModules name)) Arguably, it's the -- | Get all the module names from an exe
exeModules :: Executable -> [ModuleName]
exeModules exe = otherModules (buildInfo exe) Evidently, the function returns neither the main module name, nor the names of any generated modules. Using the componentModules :: Component -> [ModuleName]
-- TODO: Use of 'explicitLibModules' here is a bit wrong:
-- a user could very well ask to build a specific signature
-- that was inherited from other packages. To fix this
-- we have to plumb 'LocalBuildInfo' through this code.
-- Fortunately, this is only used by 'pkgComponentInfo'
-- Please don't export this function unless you plan on fixing
-- this.
-- [interestingly, there is a different comment D.C.TargetSelector]:
-- I think it's unlikely users will ask to build a requirement
-- which is not mentioned locally.
componentModules (CLib lib) = explicitLibModules lib
componentModules (CFLib flib) = foreignLibModules flib
componentModules (CExe exe) = exeModules exe
componentModules (CTest test) = testModules test
componentModules (CBench bench) = benchmarkModules bench which is the template used for defining Btw, it's not so easy to find the actual main module name. It's usually |
Me too, trying @phadej's example at:
leaves the HTML docs in
succeeds but does not produce any HTMLs. To Joe User, this is a regression. |
I'd say Whether this is a regression or not is semantics, but I hope we can agree that UX is bad. |
I don't think this is merely an issue with |
With the following .cabal file (and any Main.hs),
no documentation is produced by
cabal new-haddock --haddock-executables
. As soon as one adds at least one module to theother-modules
specification, documentation is generated, including the Main module.The text was updated successfully, but these errors were encountered: