[Git][ghc/ghc][master] Split GHC.Platform.ArchOS from ghc-boot into ghc-platform

Marge Bot (@marge-bot) gitlab at gitlab.haskell.org
Tue Jul 18 01:13:56 UTC 2023



Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
ddcdd88c by Rodrigo Mesquita at 2023-07-17T21:13:36-04:00
Split GHC.Platform.ArchOS from ghc-boot into ghc-platform

Split off the `GHC.Platform.ArchOS` module from the `ghc-boot` package
into this reinstallable standalone package which abides by the PVP, in
part motivated by the ongoing work on `ghc-toolchain` towards runtime
retargetability.

- - - - -


8 changed files:

- hadrian/src/Packages.hs
- hadrian/src/Rules/ToolArgs.hs
- hadrian/src/Settings/Default.hs
- libraries/ghc-boot/ghc-boot.cabal.in
- + libraries/ghc-platform/CHANGELOG.md
- + libraries/ghc-platform/LICENSE
- + libraries/ghc-platform/ghc-platform.cabal
- libraries/ghc-boot/GHC/Platform/ArchOS.hs → libraries/ghc-platform/src/GHC/Platform/ArchOS.hs


Changes:

=====================================
hadrian/src/Packages.hs
=====================================
@@ -4,7 +4,7 @@ module Packages (
     array, base, binary, bytestring, cabal, cabalSyntax, checkPpr,
     checkExact, countDeps,
     compareSizes, compiler, containers, deepseq, deriveConstants, directory, dumpDecls,
-    exceptions, filepath, genapply, genprimopcode, ghc, ghcBignum, ghcBoot, ghcBootTh,
+    exceptions, filepath, genapply, genprimopcode, ghc, ghcBignum, ghcBoot, ghcBootTh, ghcPlatform,
     ghcCompact, ghcConfig, ghcHeap, ghci, ghciWrapper, ghcPkg, ghcPrim, haddock, haskeline,
     hsc2hs, hp2ps, hpc, hpcBin, integerGmp, integerSimple, iserv, iservProxy,
     libffi, mtl, parsec, pretty, primitive, process, remoteIserv, rts,
@@ -36,7 +36,7 @@ ghcPackages :: [Package]
 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
+    , exceptions, filepath, genapply, genprimopcode, ghc, ghcBignum, ghcBoot, ghcBootTh, ghcPlatform
     , ghcCompact, ghcConfig, ghcHeap, ghci, ghciWrapper, ghcPkg, ghcPrim, haddock, haskeline, hsc2hs
     , hp2ps, hpc, hpcBin, integerGmp, integerSimple, iserv, libffi, mtl
     , parsec, pretty, process, rts, runGhc, stm, semaphoreCompat, templateHaskell
@@ -52,7 +52,7 @@ isGhcPackage = (`elem` ghcPackages)
 -- | Package definitions, see 'Package'.
 array, base, binary, bytestring, cabalSyntax, cabal, checkPpr, checkExact, countDeps,
   compareSizes, compiler, containers, deepseq, deriveConstants, directory, dumpDecls,
-  exceptions, filepath, genapply, genprimopcode, ghc, ghcBignum, ghcBoot, ghcBootTh,
+  exceptions, filepath, genapply, genprimopcode, ghc, ghcBignum, ghcBoot, ghcBootTh, ghcPlatform,
   ghcCompact, ghcConfig, ghcHeap, ghci, ghciWrapper, ghcPkg, ghcPrim, haddock, haskeline, hsc2hs,
   hp2ps, hpc, hpcBin, integerGmp, integerSimple, iserv, iservProxy, remoteIserv, libffi, mtl,
   parsec, pretty, primitive, process, rts, runGhc, semaphoreCompat, stm, templateHaskell,
@@ -84,6 +84,7 @@ ghc                 = prg  "ghc-bin"         `setPath` "ghc"
 ghcBignum           = lib  "ghc-bignum"
 ghcBoot             = lib  "ghc-boot"
 ghcBootTh           = lib  "ghc-boot-th"
+ghcPlatform         = lib  "ghc-platform"
 ghcCompact          = lib  "ghc-compact"
 ghcConfig           = prg  "ghc-config"      `setPath` "testsuite/ghc-config"
 ghcHeap             = lib  "ghc-heap"


=====================================
hadrian/src/Rules/ToolArgs.hs
=====================================
@@ -158,6 +158,7 @@ toolTargets = [ binary
               -- , runGhc  -- # depends on ghc library
               , ghcBoot
               , ghcBootTh
+              , ghcPlatform
               , ghcHeap
               , ghci
               , ghcPkg  -- # executable


=====================================
hadrian/src/Settings/Default.hs
=====================================
@@ -85,6 +85,7 @@ stage0Packages = do
              , runGhc
              , ghcBoot
              , ghcBootTh
+             , ghcPlatform
              , ghcHeap
              , ghci
              , ghcPkg


=====================================
libraries/ghc-boot/ghc-boot.cabal.in
=====================================
@@ -51,7 +51,6 @@ Library
             GHC.Serialized
             GHC.ForeignSrcLang
             GHC.HandleEncoding
-            GHC.Platform.ArchOS
             GHC.Platform.Host
             GHC.Settings.Utils
             GHC.UniqueSubdir
@@ -65,6 +64,10 @@ Library
             , GHC.ForeignSrcLang.Type
             , GHC.Lexeme
 
+    -- reexport platform modules from ghc-platform
+    reexported-modules:
+              GHC.Platform.ArchOS
+
     -- but done by Hadrian
     autogen-modules:
             GHC.Version
@@ -77,6 +80,7 @@ Library
                    directory  >= 1.2 && < 1.4,
                    filepath   >= 1.3 && < 1.5,
                    deepseq    >= 1.4 && < 1.5,
+                   ghc-platform >= 0.1,
                    ghc-boot-th == @ProjectVersionMunged@
     if !os(windows)
         build-depends:


=====================================
libraries/ghc-platform/CHANGELOG.md
=====================================
@@ -0,0 +1,7 @@
+# Revision history for ghc-platform
+
+## 0.1.0.0 -- 2023-06-20
+
+* First version. Split off the `GHC.Platform.ArchOS` module from the `ghc-boot`
+    package into this reinstallable standalone package which abides by the PVP,
+    in part motivated by the ongoing work on `ghc-toolchain` towards runtime retargetability.


=====================================
libraries/ghc-platform/LICENSE
=====================================
@@ -0,0 +1,30 @@
+Copyright (c) 2023, Rodrigo Mesquita
+
+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 Rodrigo Mesquita 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-platform/ghc-platform.cabal
=====================================
@@ -0,0 +1,20 @@
+cabal-version:      3.0
+name:               ghc-platform
+version:            0.1.0.0
+synopsis:           Platform information used by GHC and friends
+license:            BSD-3-Clause
+license-file:       LICENSE
+author:             Rodrigo Mesquita
+maintainer:         ghc-devs at haskell.org
+build-type:         Simple
+extra-doc-files:    CHANGELOG.md
+
+common warnings
+    ghc-options: -Wall
+
+library
+    import:           warnings
+    exposed-modules:  GHC.Platform.ArchOS
+    build-depends:    base >=4.15.0.0
+    hs-source-dirs:   src
+    default-language: Haskell2010


=====================================
libraries/ghc-boot/GHC/Platform/ArchOS.hs → libraries/ghc-platform/src/GHC/Platform/ArchOS.hs
=====================================
@@ -1,17 +1,19 @@
 {-# LANGUAGE LambdaCase, ScopedTypeVariables #-}
 
 -- | Platform architecture and OS
---
--- We need it in ghc-boot because ghc-pkg needs it.
 module GHC.Platform.ArchOS
    ( ArchOS(..)
+
+     -- * Architectures
    , Arch(..)
-   , OS(..)
    , ArmISA(..)
    , ArmISAExt(..)
    , ArmABI(..)
    , PPC_64ABI(..)
    , stringEncodeArch
+
+     -- * Operating systems
+   , OS(..)
    , stringEncodeOS
    )
 where
@@ -27,10 +29,6 @@ data ArchOS
    deriving (Read, Show, Eq, Ord)
 
 -- | Architectures
---
--- TODO: It might be nice to extend these constructors with information about
--- what instruction set extensions an architecture might support.
---
 data Arch
    = ArchUnknown
    | ArchX86



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/ddcdd88c2c95445a87ee028f215d1e876939a4d9

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/ddcdd88c2c95445a87ee028f215d1e876939a4d9
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/20230717/9d93b3e9/attachment-0001.html>


More information about the ghc-commits mailing list