[Git][ghc/ghc][wip/ghc-internals-2] 2 commits: ghc-internal: Initial commit of the skeleton

Ben Gamari (@bgamari) gitlab at gitlab.haskell.org
Tue Aug 15 05:28:44 UTC 2023



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


Commits:
c5870e06 by Ben Gamari at 2023-08-15T01:28:27-04:00
ghc-internal: Initial commit of the skeleton

- - - - -
d817f0ce by Ben Gamari at 2023-08-15T01:28:33-04:00
ghc-experimental: Initial commit

- - - - -


17 changed files:

- .gitlab-ci.yml
- docs/users_guide/9.10.1-notes.rst
- hadrian/src/Packages.hs
- hadrian/src/Rules/Lint.hs
- hadrian/src/Settings/Default.hs
- libraries/base/base.cabal
- + libraries/ghc-experimental/CHANGELOG.md
- + libraries/ghc-experimental/LICENSE
- + libraries/ghc-experimental/ghc-experimental.cabal
- + libraries/ghc-experimental/src/Dummy.hs
- + libraries/ghc-internal/CHANGELOG.md
- + libraries/ghc-internal/LICENSE
- + libraries/ghc-internal/ghc-internal.cabal
- + libraries/ghc-internal/src/Dummy.hs
- testsuite/tests/driver/T20604/T20604.stdout
- testsuite/tests/interface-stability/all.T
- + testsuite/tests/interface-stability/ghc-experimental-exports.stdout


Changes:

=====================================
.gitlab-ci.yml
=====================================
@@ -344,6 +344,8 @@ lint-submods-branch:
   script:
     - .gitlab/ci.sh setup
     - .gitlab/ci.sh configure
+    - .gitlab/ci.sh run_hadrian lint:ghc-internal
+    - .gitlab/ci.sh run_hadrian lint:ghc-experimental
     - .gitlab/ci.sh run_hadrian lint:base
     - .gitlab/ci.sh run_hadrian lint:compiler
 


=====================================
docs/users_guide/9.10.1-notes.rst
=====================================
@@ -69,6 +69,12 @@ Runtime system
 ``ghc-heap`` library
 ~~~~~~~~~~~~~~~~~~~~
 
+``ghc-experimental`` library
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+- Introduced per the `base library split proposal
+  <https://github.com/Ericson2314/tech-proposals/blob/ghc-base-libraries/proposals/accepted/051-ghc-base-libraries.rst>`_
+
 ``template-haskell`` library
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 


