-
Notifications
You must be signed in to change notification settings - Fork 841
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
build GHC from source if bindist not available #4637
Comments
That would be an improvement, but I would also want a warning be presented to the user and then have the user choose to do the download,compile&install. |
Right, so where right now it just fails for lack of needed bindist, it would print “Rerun with —build-ghc-from-source if you want to do that”. |
Maybe, eventually there could also be an option to upload the built bindist to some shared repository, from which others could download it? |
That would be nice, but will open a can of worms labeled security and trust. |
Issue #4567 also asks for the ability to build GHC from source. I'm leaning towards wishlisting both of these issues until someone steps up to contribute code to make this happen. |
There's a PR too build from source at #4655. If and when that lands, I could imagine providing an argument to stack setup which would perform a source build. |
#4655 has been merged to master, though it doesn't completely address this issue. I'm moving this request to this wishlist, if you're interested in working on this (or anyone else for that matter), please add a comment. |
@snoyberg How would you bypass a need for existing GHC? AFAIK it does not build with any compilers bootstrappable from C (like nhc98). |
@barracuda156, based on this GHC wiki page (under 'ghc'), I understand your question is equivalent to: how to cross-compile GHC. This other GHC wiki page is devoted to that subject. I think cross-compiling GHC is (at least, currently) outside of the scope of the Stack project. |
GHCup tries to support cross compilation. But the GHC build system is a constantly moving target and far from convenient for the casual end user. |
I do have an active interest in cross-compiling GHC, because I want to have it on Darwin PPC, and sequential native builds from 7.6.3 up is just madness, since the compiler is rather buggy and build is very fragile. So cross-compiling it from Intel appears more realistic. (To add insult to injury, he-he, upstream has broken the build on 10.6 Intel too, which is the last bi-arch OS and the one where cross-compiling would be somewhat less problematic.) But as for “building from source”, I think GHC does not qualify, as of now. Self-dependency implies impossibility to build from sources. Majority of compilers can be built from sources only; specifically for Haskell, sadly, those are too archaic however. |
For a platform for which only older bindists exist, if a project's resolver requires a newer ghc, it would be good if stack could (have the option to) download ghc sources and build ghc from source, using the older available bindist for bootstrapping.
The text was updated successfully, but these errors were encountered: