Ticket #58 (closed defect: fixed)

Opened 6 years ago

Last modified 22 months ago

internal Haddock or GHC error with --source-entity arg

Reported by: NeilMitchell Owned by:
Priority: major Milestone:
Version: Keywords:
Cc:

Description

Bug reported on the Hoogle bug tracker (http://code.google.com/p/ndmitchell/issues/detail?id=95) which is really a Haddock bug. See Haddock.Backends.HTML for where the error is being thrown from.

What steps will reproduce the problem?
1. src/darcs$ haddock --ignore-all-exports --optghc=-I. --optghc=-I./src
--optghc=-i./src -B `ghc --p\
rint-libdir` -o api-doc -h --source-base=../src
--source-module=../src/%M.lhs --source-entity=../src/%M.lhs  src/darcs.lhs
 haddock --ignore-all-exports --optghc=-I. --optghc=-I./src
--optghc=-i./src -B `ghc --print-libdir` -o api-doc -h --sourc\
e-base=../src --source-module=../src/%M.lhs
--source-entity='../src/%M.lhs#%N'  src/darcs.lhs    # (similar to darcs'
make api-doc)
2.
3.

What is the expected output? What do you see instead?
Expected success, got output ending with:

haddock: internal Haddock or GHC error: This shouldn't happen (topDeclBox)


What version of the product are you using? On what operating system?
(Saying "latest" is fine, especially for Hoogle web search)
Latest, ubuntu hardy.

Please provide any additional information below.
I am sm on irc.freenode.net.

Change History

Changed 6 years ago by waern

  • status changed from new to closed
  • resolution set to fixed
  • milestone set to 2.3.0

This has been fixed in the darcs version.

Changed 6 years ago by Dominic.Steinitz@…

  • status changed from closed to reopened
  • resolution fixed deleted
  • milestone changed from 2.3.0 to 2.5.0

I still get errors with ignore-exports. Here's an example:

{-# OPTIONS_HADDOCK ignore-exports #-}
-----------------------------------------------------------------------------
-- |
-- Module      : HaddockBug
--
-- Copyright   : TBD
-- License     : TBD
--
-- Maintainer  : A N Other
-- Stability   : TBD
--
-- Export some functions but not all
--
-----------------------------------------------------------------------------

module HaddockBug (exportThis) where

exportThis :: String
exportThis = "Export This"

dontExportThis :: String
dontExportThis = "Don\'t Export This"

../ThirdParty/bin/haddock.exe HaddockBug.hs --optghc=-cpp --optghc=-package=base-3.0.3.0 --html --od
ir=HaddockDocs -tFPF \
--read-interface=http://www.haskell.org/ghc/docs/6.10.1/html/libraries/haskell98,..\ThirdParty\ghc\g
hc-6.10.1\doc\libraries\haskell98\haskell98.haddock \
--read-interface=http://www.haskell.org/ghc/docs/6.10.1/html/libraries/random,..\ThirdParty\ghc\ghc-
6.10.1\doc\libraries\random\random.haddock \
--read-interface=http://www.haskell.org/ghc/docs/6.10.1/html/libraries/mtl,..\ThirdParty\ghc\ghc-6.1
0.1\doc\libraries\mtl\mtl.haddock \
--read-interface=http://www.haskell.org/ghc/docs/6.10.1/html/libraries/ghc-prim,..\ThirdParty\ghc\gh
c-6.10.1\doc\libraries\ghc-prim\ghc-prim.haddock \
--read-interface=http://www.haskell.org/ghc/docs/6.10.1/html/libraries/containers,..\ThirdParty\ghc\
ghc-6.10.1\doc\libraries\containers\containers.haddock \
--read-interface=http://www.haskell.org/ghc/docs/6.10.1/html/libraries/base,..\ThirdParty\ghc\ghc-6.
10.1\doc\libraries\base\base.haddock \
--source-entity=../HsColourDocs/%M.html\#%N
Warning: main:HaddockBug: could not find link destinations for:
    HaddockBug.dontExportThis
haddock: internal Haddock or GHC error: src\Haddock\Backends\Html.hs:1744:8-30: Irrefutable pattern
failed for pattern Haddock.DocName.Documented n mod

make: *** [HaddockBug.html] Error 1

Changed 6 years ago by Dominic.Steinitz@…

I should have added version details.

..\ThirdParty\bin\haddock.exe --version
Haddock version 2.4.1, (c) Simon Marlow 2006
Ported to use the GHC API by David Waern 2006-2008

Changed 6 years ago by waern

  • milestone changed from 2.5.0 to 2.4.2

Changed 5 years ago by waern

  • status changed from reopened to closed
  • resolution set to fixed

I think this was fixed by this patch:

Make visible names from ExportItems
David Waern <david.waern@gmail.com>**20081208231948
 
 Instead of a complicated calculation of visible names out of GHC's export
 items, we can get them straight out of the already calculated ExportItems.  The
 ExportItems should represent exactly those items that are visible in an
 interface. 
 
 If store all the exported sub-names in ExportDecl instead of only those with
 documentation, the calculation becomes very simple. So we do this change as
 well (should perhaps have been a separate patch).
  
 This should fix the problem with names from ghc-prim not appearing in the link
 environment.

I tried your example, and it worked.

Changed 22 months ago by anonymous

  • milestone 2.4.2 deleted

Milestone 2.4.2 deleted

Note: See TracTickets for help on using tickets.