Opened 9 years ago

Closed 9 years ago

#4510 closed bug (worksforme)

No links will be generated to these packages: base-4.3.0.0

Reported by: claus Owned by: igloo
Priority: high Milestone: 7.2.1
Component: Compiler Version: 7.0.1
Keywords: Cc:
Operating System: Windows Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description

As reported earlier, (point 6. in #4292), running haddock (via cabal) leads to missing documentation links. This was assumed fixed (comment:4:ticket:4292), but apparently not tested - the problem still exists (to reproduce, cabal-install anything that uses base types in its documentation, on top of a 7.0.1 windows install, with documentation enabled). As I can't see similar failures in hackage build reports, I guess the issue is Windows-specific.

From bug report to guessing at causes:

My current best bet is the occurrence of unescaped backslashes in filepaths in ghc-pkg fields (I seem to recall an implicit contract that these fields are supposed to be valid Haskell Strings?). As a general remark, using forward-slashes seems to be less error-prone.

Cabal (which generates these warnings, in Distribution/Simple/Haddock.hs) seems to parse these fields as Haskell Strings, and fails when doesFileExist can't find the .haddock interface file.

haddock-interfaces: $topdir/../doc/html/libraries/base-4.3.0.0\base.haddock

There are other fields in ghc-pkg output that have unescaped backslashes in file names (the *-dirs family), so apparently the Haskell String contract is just my imagination?

Change History (7)

comment:1 Changed 9 years ago by claus

I tried changing the base...conf file in lib/package.conf.d, followed by a ghc-pkg recache.

$ ghc-pkg field base haddock-interfaces,haddock-html
haddock-interfaces: c:/haskell/ghc/ghc-7.0.1/doc/html/libraries/base-4.3.0.0/base.haddock
haddock-html: c:/haskell/ghc/ghc-7.0.1/doc/html/libraries/base-4.3.0.0

That made no difference at all..

I then tried procmon (systools' process monitor), which claims that for cabal-0.8.2.exe haddock (within a current haddock darcs repo), the only base-4.3.0.0-related file access until the error message was to

C:\haskell\ghc\doc\html\libraries\base-4.3.0.0\

which, of course, does not exist.

Before my changes, the expanded paths were (possibly with a backslash before base.haddock)

$ ghc-pkg field base haddock-interfaces,haddock-html
haddock-interfaces: C:/haskell/ghc/ghc-7.0.1\lib/../doc/html/libraries/base-4.3.0.0/base.haddock
haddock-html: C:/haskell/ghc/ghc-7.0.1\lib/../doc/html/libraries/base-4.3.0.0

comment:2 Changed 9 years ago by igloo

Milestone: 7.0.2
Owner: set to igloo
Priority: normalhigh

Thanks for the report. I'll try to take a look for 7.0.2.

comment:3 Changed 9 years ago by igloo

I can't reproduce this; are you doing anything different?:

$ cabal install --enable-documentation mtl
[...]
Running Haddock for mtl-2.0.1.0...
Preprocessing library mtl-2.0.1.0...
Warning: The documentation for the following packages are not installed. No
links will be generated to these packages: ffi-1.0, rts-1.0
Documentation created: .\.\dist\doc\html\mtl\.\index.html
Installing library in C:\Documents and Settings\ian\Application
Data\cabal\mtl-2.0.1.0\ghc-7.0.1
Registering mtl-2.0.1.0...
Updating documentation index C:\Documents and Settings\ian\Application
Data\cabal\doc\index.html
$ ghc-pkg dump | grep "haddock.*base"
haddock-interfaces: $topdir/../doc/html/libraries/base-4.3.0.0\base.haddock
haddock-html: $topdir/../doc/html/libraries/base-4.3.0.0

$ ghc-pkg field base haddock-interfaces
haddock-interfaces: C:/ghc/ghc-7.0.1\lib/../doc/html/libraries/base-4.3.0.0\base.haddock

$ ghc-pkg field base haddock-html
haddock-html: C:/ghc/ghc-7.0.1\lib/../doc/html/libraries/base-4.3.0.0
$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.0.1

$ cabal --version
cabal-install version 0.8.2
using version 1.8.0.6 of the Cabal library 

comment:4 Changed 9 years ago by claus

Here's my version:

$ cabal install mtl
[..]
Running Haddock for mtl-2.0.1.0...
Preprocessing library mtl-2.0.1.0...
Warning: The documentation for the following packages are not installed. No
links will be generated to these packages: base-4.3.0.0, ffi-1.0, rts-1.0,
ghc-prim-0.2.0.0, integer-gmp-0.2.0.2
Warning: mtl-2.0.1.0:Control.Monad.Identity: Could not find documentation for exported module: Control.Monad
Warning: mtl-2.0.1.0:Control.Monad.Identity: Could not find documentation for exported module: Control.Monad.Fix
[..]
Warning: Control.Monad.Writer.Class: could not find link destinations for:
    Data.Monoid.Monoid GHC.Base.Monad
Warning: Control.Monad.State.Class: could not find link destinations for:
    GHC.Base.Monad Data.Monoid.Monoid
Warning: Control.Monad.Reader.Class: could not find link destinations for:
    GHC.Base.Monad Data.Monoid.Monoid
[..]
Documentation created: .\.\dist\doc\html\mtl\.\index.html
$ ghc-pkg.exe dump | grep "haddock.*/base"
haddock-interfaces: $topdir/../doc/html/libraries/base-4.3.0.0/base.haddock
haddock-html: $topdir/../doc/html/libraries/base-4.3.0.0

$ ghc-pkg.exe field base haddock-interfaces,haddock-html
haddock-interfaces: c:/haskell/ghc/ghc-7.0.1\lib/../doc/html/libraries/base-4.3.0.0/base.haddock
haddock-html: c:/haskell/ghc/ghc-7.0.1\lib/../doc/html/libraries/base-4.3.0.0
$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.0.1

$ cabal-0.8.2.exe --version
cabal-install version 0.8.2
using version 1.8.0.2 of the Cabal library

The only difference I can see (apart from the whole thing not working for me) is that we're using the same cabal-install, but different Cabal library versions (I doubt it matters, but my machine is running Windows 7, 64bit).

I tried cabal install cabal-install, to see whether that would make any difference, but that turned out to be a very bad idea - not only did it break my package database by reinstalling core libraries (I thought only the old upgrade would try that?), it also failed to build directory, as it couldn't find HsFFI.h (has that not been fixed multiple times already?). Will have to resurrect my ghc-7.0.1 install, I guess.

comment:5 Changed 9 years ago by igloo

Milestone: 7.0.27.2.1

comment:6 Changed 9 years ago by igloo

Status: newinfoneeded

Claus, having fixed your installation, are you still able to reproduce this?

comment:7 Changed 9 years ago by igloo

Resolution: worksforme
Status: infoneededclosed
Note: See TracTickets for help on using tickets.