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

Cache built Setup.hs #801

Closed
mgsloan opened this issue Aug 17, 2015 · 2 comments
Closed

Cache built Setup.hs #801

mgsloan opened this issue Aug 17, 2015 · 2 comments
Assignees
Milestone

Comments

@mgsloan
Copy link
Contributor

mgsloan commented Aug 17, 2015

Currently, Setup.hs always gets interpreted via runhaskell. Since it's invoked multiple times, and often just with the default Setup.hs, it could sometimes make sense to instead compile it (which is the approach taken by cabal install).

This is particularly relevant for GHCJS support (#337), as my current implementation needs to build Setup.hs as there isn't a runhaskell equivalent for GHCJS. So, instead it rebuilds Setup.hs every time it's invoked, leading to compiles that are much slower than they need to be.

This is a bit tricky, though, as we'd need a good way to track when the cached build of Setup.hs is out of date. Cabal does this by checking the timestamp of the file vs the binary, but I think this neglects changes due to modules that Setup.hs depends on.

@snoyberg snoyberg self-assigned this Aug 17, 2015
@snoyberg snoyberg added this to the 0.2.0.0 milestone Aug 17, 2015
snoyberg added a commit that referenced this issue Aug 17, 2015
@snoyberg
Copy link
Contributor

Let's move discussion to #803.

@mgsloan
Copy link
Contributor Author

mgsloan commented Aug 17, 2015

Note that GHCJS builds which involve a custom Setup.hs will still be rather slow (recomputing the JS for it for each cabal invocation). However, this does resolve the slowness for the common case.

snoyberg added a commit that referenced this issue Aug 17, 2015
mgsloan added a commit that referenced this issue Aug 17, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants