Skip to content

Custom GHC build #4567

@hsyl20

Description

@hsyl20

I have some code that depends on a custom patched GHC. Currently my options to allow other people to build this code are:

  1. Create a GHC bindist. Make it available somewhere online. Add this kind of configuration into stack.yaml:
setup-info:
  ghc:
     linux64-custom-bugfix-tinfo6:
        8.6.3:
           url: "http://myserver/downloads/ghc-8.6.3-x86_64-bugfix-linux.tar.xz"

compiler: ghc-8.6.3
ghc-variant: bugfix
allow-newer: true
  1. Give instructions to user on how to build the custom GHC and tell them to use the following Stack configuration updated for their system:
extra-path:
- /home/login/repo/ghc/_build/stage1/bin

system-ghc: true
compiler: ghc-8.7.20190131
allow-newer: true

Both options are not satisfying.

What I would like instead is to be able to specify in stack configuration:

compiler:
   git: https://github.com/me/ghc.git
   commit: 4b00a96cee23ba0bf658834709703368b02f7e30
   flavour: devel2

This would:

  1. download GHC from git (similarly to an extra-dep).
  2. build it using: ./hadrian/build.stack.sh -c -j --flavour=devel2 binary-dist
  3. install the resulting bindist into: STACK_ROOT/programs/ARCH/ghc-4b00a96cee23ba0bf658834709703368b02f7e30-devel2/
  4. use this GHC as a compiler

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