Fix --with-haddock option
commit44748dae5227e8ce5f1d3f0e79f6cf08d32f0369
authorMarcin Szamotulski <coot@coot.me>
Tue, 24 May 2022 18:38:47 +0000 (24 20:38 +0200)
committerMergify <37929162+mergify[bot]@users.noreply.github.com>
Mon, 13 Jun 2022 10:12:22 +0000 (13 10:12 +0000)
tree3e9106a1bff7d7a76666da2c102c878998414794
parent7564f50297346d821e6dffdb2f3fdddc33eb0cee
Fix --with-haddock option

It was broken in various ways :/

* The CmdHaddock (and CmdHaddockProject) have to restore the paths set with
  'haddockProgramPath' (or 'haddockProjectProgramPath');
* haddock is not by default in 'ProgramDb'; We need to add it first,
  otherwise 'reconfigure' will not update its path.
* 'setupHsHaddockFlags', need to store haddock location in
  'haddockProgramPaths.

This patch also adds 'haddockProjectProgramPath' and
'haddockProjectProgramArgs' to 'HaddockProjectFlags' which are passed to
'CmdHaddockProject'.
Cabal/src/Distribution/Simple/Setup.hs
cabal-install/src/Distribution/Client/CmdHaddock.hs
cabal-install/src/Distribution/Client/CmdHaddockProject.hs
cabal-install/src/Distribution/Client/ProjectPlanning.hs