-
Notifications
You must be signed in to change notification settings - Fork 2
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
The ghc -M / -c approach is not sufficient for correct builds in all cases #9
Comments
Thanks, will look into this. |
I wonder if we can also use our persistent ghc server for deps analysis and extend it to support outputting information that is unavailable via |
I guess it will be quite difficult, as GHC discovers these dependencies on the fly, and according to what they say in Trac, even down to the per-function level. |
I don't understand why http://ghc.haskell.org/trac/ghc/ticket/481 is a problem for |
@dcoutts Because in that case TH forces you to do a recompilation that you would not consider necessary only at the (If I'm wrong with this: I would love that, I really want this to work.) |
Another point: The commit mentions It also looks like there is no way no support It looks like only a subset of Haskell can be compiled with |
This is the DEPENDS pragma, I believe. Another related issue is http://ghc.haskell.org/trac/ghc/ticket/3588 |
Being a pragma, DEPENDS carries static knowledge, could be evaluated by |
Aha, thanks. Yeah, that's a problem. Perhaps I can make the persistent server output this info during compilation. |
Also relevant: http://ghc.haskell.org/trac/ghc/ticket/8144 and nh2@8f2833a. |
Shall we close this issue? We can probably simply keep the final GHC pass because your ghc-server will make it a no-op / very fast. |
@nh2 I'm still a bit unsatisfied with that approach, so I'd like to keep this open. |
Why not write some programs using the GHC API to help you get out the information you need? You can define a private interface between ghc-parmake and the GHC API program which is shared across versions of GHC, so you can have different versions of the GHC API program for different versions of GHC. GHC 8.0 is even coming with frontend plugins (https://ghc.haskell.org/trac/ghc/ticket/11194) which should make it even easier to write programs which accept GHC-style arguments. Once you figure out exactly what you need, and what a good format is, you can submit the frontends to GHC for upstreaming. |
Thanks, I'll try to find some time to experiment with frontend plugins. The master branch actually contains a GHC API-based reimplementation of |
Yeah, the GHC API can be really helpful. For example, in https://github.com/ezyang/ghc-shake I can run the preprocessor and parseHeader, get the dependencies, and then feed it directly into the build system. For this approach to scale, I need to separate the GHC API bits from the build system bits, but it works very nicely. |
Looks pretty cool! |
See: http://ghc.haskell.org/trac/ghc/ticket/481
While there is a way to get around the external dependencies problem, the cases regarding TemplateHaskell described in that bug can probably not be implemented using
ghc -M
andghc -c
.(Also, http://ghc.haskell.org/trac/ghc/ticket/7277 is not even handled properly by
ghc --make
itself.)This is probably important for the GSoC project, because it means that any system based on
ghc -M
alone cannot produce always-correct builds.The only workaround that I see for now is to call
ghc --make
after our parallel build, and live with the singlethreadedness that comes with that.The text was updated successfully, but these errors were encountered: