[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: -doc in build depends!



Hi,

Am Freitag, den 15.04.2011, 19:05 +0530 schrieb Joachim Breitner:
> I have a vague feeling that we do not need to Build-Depend on the -doc
> files of the dependencies. I think haddock is creating the links
> “blindly”, only relying on the haddock-html field in the ghc-pkg data
> base, so having the .html and .haddock files available is not required. 
> 
> If someone has time to verify that, that would be great.
> 
> We would have to change the Recommends-list-generating code in
> haskell-devscripts, but it is safe to assume that for a link pointing
> to /usr/share/doc/<foo>/html, we can Recommend: <foo>. Maybe such code
> could be put in a separate script, as it is not really tied to Haskell. 

my vague feeling was wrong, Cabal checks whether the interface is
present before telling haddock to link to that package:

  interfaces <- sequence
    [ case interfaceAndHtmlPath ipkg of
        Nothing -> return (Left (packageId ipkg))
        Just (interface, html) -> do
          exists <- doesFileExist interface
          if exists
            then return (Right (interface, html))
            else return (Left (packageId ipkg))
    | ipkg <- PackageIndex.allPackages transitiveDeps ]

  let missing = [ pkgid | Left pkgid <- interfaces ]
      warning = "The documentation for the following packages are not "
             ++ "installed. No links will be generated to these packages: "
             ++ intercalate ", " (map display missing)
      flags = [ (interface, if null html then Nothing else Just html)
              | Right (interface, html) <- interfaces ]

so we need to keep depending on the -doc packages.

Also, this means that docs built now do not contain links to docs of
dependencies built before 7.0.3, at least not until we either install
the symlink-workaround or patch haddock _and_ Cabal to transparently map
the wrong path to the right path.

Greetings,
Joachim

-- 
Joachim "nomeata" Breitner
Debian Developer
  nomeata@debian.org | ICQ# 74513189 | GPG-Keyid: 4743206C
  JID: nomeata@joachim-breitner.de | http://people.debian.org/~nomeata

Attachment: signature.asc
Description: This is a digitally signed message part


Reply to: