[Git][ghc/ghc][wip/romes/25110] base: Deprecate BCO primops exports from GHC.Exts

Rodrigo Mesquita (@alt-romes) gitlab at gitlab.haskell.org
Thu Sep 5 10:08:21 UTC 2024



Rodrigo Mesquita pushed to branch wip/romes/25110 at Glasgow Haskell Compiler / GHC


Commits:
99984e36 by Rodrigo Mesquita at 2024-09-05T11:08:11+01:00
base: Deprecate BCO primops exports from GHC.Exts

See https://github.com/haskell/core-libraries-committee/issues/212.

These reexports will be removed in GHC 9.14.

- - - - -


4 changed files:

- libraries/base/src/GHC/Exts.hs
- libraries/ghci/GHCi/CreateBCO.hs
- libraries/ghci/ghci.cabal.in
- + testsuite/tests/module/T21752.stderr


Changes:

=====================================
libraries/base/src/GHC/Exts.hs
=====================================
@@ -23,6 +23,12 @@ module GHC.Exts
      -- **  Legacy interface for arrays of arrays
      module GHC.Internal.ArrayArray,
      -- *  Primitive operations
+     {-# DEPRECATED ["The BCO, mkApUpd0#, and newBCO# re-exports from GHC.Exts have been deprecated and will be removed in 9.14", "These symbols should be imported from ghc-internal instead if needed."] #-}
+     Prim.BCO,
+     {-# DEPRECATED ["The BCO, mkApUpd0#, and newBCO# re-exports from GHC.Exts have been deprecated and will be removed in 9.14", "These symbols should be imported from ghc-internal instead if needed."] #-}
+     Prim.mkApUpd0#,
+     {-# DEPRECATED ["The BCO, mkApUpd0#, and newBCO# re-exports from GHC.Exts have been deprecated and will be removed in 9.14", "These symbols should be imported from ghc-internal instead if needed."] #-}
+     Prim.newBCO#,
      module GHC.Prim,
      module GHC.Prim.Ext,
      -- **  Running 'RealWorld' state thread
@@ -112,7 +118,10 @@ module GHC.Exts
 
 import GHC.Internal.Exts
 import GHC.Internal.ArrayArray
-import GHC.Prim hiding ( coerce, dataToTagSmall#, dataToTagLarge#, whereFrom# )
+import GHC.Prim hiding ( coerce, dataToTagSmall#, dataToTagLarge#, whereFrom#
+                       -- Deprecated
+                       , BCO, mkApUpd0#, newBCO# )
+import qualified GHC.Prim as Prim ( BCO, mkApUpd0#, newBCO# )
   -- Hide dataToTag# ops because they are expected to break for
   -- GHC-internal reasons in the near future, and shouldn't
   -- be exposed from base (not even GHC.Exts)


=====================================
libraries/ghci/GHCi/CreateBCO.hs
=====================================
@@ -6,6 +6,10 @@
 {-# LANGUAGE UnboxedTuples #-}
 {-# LANGUAGE RecordWildCards #-}
 {-# LANGUAGE CPP #-}
+{-# OPTIONS_GHC -Wno-warnings-deprecations #-}
+-- TODO We want to import GHC.Internal.Base (BCO, mkApUpd0#, newBCO#) instead
+-- of from GHC.Exts when we can require of the bootstrap compiler to have
+-- ghc-internal.
 
 --
 --  (c) The University of Glasgow 2002-2006


=====================================
libraries/ghci/ghci.cabal.in
=====================================
@@ -86,9 +86,10 @@ library
         array            == 0.5.*,
         base             >= 4.8 && < 4.21,
         -- ghc-internal     == @ProjectVersionForLib at .*
-        -- TODO: Use GHC.Internal.Desugar from ghc-internal instead of ignoring
-        -- the deprecation warning of GHC.Desugar when we require ghc-internal
-        -- of the bootstrap compiler
+        -- TODO: Use GHC.Internal.Desugar and GHC.Internal.Base from
+        -- ghc-internal instead of ignoring the deprecation warning in GHCi.TH
+        -- and GHCi.CreateBCO when we require ghc-internal of the bootstrap
+        -- compiler
         ghc-prim         >= 0.5.0 && < 0.12,
         binary           == 0.8.*,
         bytestring       >= 0.10 && < 0.13,


=====================================
testsuite/tests/module/T21752.stderr
=====================================
@@ -0,0 +1,32 @@
+T21752A.hs:4:5: warning: [GHC-68441] [-Wdeprecations (in -Wextended-warnings)]
+    In the use of ‘newBCO#’ (imported from GHC.Exts):
+    Deprecated: "The BCO, mkApUpd0#, and newBCO# re-exports from GHC.Exts have been deprecated and will be removed in 9.14
+                 These symbols should be imported from ghc-internal instead if needed."
+
+T21752A.hs:4:5: warning: [GHC-68441] [-Wdeprecations (in -Wextended-warnings)]
+    In the use of ‘newBCO#’ (imported from GHC.Exts):
+    Deprecated: "The BCO, mkApUpd0#, and newBCO# re-exports from GHC.Exts have been deprecated and will be removed in 9.14
+                 These symbols should be imported from ghc-internal instead if needed."
+
+T21752A.hs:4:5: warning: [GHC-68441] [-Wdeprecations (in -Wextended-warnings)]
+    In the use of ‘mkApUpd0#’ (imported from GHC.Exts):
+    Deprecated: "The BCO, mkApUpd0#, and newBCO# re-exports from GHC.Exts have been deprecated and will be removed in 9.14
+                 These symbols should be imported from ghc-internal instead if needed."
+
+T21752A.hs:4:5: warning: [GHC-68441] [-Wdeprecations (in -Wextended-warnings)]
+    In the use of ‘mkApUpd0#’ (imported from GHC.Exts):
+    Deprecated: "The BCO, mkApUpd0#, and newBCO# re-exports from GHC.Exts have been deprecated and will be removed in 9.14
+                 These symbols should be imported from ghc-internal instead if needed."
+
+T21752A.hs:4:5: warning: [GHC-68441] [-Wdeprecations (in -Wextended-warnings)]
+    In the use of type constructor or class ‘BCO’
+    (imported from GHC.Exts):
+    Deprecated: "The BCO, mkApUpd0#, and newBCO# re-exports from GHC.Exts have been deprecated and will be removed in 9.14
+                 These symbols should be imported from ghc-internal instead if needed."
+
+T21752A.hs:4:5: warning: [GHC-68441] [-Wdeprecations (in -Wextended-warnings)]
+    In the use of type constructor or class ‘BCO’
+    (imported from GHC.Exts):
+    Deprecated: "The BCO, mkApUpd0#, and newBCO# re-exports from GHC.Exts have been deprecated and will be removed in 9.14
+                 These symbols should be imported from ghc-internal instead if needed."
+



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

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/99984e36f346ff59968d9e33b64c0add2a412356
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/20240905/2ea96706/attachment-0001.html>


More information about the ghc-commits mailing list