From 88bbf8c5af345deb88fb51f0a50169759ff28296 Mon Sep 17 00:00:00 2001 From: Ben Gamari <ben@smart-cactus.org> Date: Wed, 19 Jul 2023 15:22:28 -0400 Subject: [PATCH] ghc-experimental: Initial commit --- .gitlab-ci.yml | 1 + docs/users_guide/9.10.1-notes.rst | 6 ++++ hadrian/src/Packages.hs | 7 +++-- hadrian/src/Rules/Lint.hs | 6 ++++ hadrian/src/Settings/Default.hs | 1 + libraries/ghc-experimental/CHANGELOG.md | 5 +++ libraries/ghc-experimental/LICENSE | 30 ++++++++++++++++++ .../ghc-experimental/ghc-experimental.cabal | 31 +++++++++++++++++++ libraries/ghc-experimental/src/Dummy.hs | 10 ++++++ testsuite/tests/interface-stability/all.T | 1 + .../ghc-experimental-exports.stdout | 3 ++ 11 files changed, 98 insertions(+), 3 deletions(-) create mode 100644 libraries/ghc-experimental/CHANGELOG.md create mode 100644 libraries/ghc-experimental/LICENSE create mode 100644 libraries/ghc-experimental/ghc-experimental.cabal create mode 100644 libraries/ghc-experimental/src/Dummy.hs create mode 100644 testsuite/tests/interface-stability/ghc-experimental-exports.stdout diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7c6d968a9b3d..8c2a9c6c4e41 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -351,6 +351,7 @@ lint-submods-branch: - .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 diff --git a/docs/users_guide/9.10.1-notes.rst b/docs/users_guide/9.10.1-notes.rst index f2814d6370bc..fe30b6119921 100644 --- a/docs/users_guide/9.10.1-notes.rst +++ b/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 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/hadrian/src/Packages.hs b/hadrian/src/Packages.hs index 101c06a18b6f..43a45f4770e7 100644 --- a/hadrian/src/Packages.hs +++ b/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, ghcInternal, ghci, ghciWrapper, ghcPkg, ghcPrim, + 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,7 +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, ghcInternal, ghci, ghciWrapper, ghcPkg, ghcPrim + , ghcCompact, ghcConfig, ghcExperimental, ghcHeap, ghcInternal, ghci, ghciWrapper, ghcPkg, ghcPrim , ghcToolchain, ghcToolchainBin, haddock, haskeline, hsc2hs , hp2ps, hpc, hpcBin, integerGmp, integerSimple, iserv, libffi, mtl , parsec, pretty, process, rts, runGhc, stm, semaphoreCompat, templateHaskell @@ -55,7 +55,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, ghcInternal, ghciWrapper, ghcPkg, ghcPrim, + ghcCompact, ghcConfig, ghcExperimental, ghcHeap, ghci, ghcInternal, ghciWrapper, ghcPkg, ghcPrim, ghcToolchain, ghcToolchainBin, haddock, haskeline, hsc2hs, hp2ps, hpc, hpcBin, integerGmp, integerSimple, iserv, iservProxy, remoteIserv, libffi, mtl, parsec, pretty, primitive, process, rts, runGhc, semaphoreCompat, stm, templateHaskell, @@ -90,6 +90,7 @@ 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" diff --git a/hadrian/src/Rules/Lint.hs b/hadrian/src/Rules/Lint.hs index 58fc568b53d2..deecee2082c8 100644 --- a/hadrian/src/Rules/Lint.hs +++ b/hadrian/src/Rules/Lint.hs @@ -11,6 +11,7 @@ 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 @@ -76,6 +77,11 @@ 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 diff --git a/hadrian/src/Settings/Default.hs b/hadrian/src/Settings/Default.hs index 82bb5ed0ddac..b26d5333c0ef 100644 --- a/hadrian/src/Settings/Default.hs +++ b/hadrian/src/Settings/Default.hs @@ -144,6 +144,7 @@ stage1Packages = do , ghc , ghcBignum , ghcCompact + , ghcExperimental , ghcInternal , ghcPkg , ghcPrim diff --git a/libraries/ghc-experimental/CHANGELOG.md b/libraries/ghc-experimental/CHANGELOG.md new file mode 100644 index 000000000000..af356522b7df --- /dev/null +++ b/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. diff --git a/libraries/ghc-experimental/LICENSE b/libraries/ghc-experimental/LICENSE new file mode 100644 index 000000000000..049d83a1a407 --- /dev/null +++ b/libraries/ghc-experimental/LICENSE @@ -0,0 +1,30 @@ +Copyright (c) 2023, ghc-devs@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@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. diff --git a/libraries/ghc-experimental/ghc-experimental.cabal b/libraries/ghc-experimental/ghc-experimental.cabal new file mode 100644 index 000000000000..7c7cf61d5036 --- /dev/null +++ b/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@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.19, + ghc-internal >= 0.1 && < 0.2 + hs-source-dirs: src + default-language: Haskell2010 diff --git a/libraries/ghc-experimental/src/Dummy.hs b/libraries/ghc-experimental/src/Dummy.hs new file mode 100644 index 000000000000..5ae990e20d9f --- /dev/null +++ b/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@. +module Dummy () where + +-- for build system ordering +import GHC.Base () diff --git a/testsuite/tests/interface-stability/all.T b/testsuite/tests/interface-stability/all.T index 8e86300bd1c4..759583f98246 100644 --- a/testsuite/tests/interface-stability/all.T +++ b/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') diff --git a/testsuite/tests/interface-stability/ghc-experimental-exports.stdout b/testsuite/tests/interface-stability/ghc-experimental-exports.stdout new file mode 100644 index 000000000000..34480e4ef503 --- /dev/null +++ b/testsuite/tests/interface-stability/ghc-experimental-exports.stdout @@ -0,0 +1,3 @@ + + +-- Instances: -- GitLab