Skip to content

build GHC from source if bindist not available #4637

Closed

Description

@notestaff

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.

Activity

  1. mihaimaruseac commented on Mar 19, 2019

    @mihaimaruseac
    Member

    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.

  2. notestaff commented on Mar 19, 2019

    @notestaff
    Author

    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”.

  3. notestaff commented on Mar 19, 2019

    @notestaff
    Author

    Maybe, eventually there could also be an option to upload the built bindist to some shared repository, from which others could download it?

  4. mihaimaruseac commented on Mar 19, 2019

    @mihaimaruseac
    Member

    That would be nice, but will open a can of worms labeled security and trust.

  5. snoyberg commented on Mar 25, 2019

    @snoyberg
    Contributor

    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.

  6. snoyberg commented on Mar 28, 2019

    @snoyberg
    Contributor

    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.

  7. snoyberg commented on Apr 12, 2019

    @snoyberg
    Contributor

    #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.

  8. barracuda156 commented on Jun 6, 2023

    @barracuda156

    @snoyberg How would you bypass a need for existing GHC? AFAIK it does not build with any compilers bootstrappable from C (like nhc98).

  9. mpilgrem commented on Jun 6, 2023

    @mpilgrem
    Member

    @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.

  10. hasufell commented on Jun 7, 2023

    @hasufell
    Contributor

    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.

  11. barracuda156 commented on Jun 7, 2023

    @barracuda156

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions