Skip to content
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

stack haddock: Wrong index for package with sublibraries #5254

Open
hpdeifel opened this issue Apr 9, 2020 · 2 comments
Open

stack haddock: Wrong index for package with sublibraries #5254

hpdeifel opened this issue Apr 9, 2020 · 2 comments

Comments

@hpdeifel
Copy link

hpdeifel commented Apr 9, 2020

Steps to reproduce

For example:

  1. git clone https://git8.cs.fau.de/software/copar.git
  2. stack haddock --open copar:lib

Expected

Stack generates haddocks for the unnamed library component in the cabal file and creates an index for that.

Actual

Stack generates and shows the index for a random internal library instead of the main (exposed) one. Judging from the output, it actually generates the index for the main library but then insists to generate haddocks for the other library as well and overwrites the first index.

Stack version

$ stack --version
Version 2.1.3, Git revision 636e3a759d51127df2b62f90772def126cdf6d1f (7735 commits) x86_64 hpack-0.31.2

Method of installation

  • Official binary, downloaded from stackage.org or fpcomplete's package repository
@kostmo
Copy link

kostmo commented Jan 2, 2024

I also encountered this bug using version 2.13.1 of stack.

@mpilgrem
Copy link
Member

mpilgrem commented Jan 2, 2024

@hpdeifel, @kostmo, thanks for reporting. This appears to me to be a bug/defect in Cabal (the library):

(a) the key part of Stack's code is (Stack.Build.Execute.singleBuild, extracts only)

    when (doHaddock mcurator package) $ do
      announce $ if isHaddockForHackage
        then "haddock for Hackage"
        else "haddock"
      ...
      fulfillHaddockExpectations mcurator $ \keep -> do
        let args = ...        
        cabal0 keep KeepTHLoading $ "haddock" : args -- << This is Stack calling Cabal for the package

and;

(b) there are the gaps in the checklist at haskell/cabal#5660, and the related issues.

@mpilgrem mpilgrem changed the title stack haddock: Wrong index for project with internal libraries stack haddock: Wrong index for package with sublibraries Jan 2, 2024
mergify bot pushed a commit to swarm-game/swarm that referenced this issue Jan 3, 2024
Encountered this bug: commercialhaskell/stack#5254 (comment)

Fixed by using `cabal` to generate haddocks instead of `stack`.
Also bumped `cabal-version` to latest and adjusted `swarm.cabal` to conform.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants