This repository has been archived by the owner on Aug 2, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 37
WIP: Relocation based build (inplace free) #445
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This allows to run it during the build without the wrapper.
Again, if ghc-pkg is run without a wrapper, we need to provide it with the flag.
No more /inplace/ logic.
This might need some rethinking, as we might want to rebuild them per stage (or copy?) We could e.g. build them in stage0, and just copy them into stage1 and stage2.
This again should probably be done by having the package depend on the right files. ghc depends on settings, llvm-targets, platformConstants and the ghc/ghci-usage.txt files. hsc2hs depends on the template.
hsc depends on the template-hsc.h, and ghc depends on settings, platformConstants, llvm-targets, ghc-usage.txt, ghci-usage.txt. As such they will bring the files in on their own, and the copy target logic is no longer required.
E.g. buld ghc-cabal with stage0, it's part of the stage1 then.
…/feature/reloc # Conflicts: # src/Base.hs # src/Builder.hs # src/GHC.hs # src/Hadrian/Builder.hs # src/Rules/Documentation.hs # src/Rules/Install.hs # src/Settings/Builders/Hsc2Hs.hs # src/Settings/Builders/RunTest.hs
Types.X modules become X.Type
…/feature/reloc # Conflicts: # src/GHC.hs
(Just adding a link as some sort of "TODO", for me to revisit my documentation rules patches to add |
@alpmestan Oops, sorry, I've already rushed ahead with #505 to make sure I won't forget this. |
No worries :) |
This was referenced Feb 25, 2018
alpmestan
added a commit
to alpmestan/hadrian
that referenced
this pull request
Mar 19, 2018
This commit implements two significant changes (that were not easy to separate): - Don't use ghc-cabal anymore for getting information about Haskell packages. We now instead directly use Cabal-the-library. - Make the build root configurable. This effectively gets rid of the inplace logic and allows us to place _all_ build artefacts in some directory of our choice, by passing '--build-root <some path>' to hadrian. The code for this was mostly taken from snowleopard#445.
alpmestan
added a commit
to alpmestan/hadrian
that referenced
this pull request
Mar 19, 2018
This commit implements two significant changes (that were not easy to separate): - Don't use ghc-cabal anymore for getting information about Haskell packages. We now instead directly use Cabal-the-library. - Make the build root configurable. This effectively gets rid of the inplace logic and allows us to place _all_ build artefacts in some directory of our choice, by passing '--build-root <some path>' to hadrian. The code for this was mostly taken from snowleopard#445.
alpmestan
added a commit
to alpmestan/hadrian
that referenced
this pull request
Mar 19, 2018
This commit implements two significant changes (that were not easy to separate): - Don't use ghc-cabal anymore for getting information about Haskell packages. We now instead directly use Cabal-the-library. - Make the build root configurable. This effectively gets rid of the inplace logic and allows us to place _all_ build artefacts in some directory of our choice, by passing '--build-root <some path>' to hadrian. The code for this was mostly taken from snowleopard#445.
alpmestan
added a commit
to alpmestan/hadrian
that referenced
this pull request
Mar 21, 2018
This commit implements two significant changes (that were not easy to separate): - Don't use ghc-cabal anymore for getting information about Haskell packages. We now instead directly use Cabal-the-library. - Make the build root configurable. This effectively gets rid of the inplace logic and allows us to place _all_ build artefacts in some directory of our choice, by passing '--build-root <some path>' to hadrian. The code for this was mostly taken from snowleopard#445.
3 tasks
snowleopard
pushed a commit
that referenced
this pull request
Mar 30, 2018
…le (#531) * Use Cabal directly in place of ghc-cabal; make build root configurable. This commit implements two significant changes (that were not easy to separate): - Don't use ghc-cabal anymore for getting information about Haskell packages. We now instead directly use Cabal-the-library. - Make the build root configurable. This effectively gets rid of the inplace logic and allows us to place _all_ build artefacts in some directory of our choice, by passing '--build-root <some path>' to hadrian. The code for this was mostly taken from #445. * fix documentation rules * remove some leftover unrelated, commented-out code * more documentation fixes, address some feedback * cleanup * more cleanup * boot and configure explicitly in travis CI scripts * update cabal/ghc versions in .travis.yml (8.0.x not supported anymore) * temporarily disable dynamic ways in Settings.Default * update appveyor script * travis: when booting with 8.2.2, build a complete stage2 compiler * Fix CI? Try to fix the CI by adding the `debug` rts way back in. * Update Quickest.hs Replicate the make build systems build flavours. * Update .travis.yml - Run selftest, and build in separate instances. - try with python2 - and unify mac to stage2 * Update .travis.yml upgrade python on mac * [travis] os x: test the freshly built ghc * Get rid of two unused GhcCabalMode constructors * fix ghc-split rule, get rid of Install/Wrappers rules * address more feedback * ConfiguredCabal -> PackageData, more comments, more feedback addressed * make the complete stage 2 build the default * use a dummy package instead of base in Rules.hs * update CI scripts * attempt at fixing hadrian's -c option * .travis.yml: use -c everywhere again * travis: back to explicit './boot && ./configure' * update README.md and doc/user-settings.md to reflect configurable build root * some more feedback
I’m curious what is left to be done in this PR after #531? |
@alpmestan Sounds great! Once you are confident nothing has been lost, please close this PR. |
Guess we can close this for now. If I'll end up with issues building my cross compilers again, I'll probably start a new branch. |
@angerman Once again, many thanks for this amazing PR :-) |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is essentially a reorganization on how libraries and ghc are built. The idea is to produce
ghc builds in
_build/stage2/{bin,lib}
, that could just be packed up and shipped around. Thisalso means there should be no more
inplace
files left.This also includes a few additional changes:
configure
packages, (it does not run the proper configure logic yet).Things that do now yet work:
ghc --interactive
fails to run, due to libgmp relocation issuesNote this was due to hadrian relying on builing the in-tree-gmp on macOS. I believe
this is equally broken in the make based build system.
arch-vendor-os-ghc
).Noteworthy:
virtual-modules
to handle cases likeGHC.Prim
fromghc-prim
. haskell/cabal#4875)Note: this is now an collection of serval PRs, which are included in my zw3rk/cabal/work branch.
Others:
The value of this has definitely been that I now know more about hacking on Hadrian.
NOTE: I do not expect this to be merged now. I want this to be more a basis
for discussion. I would have tried to make the same idea work with the make based
build system, but as Hadrian is the supposed way forward, I did not intend to waste
much time on the old(?) build system. I am going to pursue this direction further.
TODO:
stage1/bin
. This will also remove the need to copy the package.conf.d over from stage1 to stage2 to obtain the full stage2 compiler.