Repository navigation
Conversation
Introduces 'BuildM', a monad for actions defined in the context of building a component. Actions in the 'BuildM' monad have access to 'PreBuildComponentInputs', which is the information necessary and available to a build right before building a component (hence the name). Introduces as well 'BuildingWhat', a type that distinguishes the kind of build we are doing (Normal vs Repl vs Haddock vs Hscolour) and the different flags available for each kind of build.
Refactors the duplicated `buildExtraSources` function from `gbuild` and `buildOrReplLib` into a standalone monadic computation in the context of building a component (namely, a 'BuildM' action). This refactor allows us to share the code for building an extra source amongst the two functions, and paves the way to fixing haskell#9389. A standalong part of the refactor of gbuild and buildOrReplLib (haskell#9389)
Creates a new module Distribution.Simple.GHC.Build.Modules which, in the same spirit as ...GHC.Build.ExtraModules, defines a 'BuildM' action which builds all the Haskell modules of the component being built. This function clarifies and re-implements the logic of building Haskell modules in the different possible ways, while accounting for Template Haskell special "way requirements", which was previously duplicated in a non-obvious manner in gbuild and buildOrReplLib. The Note [Building Haskell modules accounting for TH] in that module explains the big picture, and the implementation is re-done in light of it. A standalone part of the refactor of gbuild vs buildOrReplLib (haskell#9389)
This is the third part of the refactor of gbuild and buildOrReplLib (haskell#9389). It re-works the linker invocations, focusing on preserving existing behaviour before simplifying or fixing bugs any further. Follows the spirit of the two previous commits, with the end goal of (haskell#9389)
|
@alt-romes interesting PR! Would you mind clarifying a bit in the manual what this implies? I thought fully static was highly conditional on the libc used for compilation, because glibc cannot be compiled as static (and thus musl has to be used). Moreover may I interest you in changelog entry? :) |
|
@Kleidukos That's a good question. The "fully static" in this patch is determined by GHC, and is as fully static as a fully static executable also produced by cabal, which may well be up-to system libs on macOS, and perhaps glibc remains dynamic (would be simple to check). I'll handle the changelogs and such Monday. I just wrote the code for it on a whim this morning. |
|
@edsko what was your vision of |
|
@alt-romes wonderful, thanks for the clarification. I appreciate the introduction of the term "native-static", it will be interesting to generalise its use where we mean "we try our best". |
|
Is this related to #9320 in anyway? |
Please read Github PR Conventions and then fill in one of these two templates.
Sits on top of the refactor from #9602
Template Α: This PR modifies
cabalbehaviourInclude the following checklist in your PR:
Template Β: This PR does not modify
cabalbehaviour (documentation, tests, refactoring, etc.)Include the following checklist in your PR: