[Git][ghc/ghc][wip/T24789] 5 commits: Make UnsafeSNat et al. into pattern synonyms

Serge S. Gulin (@gulin.serge) gitlab at gitlab.haskell.org
Fri May 31 09:20:49 UTC 2024



Serge S. Gulin pushed to branch wip/T24789 at Glasgow Haskell Compiler / GHC


Commits:
d10a1c65 by Matthew Craven at 2024-05-30T23:35:48-04:00
Make UnsafeSNat et al. into pattern synonyms

...so that they do not cause coerce to bypass the nominal
role on the corresponding singleton types when they are imported.
See Note [Preventing unsafe coercions for singleton types] and
the discussion at #23478.

This also introduces unsafeWithSNatCo (and analogues for Char
and Symbol) so that users can still access the dangerous coercions
that importing the real constructors would allow, but only in a
very localized way.

- - - - -
0958937e by Cheng Shao at 2024-05-30T23:36:25-04:00
hadrian: build C/C++ with split sections when enabled

When split sections is enabled, ensure -fsplit-sections is passed to
GHC as well when invoking GHC to compile C/C++; and pass
-ffunction-sections -fdata-sections to gcc/clang when compiling C/C++
with the hadrian Cc builder. Fixes #23381.

- - - - -
02b1f91e by Cheng Shao at 2024-05-30T23:36:25-04:00
driver: build C/C++ with -ffunction-sections -fdata-sections when split sections is enabled

When -fsplit-sections is passed to GHC, pass -ffunction-sections
-fdata-sections to gcc/clang when building C/C++. Previously,
-fsplit-sections was only respected by the NCG/LLVM backends, but not
the unregisterised backend; the GHC driver did not pass
-fdata-sections and -ffunction-sections to the C compiler, which
resulted in excessive executable sizes.

Fixes #23381.

-------------------------
Metric Decrease:
    size_hello_artifact
    size_hello_unicode
-------------------------

- - - - -
fd47e2e3 by Cheng Shao at 2024-05-30T23:37:00-04:00
testsuite: mark process005 as fragile on JS

- - - - -
0fd38338 by Serge S. Gulin at 2024-05-31T09:20:42+00:00
Unicode: make ucd2haskell build-able again

ucd2haskell tool used streamly library which version in cabal was out of date. It is updated to the latest version at hackage with deprecated parts rewritten.

Also following fixes were applied to existing code in suppose that from its last run the code structure was changed and now it was required to be up to date with actual folder structures:
1. Ghc module path environment got a suffix with `src`.
2. Generated code got
2.1 `GHC.Internal` prefix for `Data.*`.
2.2 `GHC.Unicode.Internal` swapped on `GHC.Internal.Unicode` according to actual structure.

- - - - -


10 changed files:

- compiler/GHC/Driver/Pipeline/Execute.hs
- hadrian/src/Settings/Builders/SplitSections.hs
- libraries/ghc-internal/src/GHC/Internal/TypeLits.hs
- libraries/ghc-internal/src/GHC/Internal/TypeNats.hs
- libraries/ghc-internal/tools/ucd2haskell/README.md
- libraries/ghc-internal/tools/ucd2haskell/exe/Parser/Text.hs
- libraries/ghc-internal/tools/ucd2haskell/ucd.sh
- libraries/ghc-internal/tools/ucd2haskell/ucd2haskell.cabal
- testsuite/tests/ghci/scripts/T9181.stdout
- testsuite/tests/process/all.T


Changes:

=====================================
compiler/GHC/Driver/Pipeline/Execute.hs
=====================================
@@ -487,6 +487,13 @@ runCcPhase cc_phase pipe_env hsc_env location input_fn = do
                     , not $ target32Bit (targetPlatform dflags)
                     ]
 
+                 -- if -fsplit-sections is enabled, we should also
+                 -- build with these flags.
+                 ++ (if gopt Opt_SplitSections dflags &&
+                      platformOS (targetPlatform dflags) /= OSDarwin
+                        then ["-ffunction-sections", "-fdata-sections"]
+                        else [])
+
           -- Stub files generated for foreign exports references the runIO_closure
           -- and runNonIO_closure symbols, which are defined in the base package.
           -- These symbols are imported into the stub.c file via RtsAPI.h, and the


