Ticket #1093 (closed bug: fixed)

Opened 6 years ago

Last modified 4 years ago

Windows: haddock-html fields are wrong in package.conf

Reported by: simonmar Owned by: igloo
Priority: high Milestone: 6.8.1
Component: Build System Version: 6.6.1
Keywords: Cc:
Operating System: Windows Architecture: Unknown/Multiple
Type of failure: Difficulty: Easy (less than 1 hour)
Test Case: Blocked By:
Blocking: Related Tickets:

Description

$ c:/ghc/ghc-6.6/bin/ghc-pkg field network haddock-html
haddock-html: $topdir\html\libraries\network

it should be

haddock-html: $topdir\doc\html\libraries\network

Note the "doc\".

After #937 is fixed, this is still preventing "setup haddock" from working in Cabal on Windows.

Change History

Changed 6 years ago by igloo

  • owner set to igloo

Changed 6 years ago by igloo

I can't reproduce the problem - everything seems to not use doc/ in both the 6.6 branch and the HEAD.

However, there are a couple of issues outstanding. Here base was built as part of the GHC build process while mtl was built with cabal; note the varying number of '\'s and quotes in one case only:

$ ~/ghc/darcs/build/inst/bin/ghc-pkg field base haddock-html
haddock-html: C:/cygwin/home/ian/ghc/darcs/build/inst\html\libraries\base
$ ~/ghc/darcs/build/inst/bin/ghc-pkg field mtl haddock-html
haddock-html: "C:\\Program Files\\Common Files\\mtl-1.0\\doc\\html"

Trying to ./Setup haddock a package that uses mtl gives

Warning: cannot use package mtl-1.0:
   HTML directory "C:\\Program Files\\Common Files\\mtl-1.0\\doc\\html" does not exist.

but

$ ls 'c:\Program Files\Common Files\mtl-1.0\doc\html\'
Control-Monad-Cont.html      Control-Monad-State.html   haskell_icon.gif
...

I'm not sure why the docs are going there at all, given I gave cabal a prefix when configuring.

Finally, just a note that a darcs version of haddock is necessary as 0.8 doesn't strip line endings correctly.

Changed 6 years ago by simonmar

I suspect Sigbjorn rearranges the files in the distribution. If that's correct, then the haddock-html fields also need to be modified.

I don't know about the backslash vs. fwdslash issues, but I do know why your docs are ending up in C:/Program Files/Common Files/...:

http://www.haskell.org/ghc/docs/latest/html/Cabal/builders.html#setup-configure-paths

Currently docs are installed under $datadir, which on Windows defaults to an absolute location obtained by querying the OS. Seems to me it would be better to make this relative to $prefix, I think it was Neil Mitchell who suggested the current scheme.

Changed 6 years ago by igloo

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

The filename problems turns out to be this:

The haddock-html field is ultimately printed out by:

showFilePath :: FilePath -> Doc
showFilePath = showToken

showToken :: String -> Doc
showToken str
 | not (any dodgy str) &&
   not (null str)       = text str
 | otherwise            = text (show str)
  where dodgy c = isSpace c || c == ','

Thus when haddock asks ghc-pkg for the haddock-html field and the path contains spaces, it doesn't get a plain path back like it expects. It then checks to see if the mangled path exists, which it doesn't.

I think the right way to fix this would be to have a ghc-pkg flag that gives more machine understandable output. However, as I assume haddock-ghc will not have this problem I'm going to close this bug; we might want to open a new one for a machine-understandable flag to ghc-pkg anyway.

I've opened bugs in Cabal for a couple of issues that came up:  http://hackage.haskell.org/trac/hackage/ticket/115  http://hackage.haskell.org/trac/hackage/ticket/116

Changed 6 years ago by simonmar

  • priority changed from normal to high
  • status changed from closed to reopened
  • version changed from 6.6 to 6.6.1
  • resolution fixed deleted
  • milestone changed from 6.6.1 to 6.8

This is still a bug in the Windows distribution of GHC:

> ghc-pkg field base haddock-html
haddock-html: c:/ghc/ghc-6.6.1\html\libraries\base

The actual path to the HTML is c:\ghc\ghc-6.6.1\doc\html\...

This happens because prep-bin-dist-mingw moves the docs under doc\, but we don't take this into account when registering the packages.

Changed 6 years ago by igloo

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

Fixed; prep-bin-dist-mingw no longer touches the docs.

Changed 6 years ago by igloo

  • milestone changed from 6.8 branch to 6.8.1

Changed 5 years ago by simonmar

  • architecture changed from Unknown to Unknown/Multiple

Changed 4 years ago by simonmar

  • difficulty changed from Easy (1 hr) to Easy (less than 1 hour)
Note: See TracTickets for help on using tickets.