Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't parse cabal files twice #3615

Merged
merged 6 commits into from
Dec 1, 2017
Merged

Don't parse cabal files twice #3615

merged 6 commits into from
Dec 1, 2017

Commits on Nov 29, 2017

  1. Don't parse cabal files twice

    This improves on the previous warning hack to keep a cache of parsed
    GenericPackageDescriptions, and avoid rerunning hpack.
    
    There are some TODOs added in this commit. One further point of concern:
    should we opt-out of caching the results of parsing index files? I'm
    imagining that when loading a snapshot, this may result in a lot of
    memory usage. (Then again, this may already be the case, see #3586.)
    snoyberg committed Nov 29, 2017
    Configuration menu
    Copy the full SHA
    5308723 View commit details
    Browse the repository at this point in the history
  2. Refactoring around cabal file parsing

    This is a large change that fell out from trying to clean up the mess
    left from the previous commit. The result here should be signficant
    simplification of the code paths around parsing cabal files. In fact,
    there are a few existing TODOs that got hit by this.
    snoyberg committed Nov 29, 2017
    Configuration menu
    Copy the full SHA
    b374efc View commit details
    Browse the repository at this point in the history

Commits on Nov 30, 2017

  1. Style cleanup

    snoyberg committed Nov 30, 2017
    Configuration menu
    Copy the full SHA
    83537ec View commit details
    Browse the repository at this point in the history
  2. Better exception on mismatch

    snoyberg committed Nov 30, 2017
    Configuration menu
    Copy the full SHA
    49c6cfd View commit details
    Browse the repository at this point in the history
  3. Don't track hpack run cache separately

    Instead: just cache the results of cabal file parsing, and run hpack
    when doing so. This (as the previous few patches) involved much more
    overhaul than seems like it should. The best way to do this reliably is
    to only expose a single function from Stack.Package which can run hpack.
    In turn, this ended up requiring a conversion of a bunch of parts of the
    code base from passing around Path Abs File (pointing to the cabal file
    itself) to instead pass around Path Abs Dir (pointing to the directory).
    
    I think this is a good change, once against simplifying things a bit
    more.
    snoyberg committed Nov 30, 2017
    Configuration menu
    Copy the full SHA
    d18c620 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    2703ba4 View commit details
    Browse the repository at this point in the history