=====================================
hadrian/src/Settings/Builders/SplitSections.hs
=====================================
@@ -29,6 +29,9 @@ splitSectionsArgs = do
     ) then
     ( mconcat
         [ builder (Ghc CompileHs) ? arg "-fsplit-sections"
+        , builder (Ghc CompileCWithGhc) ? arg "-fsplit-sections"
+        , builder (Ghc CompileCppWithGhc) ? arg "-fsplit-sections"
+        , builder (Cc CompileC) ? arg "-ffunction-sections" <> arg "-fdata-sections"
         , builder MergeObjects ? ifM (expr isWinTarget)
             (pure ["-T", "driver/utils/merge_sections_pe.ld"])
             (pure ["-T", "driver/utils/merge_sections.ld"])


=====================================
libraries/ghc-internal/src/GHC/Internal/TypeLits.hs
=====================================
@@ -16,6 +16,7 @@
 {-# LANGUAGE PolyKinds #-}
 {-# LANGUAGE ViewPatterns #-}
 {-# LANGUAGE RoleAnnotations #-}
+{-# LANGUAGE QuantifiedConstraints #-}
 
 {-|
 GHC's @DataKinds@ language extension lifts data constructors, natural
@@ -49,11 +50,18 @@ module GHC.Internal.TypeLits
   , OrderingI(..)
   , N.cmpNat, cmpSymbol, cmpChar
     -- ** Singleton values
-  , N.SNat (..), SSymbol (..), SChar (..)
+  , N.SNat (..)
+  , SSymbol (UnsafeSSymbol)
+      -- We export a pattern synonym instead of the real constructor:
+      -- See Note [Preventing unsafe coercions for singleton types].
+  , SChar (UnsafeSChar)
+      -- We export a pattern synonym instead of the real constructor:
+      -- See Note [Preventing unsafe coercions for singleton types].
   , pattern N.SNat, pattern SSymbol, pattern SChar
   , fromSNat, fromSSymbol, fromSChar
   , withSomeSNat, withSomeSSymbol, withSomeSChar
   , N.withKnownNat, withKnownSymbol, withKnownChar
+  , N.unsafeWithSNatCo, unsafeWithSSymbolCo, unsafeWithSCharCo
 
     -- * Functions on type literals
   , type (N.<=), type (N.<=?), type (N.+), type (N.*), type (N.^), type (N.-)
@@ -72,7 +80,7 @@ module GHC.Internal.TypeLits
 import GHC.Internal.Base ( Bool(..), Eq(..), Functor(..), Ord(..), Ordering(..), String
                 , (.), otherwise, withDict, Void, (++)
                 , errorWithoutStackTrace)
-import GHC.Types(Symbol, Char, TYPE)
+import GHC.Types(Symbol, Char, TYPE, Coercible)
 import GHC.Internal.TypeError(ErrorMessage(..), TypeError)
 import GHC.Internal.Num(Integer, fromInteger)
 import GHC.Internal.Show(Show(..), appPrec, appPrec1, showParen, showString)
@@ -340,7 +348,9 @@ withSomeSNat n k
 --    'String'.
 --
 -- @since base-4.18.0.0
-newtype SSymbol (s :: Symbol) = UnsafeSSymbol String
+newtype SSymbol (s :: Symbol) = UnsafeSSymbol_ String
+-- nominal role: See Note [Preventing unsafe coercions for singleton types]
+-- in GHC.Internal.TypeNats
 type role SSymbol nominal
 
 -- | A explicitly bidirectional pattern synonym relating an 'SSymbol' to a
@@ -377,6 +387,26 @@ data KnownSymbolInstance (s :: Symbol) where
 knownSymbolInstance :: SSymbol s -> KnownSymbolInstance s
 knownSymbolInstance ss = withKnownSymbol ss KnownSymbolInstance
 
+-- | A pattern that can be used to manipulate the
+-- 'String' that an @SSymbol s@ contains under the hood.
+--
+-- When using this pattern to construct an @SSymbol s@, the actual
+-- @String@ being stored in the @SSymbol@ /must/ be equal to (the
+-- contents of) @s at .  The compiler will not help you verify this,
+-- hence the \'unsafe\' name.
+pattern UnsafeSSymbol :: forall s. String -> SSymbol s
+pattern UnsafeSSymbol guts = UnsafeSSymbol_ guts
+{-# COMPLETE UnsafeSSymbol #-}
+
+-- | 'unsafeWithSSymbolCo' allows uses of @coerce@ in its argument to see the
+-- real representation of @SSymbol s@, without undermining the type-safety of
+-- @coerce@ elsewhere in the module.
+--
+-- See also the documentation for 'UnsafeSSymbol'.
+unsafeWithSSymbolCo
+  :: forall r. ((forall s. Coercible (SSymbol s) String) => r) -> r
+unsafeWithSSymbolCo v = v
+
 -- | @since base-4.19.0.0
 instance Eq (SSymbol s) where
   _ == _ = True
@@ -443,7 +473,9 @@ withSomeSSymbol s k = k (UnsafeSSymbol s)
 -- 3. The 'withSomeSChar' function, which creates an 'SChar' from a 'Char'.
 --
 -- @since base-4.18.0.0
-newtype SChar (s :: Char) = UnsafeSChar Char
+newtype SChar (s :: Char) = UnsafeSChar_ Char
+-- nominal role: See Note [Preventing unsafe coercions for singleton types]
+-- in GHC.Internal.TypeNats
 type role SChar nominal
 
 -- | A explicitly bidirectional pattern synonym relating an 'SChar' to a
@@ -480,6 +512,25 @@ data KnownCharInstance (n :: Char) where
 knownCharInstance :: SChar c -> KnownCharInstance c
 knownCharInstance sc = withKnownChar sc KnownCharInstance
 
+-- | A pattern that can be used to manipulate the
+-- 'Char' that an @SChar c@ contains under the hood.
+--
+-- When using this pattern to construct an @SChar c@, the actual
+-- @Char@ being stored in the @SChar c@ /must/ be equal to @c at .
+-- The compiler will not help you verify this, hence the \'unsafe\' name.
+pattern UnsafeSChar :: forall c. Char -> SChar c
+pattern UnsafeSChar guts = UnsafeSChar_ guts
+{-# COMPLETE UnsafeSChar #-}
+
+-- | 'unsafeWithSCharCo' allows uses of @coerce@ in its argument to see the
+-- real representation of @SChar c@, without undermining the type-safety of
+-- @coerce@ elsewhere in the module.
+--
+-- See also the documentation for 'UnsafeSChar'.
+unsafeWithSCharCo
+  :: forall r. ((forall c. Coercible (SChar c) Char) => r) -> r
+unsafeWithSCharCo v = v
+
 -- | @since base-4.19.0.0
 instance Eq (SChar c) where
   _ == _ = True


=====================================
libraries/ghc-internal/src/GHC/Internal/TypeNats.hs
=====================================
@@ -17,6 +17,7 @@
 {-# LANGUAGE PatternSynonyms #-}
 {-# LANGUAGE ViewPatterns #-}
 {-# LANGUAGE RoleAnnotations #-}
+{-# LANGUAGE QuantifiedConstraints #-}
 
 {-| This module is an internal GHC module.  It declares the constants used
 in the implementation of type-level natural numbers.  The programmer interface
@@ -36,11 +37,14 @@ module GHC.Internal.TypeNats
   , sameNat
   , decideNat
     -- ** Singleton values
-  , SNat (..)
+  , SNat (UnsafeSNat)
+      -- We export a pattern synonym instead of the real constructor:
+      -- See Note [Preventing unsafe coercions for singleton types].
   , pattern SNat
   , fromSNat
   , withSomeSNat
   , withKnownNat
+  , unsafeWithSNatCo
 
     -- * Functions on type literals
   , type (<=), type (<=?), type (+), type (*), type (^), type (-)
@@ -344,9 +348,60 @@ cmpNat x y = case compare (natVal x) (natVal y) of
 --    number.
 --
 -- @since base-4.18.0.0
-newtype SNat (n :: Nat) = UnsafeSNat Natural
+newtype SNat (n :: Nat) = UnsafeSNat_ Natural
+-- nominal role: See Note [Preventing unsafe coercions for singleton types]
 type role SNat nominal
 
+{-
+Note [Preventing unsafe coercions for singleton types]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Consider a singleton type like this one:
+
+  newtype SNat (n :: Nat) = UnsafeSNat_ Natural
+
+We operate under the fiction that a (non-bottom) value
+``UnsafeSNat_ v :: SNat n`` also contains evidence that the value
+``v :: Natural`` is the same as the type ``n :: Natural``.
+Such evidence can only be safely ``coerce``d to evidence that the
+value ``v`` is the same as some other type ``n2`` if we know that
+``n ~ n2``, at nominal role. (This is #23454.)
+
+So, to preserve that fiction, we:
+
+ 1. Provide a role annotation indicating that ``SNat``'s type argument has
+    nominal role rather than the phantom role that would be inferred.
+ 2. Ensure that the real newtype constructor ``UnsafeSNat_`` is not
+    exported even from ghc-internal.  Whenever that constructor is in
+    scope, typechecking of ``coerce`` will ignore the role annotation
+    and just unwrap the newtype.
+
+But users may wish to write functions like this one (#23478):
+
+  plusSNat :: SNat a -> SNat b -> SNat (a + b)
+
+We could ask them to use ``unsafeCoerce``, but it seems a bit more polite
+to provide a pattern synonym ``UnsafeSNat :: forall n. Natural -> SNat n``
+as an escape hatch (exported from ghc-internal only), so that such a function
+can be written as follows:
+
+  plusSNat (UnsafeSNat x) (UnsafeSNat y) = UnsafeSNat (x + y)
+
+Crucially, these pattern synonyms (unlike real newtype constructors) do not
+cause ``coerce`` to bypass our role annotation when they are in scope.
+
+To allow casting data structures containing SNats, we provide a
+further escape hatch in ``unsafeWithSNatCo``, which enables ``coerce`` to
+bypass our role annotation on ``SNat``, but /only within its argument/:
+
+  unsafeWithSNatCo
+    :: forall r. ((forall n. Coercible (SNat n) Natural) => r) -> r
+
+
+The above reasoning applies identically for the other singleton types
+'SChar' and 'SSymbol' as well.
+-}
+
+
 -- | A explicitly bidirectional pattern synonym relating an 'SNat' to a
 -- 'KnownNat' constraint.
 --
@@ -381,6 +436,25 @@ data KnownNatInstance (n :: Nat) where
 knownNatInstance :: SNat n -> KnownNatInstance n
 knownNatInstance sn = withKnownNat sn KnownNatInstance
 
+-- | A pattern that can be used to manipulate the
+-- 'Natural' that an @SNat n@ contains under the hood.
+--
+-- When using this pattern to construct an @SNat n@, the actual
+-- @Natural@ being stored in the @SNat n@ /must/ be equal to @n at .
+-- The compiler will not help you verify this, hence the \'unsafe\' name.
+pattern UnsafeSNat :: forall n. Natural -> SNat n
+pattern UnsafeSNat guts = UnsafeSNat_ guts
+{-# COMPLETE UnsafeSNat #-}
+
+-- | 'unsafeWithSNatCo' allows uses of @coerce@ in its argument to see the
+-- real representation of @SNat n@, without undermining the type-safety of
+-- @coerce@ elsewhere in the module.
+--
+-- See also the documentation for 'UnsafeSNat'.
+unsafeWithSNatCo
+  :: forall r. ((forall n. Coercible (SNat n) Natural) => r) -> r
+unsafeWithSNatCo v = v
+
 -- | @since base-4.19.0.0
 instance Eq (SNat n) where
   _ == _ = True


=====================================
libraries/ghc-internal/tools/ucd2haskell/README.md
=====================================
@@ -1,6 +1,6 @@
 # Generating GHC’s Unicode modules
 
-`GHC.Unicode.Internal.*` modules are generated with the internal tool `ucd2haskell`.
+`GHC.Internal.Unicode.*` modules are generated with the internal tool `ucd2haskell`.
 
 ```bash
 cd ucd2haskell
@@ -13,7 +13,7 @@ cd ucd2haskell
 2. _Comment_ the line in `ucd.sh` with `VERIFY_CHECKSUM=y`.
 3. Run `./ucd.sh download`.
 4. Update the checksums in `ucd.sh` and _uncomment_ `VERIFY_CHECKSUM=y`.
-5. Run `./ucd.sh generate`. This will generate the `GHC.Unicode.Internal.*` 
+5. Run `./ucd.sh generate`. This will generate the `GHC.Internal.Unicode.*`
    modules.
 6. Check and update the output of the tests `base/tests/unicodeXXX.hs`.
 7. Compare with Python (see hereinafter) and fix any error.
@@ -32,7 +32,7 @@ __Warning:__ A Python version with the _exact same Unicode version_ is required.
 Check the properties of all the characters.
 
 ```bash
-ghc -O2 tests/export_all_chars.hs 
+ghc -O2 tests/export_all_chars.hs
 ./tests/export_all_chars > tests/all_chars.csv
 python3 tests/check_all_chars.py tests/all_chars.csv
 ```


=====================================
libraries/ghc-internal/tools/ucd2haskell/exe/Parser/Text.hs
=====================================
@@ -21,7 +21,6 @@ module Parser.Text (genModules) where
 
 import Control.Exception (catch, IOException)
 import Control.Monad (void)
-import Control.Monad.IO.Class (MonadIO(liftIO))
 import Data.Bits (Bits(..))
 import Data.Word (Word8)
 import Data.Char (chr, ord, isSpace)
@@ -31,19 +30,20 @@ import Data.List (intersperse, unfoldr)
 import Data.List.Split (splitWhen)
 import Numeric (showHex)
 import Streamly.Data.Fold (Fold)
-import Streamly.Prelude (IsStream, SerialT)
 import System.Directory (createDirectoryIfMissing)
 import System.Environment (getEnv)
 import System.FilePath ((</>), (<.>))
 
 -- import qualified Data.Set as Set
-import qualified Streamly.Prelude as Stream
+import Streamly.Data.Stream (Stream)
+import qualified Streamly.Data.Stream.Prelude as Stream
 import qualified Streamly.Data.Fold as Fold
 import qualified Streamly.Internal.Data.Fold as Fold
 import qualified Streamly.Data.Unfold as Unfold
 import qualified Streamly.FileSystem.Handle as Handle
-import qualified System.IO as Sys
 import qualified Streamly.Unicode.Stream as Unicode
+import qualified Streamly.Internal.Unicode.Stream as Unicode
+import qualified System.IO as Sys
 
 import Prelude hiding (pred)
 
@@ -271,7 +271,7 @@ genUnicodeVersion outdir = do
               (\(_ :: IOException) -> return "<unknown>")
   Stream.fold f (Stream.fromList (body version))
   where
-    moduleName = "GHC.Unicode.Internal.Version"
+    moduleName = "GHC.Internal.Unicode.Version"
     f = moduleFileEmitter Nothing outdir
           (moduleName, \_ -> Fold.foldMap (<> "\n"))
     body :: String -> [String]
@@ -284,12 +284,12 @@ genUnicodeVersion outdir = do
       , "(unicodeVersion)"
       , "where"
       , ""
-      , "import {-# SOURCE #-} Data.Version"
+      , "import {-# SOURCE #-} GHC.Internal.Data.Version"
       , ""
       , "-- | Version of Unicode standard used by @base@:"
       , "-- [" <> version <> "](https://www.unicode.org/versions/Unicode" <> version <> "/)."
       , "--"
-      , "-- @since 4.15.0.0"
+      , "-- @since base-4.15.0.0"
       , "unicodeVersion :: Version"
       , "unicodeVersion = makeVersion [" <> mkVersion version <> "]" ]
     mkVersion = foldr (\c acc -> case c of {'.' -> ',':' ':acc; _ -> c:acc}) mempty
@@ -331,8 +331,8 @@ genGeneralCategoryModule moduleName =
         , "(generalCategory)"
         , "where"
         , ""
-        , "import GHC.Base (Char, Int, Ord(..), ord)"
-        , "import GHC.Unicode.Internal.Bits (lookupIntN)"
+        , "import GHC.Internal.Base (Char, Int, Ord(..), ord)"
+        , "import GHC.Internal.Unicode.Bits (lookupIntN)"
         , ""
         , genEnumBitmap "generalCategory" Cn (reverse acc)
         ]
@@ -415,7 +415,7 @@ genDecomposableModule moduleName dtype =
             , "where"
             , ""
             , "import Data.Char (ord)"
-            , "import GHC.Unicode.Internal.Bits (lookupBit64)"
+            , "import GHC.Internal.Unicode.Bits (lookupBit64)"
             , ""
             , genBitmap "isDecomposable" (reverse st)
             ]
@@ -443,7 +443,7 @@ genCombiningClassModule moduleName =
             , "where"
             , ""
             , "import Data.Char (ord)"
-            , "import GHC.Unicode.Internal.Bits (lookupBit64)"
+            , "import GHC.Internal.Unicode.Bits (lookupBit64)"
             , ""
             , "combiningClass :: Char -> Int"
             , unlines (reverse st1)
@@ -566,8 +566,8 @@ genCompositionsModule moduleName compExclu non0CC =
         , "(compose, composeStarters, isSecondStarter)"
         , "where"
         , ""
-        , "import GHC.Base (Char, ord)"
-        , "import GHC.Unicode.Internal.Bits (lookupBit64)"
+        , "import GHC.Internal.Base (Char, ord)"
+        , "import GHC.Internal.Unicode.Bits (lookupBit64)"
         , ""
         ]
 
@@ -616,7 +616,7 @@ genSimpleCaseMappingModule moduleName funcName field =
         , "(" <> funcName <> ")"
         , "where"
         , ""
-        , "import GHC.Base (Char)"
+        , "import GHC.Internal.Base (Char)"
         , ""
         ]
     genSign =
@@ -670,8 +670,8 @@ genCorePropertiesModule moduleName isProp =
         , "(" <> unwords (intersperse "," (map prop2FuncName exports)) <> ")"
         , "where"
         , ""
-        , "import GHC.Base (Bool, Char, Ord(..), (&&), ord)"
-        , "import GHC.Unicode.Internal.Bits (lookupBit64)"
+        , "import GHC.Internal.Base (Bool, Char, Ord(..), (&&), ord)"
+        , "import GHC.Internal.Unicode.Bits (lookupBit64)"
         , ""
         ]
 
@@ -818,7 +818,7 @@ parsePropertyLine ln
 isDivider :: String -> Bool
 isDivider x = x == "# ================================================"
 
-parsePropertyLines :: (IsStream t, Monad m) => t m String -> t m PropertyLine
+parsePropertyLines :: (Monad m) => Stream m String -> Stream m PropertyLine
 parsePropertyLines =
     Stream.splitOn isDivider
         $ Fold.lmap parsePropertyLine
@@ -843,11 +843,11 @@ Parse ranges according to https://www.unicode.org/reports/tr44/#Code_Point_Range
 __Note:__ this does /not/ fill missing char entries,
 i.e. entries with no explicit entry nor within a range.
 -}
-parseUnicodeDataLines :: forall t m. (IsStream t, Monad m) => t m String -> t m DetailedChar
+parseUnicodeDataLines :: forall m. (Monad m) => Stream m String -> Stream m DetailedChar
 parseUnicodeDataLines
     = Stream.unfoldMany (Unfold.unfoldr unitToRange)
     . Stream.foldMany ( Fold.lmap parseDetailedChar
-                      $ Fold.mkFold_ step initial )
+                      $ Fold.foldt' step initial id)
 
     where
 
@@ -913,19 +913,14 @@ parseDetailedChar line = case splitWhen (== ';') line of
 -- Generation
 -------------------------------------------------------------------------------
 
-readLinesFromFile :: String -> SerialT IO String
+readLinesFromFile :: String -> Stream IO String
 readLinesFromFile file =
     withFile file Sys.ReadMode
-        $ \h ->
-              Stream.unfold Handle.read h & Unicode.decodeUtf8
-                  & unicodeLines Fold.toList
+        $ \h -> Handle.read h & Unicode.decodeUtf8 & Unicode.lines Fold.toList
 
     where
-
-    unicodeLines = Stream.splitOnSuffix (== '\n')
-
     withFile file_ mode =
-        Stream.bracket (liftIO $ Sys.openFile file_ mode) (liftIO . Sys.hClose)
+        Stream.bracketIO (Sys.openFile file_ mode) (Sys.hClose)
 
 
 moduleToFileName :: String -> String
@@ -995,7 +990,7 @@ testOutputFileEmitter outdir (name, fldGen) = Fold.rmapM action fldGen
 runGenerator ::
        FilePath
     -> FilePath
-    -> (SerialT IO String -> SerialT IO a)
+    -> (Stream IO String -> Stream IO a)
     -> FilePath
     -> GeneratorRecipe a
     -> IO ()
@@ -1067,64 +1062,64 @@ genModules indir outdir props = do
 
     -- [NOTE] Disabled generator
     -- propList =
-    --     ("GHC.Unicode.Internal.Char.PropList"
+    --     ("GHC.Internal.Unicode.Char.PropList"
     --     , (`genCorePropertiesModule` (`elem` props)))
 
     derivedCoreProperties =
-        ("GHC.Unicode.Internal.Char.DerivedCoreProperties"
+        ("GHC.Internal.Unicode.Char.DerivedCoreProperties"
         , (`genCorePropertiesModule` (`elem` props)))
 
     -- [NOTE] Disabled generator
     -- compositions exc non0 =
-    --     ( "GHC.Unicode.Internal.Char.UnicodeData.Compositions"
+    --     ( "GHC.Internal.Unicode.Char.UnicodeData.Compositions"
     --     , \m -> genCompositionsModule m exc non0)
 
     -- [NOTE] Disabled generator
     -- combiningClass =
-    --     ( "GHC.Unicode.Internal.Char.UnicodeData.CombiningClass"
+    --     ( "GHC.Internal.Unicode.Char.UnicodeData.CombiningClass"
     --     , genCombiningClassModule)
 
     -- [NOTE] Disabled generator
     -- decomposable =
-    --     ( "GHC.Unicode.Internal.Char.UnicodeData.Decomposable"
+    --     ( "GHC.Internal.Unicode.Char.UnicodeData.Decomposable"
     --     , (`genDecomposableModule` Canonical))
 
     -- [NOTE] Disabled generator
     -- decomposableK =
-    --     ( "GHC.Unicode.Internal.Char.UnicodeData.DecomposableK"
+    --     ( "GHC.Internal.Unicode.Char.UnicodeData.DecomposableK"
     --     , (`genDecomposableModule` Kompat))
 
     -- [NOTE] Disabled generator
     -- decompositions =
-    --     ( "GHC.Unicode.Internal.Char.UnicodeData.Decompositions"
+    --     ( "GHC.Internal.Unicode.Char.UnicodeData.Decompositions"
     --     , \m -> genDecomposeDefModule m [] [] Canonical (const True))
 
     -- [NOTE] Disabled generator
     -- decompositionsK2 =
-    --     ( "GHC.Unicode.Internal.Char.UnicodeData.DecompositionsK2"
+    --     ( "GHC.Internal.Unicode.Char.UnicodeData.DecompositionsK2"
     --     , \m -> genDecomposeDefModule m [] [] Kompat (>= 60000))
 
     -- [NOTE] Disabled generator
     -- decompositionsK =
     --     let pre = ["import qualified " <> fst decompositionsK2 <> " as DK2", ""]
     --         post = ["decompose c = DK2.decompose c"]
-    --      in ( "GHC.Unicode.Internal.Char.UnicodeData.DecompositionsK"
+    --      in ( "GHC.Internal.Unicode.Char.UnicodeData.DecompositionsK"
     --         , \m -> genDecomposeDefModule m pre post Kompat (< 60000))
 
     generalCategory =
-         ( "GHC.Unicode.Internal.Char.UnicodeData.GeneralCategory"
+         ( "GHC.Internal.Unicode.Char.UnicodeData.GeneralCategory"
          , genGeneralCategoryModule)
 
     simpleUpperCaseMapping =
-         ( "GHC.Unicode.Internal.Char.UnicodeData.SimpleUpperCaseMapping"
+         ( "GHC.Internal.Unicode.Char.UnicodeData.SimpleUpperCaseMapping"
          , \m -> genSimpleCaseMappingModule m "toSimpleUpperCase" _simpleUppercaseMapping)
 
     simpleLowerCaseMapping =
-         ( "GHC.Unicode.Internal.Char.UnicodeData.SimpleLowerCaseMapping"
+         ( "GHC.Internal.Unicode.Char.UnicodeData.SimpleLowerCaseMapping"
          , \m -> genSimpleCaseMappingModule m "toSimpleLowerCase" _simpleLowercaseMapping)
 
     simpleTitleCaseMapping =
-         ( "GHC.Unicode.Internal.Char.UnicodeData.SimpleTitleCaseMapping"
+         ( "GHC.Internal.Unicode.Char.UnicodeData.SimpleTitleCaseMapping"
          , \m -> genSimpleCaseMappingModule m "toSimpleTitleCase" _simpleTitlecaseMapping)
 
     -- unicode002Test =


=====================================
libraries/ghc-internal/tools/ucd2haskell/ucd.sh
=====================================
@@ -52,7 +52,7 @@ download_files() {
     done
 }
 
-GHC_MODULE_PATH=$(realpath "$SCRIPT_DIR/../../")
+GHC_MODULE_PATH=$(realpath "$SCRIPT_DIR/../../src")
 
 # Generate the Haskell files.
 run_generator() {
@@ -63,7 +63,7 @@ run_generator() {
           --core-prop Uppercase \
           --core-prop Lowercase
         # [NOTE] disabled generator
-        #   --core-prop Alphabetic 
+        #   --core-prop Alphabetic
         #   --core-prop White_Space \
         #   --core-prop ID_Start \
         #   --core-prop ID_Continue \


=====================================
libraries/ghc-internal/tools/ucd2haskell/ucd2haskell.cabal
=====================================
@@ -52,10 +52,11 @@ executable ucd2haskell
   main-is: UCD2Haskell.hs
   other-modules: Parser.Text
   build-depends:
-      base             >= 4.7   && < 4.18
-    , streamly         >= 0.8   && < 0.9
+      base             >= 4.7   && < 4.20
+    , streamly-core    >= 0.2.2 && < 0.3
+    , streamly         >= 0.10   && < 0.11
     , split            >= 0.2.3 && < 0.3
     , getopt-generics  >= 0.13  && < 0.14
     , containers       >= 0.5   && < 0.7
-    , directory        >= 1.3.6 && < 1.3.7
+    , directory        >= 1.3.6 && < 1.3.8
     , filepath         >= 1.4.2 && < 1.5


=====================================
testsuite/tests/ghci/scripts/T9181.stdout
=====================================
@@ -99,7 +99,7 @@ pattern GHC.Internal.TypeLits.SChar
 type role GHC.Internal.TypeLits.SChar nominal
 type GHC.Internal.TypeLits.SChar :: Char -> *
 newtype GHC.Internal.TypeLits.SChar s
-  = GHC.Internal.TypeLits.UnsafeSChar Char
+  = GHC.Internal.TypeLits.UnsafeSChar_ Char
 pattern GHC.Internal.TypeNats.SNat
   :: () =>
      GHC.Internal.TypeNats.KnownNat n =>
@@ -107,7 +107,7 @@ pattern GHC.Internal.TypeNats.SNat
 type role GHC.Internal.TypeNats.SNat nominal
 type GHC.Internal.TypeNats.SNat :: GHC.Internal.TypeNats.Nat -> *
 newtype GHC.Internal.TypeNats.SNat n
-  = GHC.Internal.TypeNats.UnsafeSNat GHC.Num.Natural.Natural
+  = GHC.Internal.TypeNats.UnsafeSNat_ GHC.Num.Natural.Natural
 pattern GHC.Internal.TypeLits.SSymbol
   :: () =>
      GHC.Internal.TypeLits.KnownSymbol s =>
@@ -115,7 +115,7 @@ pattern GHC.Internal.TypeLits.SSymbol
 type role GHC.Internal.TypeLits.SSymbol nominal
 type GHC.Internal.TypeLits.SSymbol :: GHC.Types.Symbol -> *
 newtype GHC.Internal.TypeLits.SSymbol s
-  = GHC.Internal.TypeLits.UnsafeSSymbol String
+  = GHC.Internal.TypeLits.UnsafeSSymbol_ String
 type GHC.Internal.TypeLits.SomeChar :: *
 data GHC.Internal.TypeLits.SomeChar
   = forall (n :: Char).


=====================================
testsuite/tests/process/all.T
=====================================
@@ -7,7 +7,7 @@ test('process002', [fragile_for(16547, concurrent_ways), req_process], compile_a
 test('process003', [fragile_for(17245, concurrent_ways), req_process], compile_and_run, [''])
 test('process004', [normalise_exec, normalise_exe, req_process], compile_and_run, [''])
 test('T1780', [req_process], compile_and_run, [''])
-test('process005', [omit_ghci, req_process], compile_and_run, [''])
+test('process005', [omit_ghci, req_process, when(js_arch(), fragile(24373))], compile_and_run, [''])
 test('process006', [req_process], compile_and_run, [''])
 
 test('process007',



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/e4a815b6a15f3787df732779e8c319c311eda5bc...0fd38338b7b18caee07bbefe42912f159293052c

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/e4a815b6a15f3787df732779e8c319c311eda5bc...0fd38338b7b18caee07bbefe42912f159293052c
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/20240531/93794333/attachment-0001.html>


More information about the ghc-commits mailing list