[Git][ghc/ghc][wip/ghc-internals-move] 4 commits: Add os-string as a boot package

Ben Gamari (@bgamari) gitlab at gitlab.haskell.org
Mon Feb 5 22:13:27 UTC 2024



Ben Gamari pushed to branch wip/ghc-internals-move at Glasgow Haskell Compiler / GHC


Commits:
2bc669ff by Ben Gamari at 2024-01-31T08:51:35-05:00
Add os-string as a boot package

Introduces `os-string` submodule. This will be necessary for
`filepath-1.5`.

- - - - -
8f1b1b08 by Ben Gamari at 2024-02-02T22:42:28-05:00
Bump filepath to 1.5.0.0

Required bumps of the following submodules:

 * `directory`
 * `filepath`
 * `haskeline`
 * `process`
 * `unix`
 * `hsc2hs`
 * `Win32`
 * `semaphore-compat`

and the addition of `os-string` as a boot package.

- - - - -
4fd136b3 by Ben Gamari at 2024-02-02T22:46:13-05:00
base: Cleanup whitespace in cbits

- - - - -
8d2d028b by Ben Gamari at 2024-02-05T17:13:01-05:00
Move `base` to `ghc-internal`

Here we move a good deal of the implementation of `base` into a new
package, `ghc-internal` such that it can be evolved independently
from the user-visible interfaces of `base`.

While we want to isolate implementation from interfaces, naturally, we
would like to avoid turning `base` into a mere set of module re-exports.
However, this is a non-trivial undertaking for a variety of reasons:

 * `base` contains numerous known-key and wired-in things, requiring
   corresponding changes in the compiler

 * `base` contains a significant amount of C code and corresponding
   autoconf logic, which is very fragile and difficult to break apart

 * `base` has numerous import cycles, which are currently dealt with via
   carefully balanced `hs-boot` files

 * We must not break existing users

To accomplish this migration, I tried the following approaches:

* [Split-GHC.Base]: Break apart the GHC.Base knot to allow incremental
  migration of modules into ghc-internal: this knot is simply too
  intertwined to be easily pulled apart, especially given the rather
  tricky import cycles that it contains)

* [Move-Core]: Moving the "core" connected component of base (roughly
  150 modules) into ghc-internal. While the Haskell side of this seems
  tractable, the C dependencies are very subtle to break apart.

* [Move-Incrementally]:

  1. Move all of base into ghc-internal
  2. Examine the module structure and begin moving obvious modules (e.g.
     leaves of the import graph) back into base
  3. Examine the modules remaining in ghc-internal, refactor as necessary
     to facilitate further moves
  4. Go to (2) iterate until the cost/benefit of further moves is
     insufficient to justify continuing
  5. Rename the modules moved into ghc-internal to ensure that they don't
     overlap with those in base
  6. For each module moved into ghc-internal, add a shim module to base
     with the declarations which should be exposed and any requisite
     Haddocks (thus guaranteeing that base will be insulated from changes
     in the export lists of modules in ghc-internal

Here I am using the [Move-Incrementally] approach, which is empirically
the least painful of the unpleasant options above

Bumps haddock submodule.

Metric Decrease:
    haddock.Cabal
    haddock.base
Metric Increase:
    MultiComponentModulesRecomp
    T16875

- - - - -


30 changed files:

- .gitignore
- .gitmodules
- compiler/GHC/Builtin/Names.hs
- compiler/GHC/StgToJS/Rts/Rts.hs
- compiler/GHC/Unit/Types.hs
- compiler/ghc.cabal.in
- configure.ac
- ghc/ghc-bin.cabal.in
- hadrian/src/Packages.hs
- hadrian/src/Settings/Default.hs
- hadrian/src/Settings/Packages.hs
- libraries/Cabal
- libraries/Win32
- libraries/base/base.cabal
- libraries/base/src/Control/Applicative.hs
- libraries/base/src/Control/Concurrent.hs
- libraries/base/src/Data/Complex.hs
- libraries/base/src/Data/Semigroup.hs
- + libraries/base/src/Dummy.hs
- libraries/base/src/System/CPUTime/Posix/Times.hsc
- libraries/directory
- libraries/filepath
- libraries/ghc-boot/ghc-boot.cabal.in
- libraries/base/.authorspellings → libraries/ghc-internal/.authorspellings
- libraries/base/.gitignore → libraries/ghc-internal/.gitignore
- libraries/base/.hlint.yaml → libraries/ghc-internal/.hlint.yaml
- libraries/ghc-internal/LICENSE
- libraries/base/Setup.hs → libraries/ghc-internal/Setup.hs
- libraries/base/aclocal.m4 → libraries/ghc-internal/aclocal.m4
- libraries/base/cbits/CastFloatWord.cmm → libraries/ghc-internal/cbits/CastFloatWord.cmm


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/8fcbdbe3a358a03f2cfff597c4c056f449cd8b37...8d2d028bd1da4816bb46410dd6ba95042ef4921b

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/8fcbdbe3a358a03f2cfff597c4c056f449cd8b37...8d2d028bd1da4816bb46410dd6ba95042ef4921b
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20240205/202613c6/attachment.html>


More information about the ghc-commits mailing list