Repository navigation
Build GHC from source (#4567) - #4655
Conversation
|
Thanks! A few initial comments
|
I'm trying to fix it now. However I'm not sure I've done the correct thing in src/Stack/Types/BuildPlan.hs. I've blindly updated the version string but I'm not sure about it.
I have updated the documentation. But to answer here: the bootstrapping compiler is configured via
I have tried to improve the documentation on this topic but I don't really understand " Stack tries to assume that global packages are not the same as something on Hackage". The issue we had in #4567 (cf #4567 (comment)) is that Stack was trying to build an older Cabal against a newer GHC while the only working Cabal was still unreleased. |
Thanks! I'll review the code in more detail soon.
That's even better than I was hoping for!
I think the issue here is that the Stackage snapshots all specify an override of the Cabal library, which forces Stack to ignore the global Cabal version for custom Setup.hs files. We may be moving away for that for other reasons. There are more details at commercialhaskell/stackage#4425. In #4671 I've added support for a |
snoyberg
left a comment
There was a problem hiding this comment.
This looks really good.
|
Thanks @snoyberg for the review! I've updated the PR accordingly. |
|
|
||
| -- RIO.Process doesn't wrap process' "shell". | ||
| -- Instead we use "proc" with the "sh" command | ||
| proc "sh" hadrianArgs runProcess_ |
There was a problem hiding this comment.
I don't think this will work on Windows, since we're trying to run a batch file, not a shell script. What about instead:
proc hadrianCmd hadrianArgs runProcess_And removing the hadrianCmd from the args above.
There was a problem hiding this comment.
Is the shell script in the repo set to be executable?
There was a problem hiding this comment.
Yes it is. It fails with "Did not find executable at specified path: ./hadrian/build.stack.sh"
There was a problem hiding this comment.
Please see 2768bb9. This is a really confusing aspect of the process package, I only figured this out since I've been bitten by it before.
We can now specify a specific GHC to build from source in `stack.yaml` with the following syntax: ``` compiler: ghc-git-COMMIT-FLAVOUR ``` In the setup phase Stack downloads the source from the specified Git repository and commit ID, then it uses Hadrian to build a GHC binary distribution with the specified flavour and it installs it into STACK_ROOT/programs/ARCH/ghc-git-COMMIT-FLAVOUR.
|
OK, the only thing remaining is the execution of the script on POSIX vs Windows. Everything else looks great. I'm going to futz with it a bit on my OS X and Windows machines and then merge to master. Thanks for enduring a thorough review process @hsyl20 and for the new feature! |
|
Thanks Michael for the review! My patch fixing GHC bindists has also been merged into GHC so the test passes (on Linux)! |
This patch adds the experimental support for building GHC from source. We can now specify a specific GHC to build from source in
stack.yamlwith the following syntax:In the setup phase Stack uses Hadrian to build a GHC binary distribution
with the specified flavour and installs it into
STACK_ROOT/programs/ARCH/ghc-git-COMMIT-FLAVOUR.
The built compiler can be used with the following configuration:
As GHC may rely on unreleased version of the global packages (e.g.
Cabal), you may have to add some extra-deps as follows: