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

Tying haddock to ghc versions


at the moment ghc-doc depends on ghc-haddock (= ${binary:Version}) which
makes ghc not binNMU’able, as ghc-doc is arch all.

We know that we need to tie the documentation to the haddock version,
because otherwise the haddock .index files break. But I guess we can do

Look at this code in utils/haddock/src/Haddock/InterfaceFile.hs:

-- Since datatypes in the GHC API might change between major versions, and
-- because we store GHC datatypes in our interface files, we need to make sure
-- we version our interface files accordingly.
binaryInterfaceVersion :: Word16
#if __GLASGOW_HASKELL__ == 700
binaryInterfaceVersion = 16
#elif __GLASGOW_HASKELL__ == 701
binaryInterfaceVersion = 16
#error Unknown GHC version

As you can see, the interface version does not change between every ghc
release, and we do not want to do a sourceful upload of each library
when we upgrade ghc if we can help it. If binaryInterfaceVersion does
change, then we do need to rebuild everything from source.

Again, I think virtual packages help us. When building ghc (and thus
ghc-haddock), we automatically make ghc-haddock provide
"ghc-haddock-<binaryInterfaceVersion>". When building any -doc package
that contains .index files, we make that package depend on the
appropriate "ghc-haddock-<binaryInterfaceVersion>".

This way, if we upgrade ghc and the version stays the same, everything
stays installable and working. If the version is bumped, the old -doc
packages become uninstallable (good, because no users are annoyed) and
we can do the sourceful uploads.

How does that sound?

TODOs would be:
 * Patch haddock to add an option to print the binaryInterfaceVersion
(and preferably upstream the patch).
 * Add a substvar in ghc for ghc-haddock Provides and fill it.
 * Add a substvar in ghc for ghc-doc to depend on ghc-haddock-api-<n>.
 * Add a haskell:Provides substvar to all libghc-*-doc packages.
 * Fill it in haskell-devscripts.

Sounds like a fun and rewarding task. Any takers?


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: