snowleopard / hadrian

Hadrian: a new build system for the Glasgow Haskell Compiler. Now merged into the GHC tree!
https://gitlab.haskell.org/ghc/ghc/tree/master/hadrian
MIT License
208 stars 37 forks source link

Document how to build a stage 3 compiler #461

Closed bgamari closed 5 years ago

bgamari commented 6 years ago

How does one do this?

snowleopard commented 6 years ago

I don't think I've ever tried this actually. Will give it a try!

bgamari commented 6 years ago

Do note that GHC's make build system is actually broken in this regard (see #14469). Hopefully Hadrian will be able to do better here.

bgamari commented 6 years ago

After explicitly building,

_build/stage2/compiler/ghc_boot_platform.h

hadrian inplace/bin/ghc-stage3 finishes. However, it only builds the ghc-bin executable linked against the ghc package built by Stage1.

It seems to me like we should have three distinct package databases:

snowleopard commented 6 years ago

@bgamari This looks like something that should be easier to implement once @angerman completes #445.

bgamari commented 6 years ago

What is the status of this? Perhaps this now works?

Note that make's support of stage-3 builds is a bit broken; see #15442. It would be great if Hadrian were better in this regard.

snowleopard commented 6 years ago

@bgamari Do you know if there is any difference in command line arguments passed to various builders when building Stage2 and Stage3? If no, I think one could try to build Stage3 GHC simply by asking Hadrian to build the right target.

P.S.: My current Hadrian set up is broken due to the Cabal bug in #634, so I haven't build GHC for a while. Somehow the workaround used by CI didn't work for me, but I guess I should give it another try.

snowleopard commented 5 years ago

I believe this has been fixed.