Rework parsing of Cabal metadata (#692)
authorAndrey Mokhov <andrey.mokhov@gmail.com>
Sat, 29 Sep 2018 10:43:17 +0000 (11:43 +0100)
committerGitHub <noreply@github.com>
Sat, 29 Sep 2018 10:43:17 +0000 (11:43 +0100)
commit7169ac5d7b03f1ed5fbb05514352c0fdeb16429b
tree8e9177b741d78a2afb8cb2faa5593fc77b5fbeaa
parent835f2766eda708c7f8bc21c25528ce60dc7e8319
Rework parsing of Cabal metadata (#692)

The current implementation of parsing Cabal data is a big mess, which affects performance as described in #671 and #550. In this PR we simplify the implementation and avoid unnecessary reparsing.

As a result, the zero build time is reduced from 30 seconds to 5 seconds on my machine. The full build time seems to have been improved as well, since now all CI bots complete within the time limit. On the other hand, the speed up of the full build with `-j` on my machine does not appear to be significant.
32 files changed:
hadrian.cabal
src/Context.hs
src/Expression.hs
src/Hadrian/Expression.hs
src/Hadrian/Haskell/Cabal.hs
src/Hadrian/Haskell/Cabal/CabalData.hs [deleted file]
src/Hadrian/Haskell/Cabal/PackageData.hs [deleted file]
src/Hadrian/Haskell/Cabal/Parse.hs
src/Hadrian/Haskell/Cabal/Type.hs [new file with mode: 0644]
src/Hadrian/Oracles/Cabal.hs [new file with mode: 0644]
src/Hadrian/Oracles/Cabal/Rules.hs [new file with mode: 0644]
src/Hadrian/Oracles/Cabal/Type.hs [new file with mode: 0644]
src/Hadrian/Oracles/Path.hs
src/Hadrian/Oracles/TextFile.hs
src/Hadrian/Oracles/TextFile/Rules.hs [deleted file]
src/Hadrian/Oracles/TextFile/Type.hs [deleted file]
src/Oracles/ModuleFiles.hs
src/Rules.hs
src/Rules/BinaryDist.hs
src/Rules/Documentation.hs
src/Rules/Library.hs
src/Rules/Program.hs
src/Rules/Selftest.hs
src/Settings/Builders/Cabal.hs
src/Settings/Builders/Cc.hs
src/Settings/Builders/Common.hs
src/Settings/Builders/Ghc.hs
src/Settings/Builders/Haddock.hs
src/Settings/Builders/Hsc2Hs.hs
src/Settings/Default.hs
src/Utilities.hs
stack.yaml