=====================================
hadrian/src/Packages.hs
=====================================
@@ -5,7 +5,7 @@ module Packages (
     checkExact, countDeps,
     compareSizes, compiler, containers, deepseq, deriveConstants, directory, dumpDecls,
     exceptions, filepath, genapply, genprimopcode, ghc, ghcBignum, ghcBoot, ghcBootTh, ghcPlatform,
-    ghcCompact, ghcConfig, ghcHeap, ghci, ghciWrapper, ghcPkg, ghcPrim, ghcToolchain, ghcToolchainBin,
+    ghcCompact, ghcConfig, ghcExperimental, ghcHeap, ghcInternal, ghci, ghciWrapper, ghcPkg, ghcPrim, ghcToolchain, ghcToolchainBin,
     haddock, haskeline,
     hsc2hs, hp2ps, hpc, hpcBin, integerGmp, integerSimple, iserv, iservProxy,
     libffi, mtl, parsec, pretty, primitive, process, remoteIserv, rts,
@@ -38,8 +38,7 @@ ghcPackages =
     [ array, base, binary, bytestring, cabalSyntax, cabal, checkPpr, checkExact, countDeps
     , compareSizes, compiler, containers, deepseq, deriveConstants, directory, dumpDecls
     , exceptions, filepath, genapply, genprimopcode, ghc, ghcBignum, ghcBoot, ghcBootTh, ghcPlatform
-    , ghcCompact, ghcConfig, ghcHeap, ghci, ghciWrapper, ghcPkg, ghcPrim, ghcToolchain, ghcToolchainBin
-    , haddock, haskeline, hsc2hs
+    , ghcCompact, ghcConfig, ghcExperimental, ghcHeap, ghcInternal, ghci, ghciWrapper, ghcPkg, ghcPrim, haddock, haskeline, hsc2hs
     , hp2ps, hpc, hpcBin, integerGmp, integerSimple, iserv, libffi, mtl
     , parsec, pretty, process, rts, runGhc, stm, semaphoreCompat, templateHaskell
     , terminfo, text, time, touchy, transformers, unlit, unix, win32, xhtml
@@ -55,7 +54,7 @@ isGhcPackage = (`elem` ghcPackages)
 array, base, binary, bytestring, cabalSyntax, cabal, checkPpr, checkExact, countDeps,
   compareSizes, compiler, containers, deepseq, deriveConstants, directory, dumpDecls,
   exceptions, filepath, genapply, genprimopcode, ghc, ghcBignum, ghcBoot, ghcBootTh, ghcPlatform,
-  ghcCompact, ghcConfig, ghcHeap, ghci, ghciWrapper, ghcPkg, ghcPrim, ghcToolchain,
+  ghcCompact, ghcConfig, ghcExperimental, ghcHeap, ghci, ghcInternal, ghciWrapper, ghcPkg, ghcPrim, ghcToolchain,
   haddock, haskeline, hsc2hs,
   hp2ps, hpc, hpcBin, integerGmp, integerSimple, iserv, iservProxy, remoteIserv, libffi, mtl,
   parsec, pretty, primitive, process, rts, runGhc, semaphoreCompat, stm, templateHaskell,
@@ -90,7 +89,9 @@ ghcBootTh           = lib  "ghc-boot-th"
 ghcPlatform         = lib  "ghc-platform"
 ghcCompact          = lib  "ghc-compact"
 ghcConfig           = prg  "ghc-config"      `setPath` "testsuite/ghc-config"
+ghcExperimental     = lib  "ghc-experimental"
 ghcHeap             = lib  "ghc-heap"
+ghcInternal         = lib  "ghc-internal"
 ghci                = lib  "ghci"
 ghciWrapper         = prg  "ghci-wrapper"    `setPath` "driver/ghci"
                       -- See Note [Hadrian's ghci-wrapper package]


=====================================
hadrian/src/Rules/Lint.hs
=====================================
@@ -10,6 +10,8 @@ import System.Exit (exitFailure)
 lintRules :: Rules ()
 lintRules = do
   "lint:base" ~> lint base
+  "lint:ghc-internal" ~> lint ghcInternal
+  "lint:ghc-experimental" ~> lint ghcExperimental
   "lint:compiler" ~> lint compiler
 
   -- Ensure that autoconf scripts, which are usually run by Cabal, are run to
@@ -70,6 +72,16 @@ base = do
         ]
   runHLint includeDirs [] "libraries/base"
 
+ghcInternal :: Action ()
+ghcInternal = do
+  let includeDirs = []
+  runHLint includeDirs [] "libraries/ghc-internal"
+
+ghcExperimental :: Action ()
+ghcExperimental = do
+  let includeDirs = []
+  runHLint includeDirs [] "libraries/ghc-experimental"
+
 compiler :: Action ()
 compiler = do
   buildDir <- buildRoot


=====================================
hadrian/src/Settings/Default.hs
=====================================
@@ -144,6 +144,8 @@ stage1Packages = do
         , ghc
         , ghcBignum
         , ghcCompact
+        , ghcExperimental
+        , ghcInternal
         , ghcPkg
         , ghcPrim
         , haskeline


=====================================
libraries/base/base.cabal
=====================================
@@ -87,6 +87,7 @@ Library
     build-depends:
         rts == 1.0.*,
         ghc-prim >= 0.5.1.0 && < 0.11,
+        ghc-internal >= 0.1 && < 0.2,
         ghc-bignum >= 1.0 && < 2.0
 
     exposed-modules:


=====================================
libraries/ghc-experimental/CHANGELOG.md
=====================================
@@ -0,0 +1,5 @@
+# Revision history for ghc-experimental
+
+## 0.1.0.0 -- YYYY-mm-dd
+
+* First version. Released on an unsuspecting world.


=====================================
libraries/ghc-experimental/LICENSE
=====================================
@@ -0,0 +1,30 @@
+Copyright (c) 2023, ghc-devs at haskell.org
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+    * Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+
+    * Redistributions in binary form must reproduce the above
+      copyright notice, this list of conditions and the following
+      disclaimer in the documentation and/or other materials provided
+      with the distribution.
+
+    * Neither the name of ghc-devs at haskell.org nor the names of other
+      contributors may be used to endorse or promote products derived
+      from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


=====================================
libraries/ghc-experimental/ghc-experimental.cabal
=====================================
@@ -0,0 +1,31 @@
+cabal-version:      3.0
+name:               ghc-experimental
+version:            0.1.0.0
+synopsis:           Experimental features of GHC's standard library
+description:
+    This package is where experimental GHC standard library interfaces start
+    life and mature. Eventually, stabilized interfaces will be
+    migrated into the @base@ library.
+
+homepage:           https://www.haskell.org/ghc/
+license:            BSD-3-Clause
+license-file:       LICENSE
+author:             The GHC Team
+maintainer:         ghc-devs at haskell.org
+copyright:          (c) 2023 The GHC Team
+category:           Development
+build-type:         Simple
+extra-doc-files:    CHANGELOG.md
+
+common warnings
+    ghc-options: -Wall
+
+library
+    import:           warnings
+    exposed-modules:
+    other-modules:    Dummy
+    other-extensions:
+    build-depends:    base ^>=4.18,
+                      ghc-internals >= 0.1 && < 0.2
+    hs-source-dirs:   src
+    default-language: Haskell2010


=====================================
libraries/ghc-experimental/src/Dummy.hs
=====================================
@@ -0,0 +1,10 @@
+{-# LANGUAGE NoImplicitPrelude #-}
+
+-- | This module merely serves as a placeholder since
+-- Haskell packages must contain at least one module.
+-- This can be dropped once a real module has been introduced to
+-- @ghc-experimental at .
+module Dummy () where
+
+-- for build system ordering
+import GHC.Base ()


=====================================
libraries/ghc-internal/CHANGELOG.md
=====================================
@@ -0,0 +1,5 @@
+# Revision history for `ghc-internal`
+
+## 0.1.0.0 -- YYYY-mm-dd
+
+* First version. Released on an unsuspecting world.


=====================================
libraries/ghc-internal/LICENSE
=====================================
@@ -0,0 +1,30 @@
+Copyright (c) 2023, Ben Gamari
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+    * Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+
+    * Redistributions in binary form must reproduce the above
+      copyright notice, this list of conditions and the following
+      disclaimer in the documentation and/or other materials provided
+      with the distribution.
+
+    * Neither the name of Ben Gamari nor the names of other
+      contributors may be used to endorse or promote products derived
+      from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


=====================================
libraries/ghc-internal/ghc-internal.cabal
=====================================
@@ -0,0 +1,33 @@
+cabal-version:      3.0
+name:               ghc-internal
+version:            0.1.0.0
+synopsis:
+    Internal implementation of the Glasgow Haskell Compiler's standard library
+description:
+    This is an internal package containing the implementation of the Glasgow
+    Haskell Compiler's standard library. End users should not depend upon this
+    package directly but rather use either @base@ or the @ghc-experimental@
+    packages.
+homepage:           https://www.haskell.org/ghc/
+license:            BSD-3-Clause
+license-file:       LICENSE
+author:             The GHC Team
+maintainer:         ghc-devs at haskell.org
+copyright:          (c) 2023 The GHC Team
+category:           Development
+build-type:         Simple
+extra-doc-files:    CHANGELOG.md
+
+common warnings
+    ghc-options: -Wall
+
+library
+    import:           warnings
+    exposed-modules:
+    other-modules:    Dummy
+    other-extensions:
+    build-depends:    rts == 1.0.*,
+                      ghc-prim >= 0.5.1.0 && < 0.11,
+                      ghc-bignum >= 1.0 && < 2.0
+    hs-source-dirs:   src
+    default-language: Haskell2010


=====================================
libraries/ghc-internal/src/Dummy.hs
=====================================
@@ -0,0 +1,11 @@
+{-# LANGUAGE NoImplicitPrelude #-}
+
+-- | This module merely serves as a placeholder since
+-- Haskell packages must contain at least one module.
+-- This can be dropped once a real module has been introduced to
+-- @ghc-internal at .
+module Dummy () where
+
+-- for build system dependency ordering
+import GHC.Types ()
+import GHC.Num.BigNat ()


=====================================
testsuite/tests/driver/T20604/T20604.stdout
=====================================
@@ -1,10 +1,11 @@
 A1
 A
-addDependentFile "/home/matt/ghc-ben/_build/stage1/lib/../lib/x86_64-linux-ghc-9.5.20220622/libHSghc-prim-0.8.0-ghc9.5.20220622.so" 3cd9ec17e96be7de19c80aee03da0dad
-addDependentFile "/home/matt/ghc-ben/_build/stage1/lib/../lib/x86_64-linux-ghc-9.5.20220622/libHSghc-bignum-1.3-ghc9.5.20220622.so" 7c71dbe91c74e815aeb4928a4c16fd49
-addDependentFile "/home/matt/ghc-ben/_build/stage1/lib/../lib/x86_64-linux-ghc-9.5.20220622/libHSbase-4.16.0.0-ghc9.5.20220622.so" b1260b12bcd267b0e1a3faf77ede36e4
-addDependentFile "/home/matt/ghc-ben/_build/stage1/lib/../lib/x86_64-linux-ghc-9.5.20220622/libHSghc-boot-th-9.5-ghc9.5.20220622.so" 3eaffd72b71f9ad82898ae3e477f3115
-addDependentFile "/home/matt/ghc-ben/_build/stage1/lib/../lib/x86_64-linux-ghc-9.5.20220622/libHSarray-0.5.4.0-ghc9.5.20220622.so" 580e9d5afc1d691b2dbfe97f9f35dc54
-addDependentFile "/home/matt/ghc-ben/_build/stage1/lib/../lib/x86_64-linux-ghc-9.5.20220622/libHSdeepseq-1.4.7.0-ghc9.5.20220622.so" a31d063d48c6c1c7b10132d56b564497
-addDependentFile "/home/matt/ghc-ben/_build/stage1/lib/../lib/x86_64-linux-ghc-9.5.20220622/libHSpretty-1.1.3.6-ghc9.5.20220622.so" 7d0e89188b10c1de8c2894689ff11cac
-addDependentFile "/home/matt/ghc-ben/_build/stage1/lib/../lib/x86_64-linux-ghc-9.5.20220622/libHStemplate-haskell-2.18.0.0-ghc9.5.20220622.so" 67d8b5d7026175f7e9b3e214955acc69
+addDependentFile "/opt/exp/ghc/ghc-landing/_build/stage1/lib/../lib/x86_64-linux-ghc-9.9.20230719/libHSghc-prim-0.10.0-inplace-ghc9.9.20230719.so" 2a0f9fe8c1eff342164068b944ac5140
+addDependentFile "/opt/exp/ghc/ghc-landing/_build/stage1/lib/../lib/x86_64-linux-ghc-9.9.20230719/libHSghc-bignum-1.3-inplace-ghc9.9.20230719.so" b3fcc6243cdc9223f0e16da81f955c5b
+addDependentFile "/opt/exp/ghc/ghc-landing/_build/stage1/lib/../lib/x86_64-linux-ghc-9.9.20230719/libHSghc-internals-0.1.0.0-inplace-ghc9.9.20230719.so" ccdcfb93733c233eccc4e6ddca9bb7a0
+addDependentFile "/opt/exp/ghc/ghc-landing/_build/stage1/lib/../lib/x86_64-linux-ghc-9.9.20230719/libHSbase-4.18.0.0-inplace-ghc9.9.20230719.so" bc0db67a5cc041dad510cb138ad9d961
+addDependentFile "/opt/exp/ghc/ghc-landing/_build/stage1/lib/../lib/x86_64-linux-ghc-9.9.20230719/libHSghc-boot-th-9.9-inplace-ghc9.9.20230719.so" 3ad3ec85767d2a5733a76aba90955b95
+addDependentFile "/opt/exp/ghc/ghc-landing/_build/stage1/lib/../lib/x86_64-linux-ghc-9.9.20230719/libHSarray-0.5.5.0-inplace-ghc9.9.20230719.so" 1c42f992946d7d8235c96e4473ca0e3a
+addDependentFile "/opt/exp/ghc/ghc-landing/_build/stage1/lib/../lib/x86_64-linux-ghc-9.9.20230719/libHSdeepseq-1.4.8.1-inplace-ghc9.9.20230719.so" abfa55b96475568f79fb41a5c605f6cd
+addDependentFile "/opt/exp/ghc/ghc-landing/_build/stage1/lib/../lib/x86_64-linux-ghc-9.9.20230719/libHSpretty-1.1.3.6-inplace-ghc9.9.20230719.so" 8ac6d3de22a064bb929216716a2104d6
+addDependentFile "/opt/exp/ghc/ghc-landing/_build/stage1/lib/../lib/x86_64-linux-ghc-9.9.20230719/libHStemplate-haskell-2.20.0.0-inplace-ghc9.9.20230719.so" 70414b7d49e7cacfc5a939afc9b30f60


=====================================
testsuite/tests/interface-stability/all.T
=====================================
@@ -7,3 +7,4 @@ def check_package(pkg_name):
          [f'exports_{pkg_name}'])
 
 check_package('base')
+check_package('ghc-experimental')


=====================================
testsuite/tests/interface-stability/ghc-experimental-exports.stdout
=====================================
@@ -0,0 +1,3 @@
+
+
+-- Instances:



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/85d5f76da6a7efaaa960cab17f4d583a4049c9b7...d817f0ce4273a06b0f51a64a38fb0d3fbacb8c1c

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/85d5f76da6a7efaaa960cab17f4d583a4049c9b7...d817f0ce4273a06b0f51a64a38fb0d3fbacb8c1c
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/20230815/2d38c547/attachment-0001.html>


More information about the ghc-commits mailing list