[Git][ghc/ghc][wip/build-ordering] base: Ensure that ghc-bignum builds before GHC.IO.Encoding.Iconv

Ben Gamari (@bgamari) gitlab at gitlab.haskell.org
Mon Apr 15 15:26:59 UTC 2024



Ben Gamari pushed to branch wip/build-ordering at Glasgow Haskell Compiler / GHC


Commits:
d10dbb24 by Ben Gamari at 2024-04-15T11:26:47-04:00
base: Ensure that ghc-bignum builds before GHC.IO.Encoding.Iconv

On Windows `GHC.IO.Encoding.Iconv` is empty and has no dependencies.
Consequently, we must add dummy build ordering imports to ensure that,
e.g., `GHC.Types` and `GHC.BigNum.Nat` are built before
`GHC.IO.Encoding.Iconv`.

- - - - -


2 changed files:

- libraries/base/src/GHC/IO/Encoding/Iconv.hs
- libraries/ghc-internal/src/GHC/Internal/IO/Encoding/Iconv.hs


Changes:

=====================================
libraries/base/src/GHC/IO/Encoding/Iconv.hs
=====================================
@@ -1,5 +1,5 @@
 {-# LANGUAGE CPP #-}
-{-# LANGUAGE Safe #-}
+{-# LANGUAGE Trustworthy #-}
 {-# OPTIONS_HADDOCK not-home #-}
 
 -- |
@@ -15,8 +15,8 @@
 -- This module provides text encoding/decoding using iconv
 --
 
-module GHC.IO.Encoding.Iconv
 #if !defined(mingw32_HOST_OS)
+module GHC.IO.Encoding.Iconv
     (iconvEncoding,
      mkIconvEncoding,
      localeEncodingName
@@ -25,6 +25,8 @@ module GHC.IO.Encoding.Iconv
 import GHC.Internal.IO.Encoding.Iconv
 
 #else
-    ( ) where
+module GHC.IO.Encoding.Iconv ( ) where
+
+import GHC.Internal.Base () -- For build ordering
 
 #endif


=====================================
libraries/ghc-internal/src/GHC/Internal/IO/Encoding/Iconv.hs
=====================================
@@ -1,4 +1,3 @@
-{-# LANGUAGE Trustworthy #-}
 {-# LANGUAGE CPP
            , NoImplicitPrelude
            , NondecreasingIndentation
@@ -7,6 +6,9 @@
   #-}
 {-# OPTIONS_HADDOCK not-home #-}
 
+#if defined(mingw32_HOST_OS)
+{-# LANGUAGE Trustworthy #-}
+
 -----------------------------------------------------------------------------
 -- |
 -- Module      :  GHC.Internal.IO.Encoding.Iconv
@@ -20,24 +22,36 @@
 -- This module provides text encoding/decoding using iconv
 --
 -----------------------------------------------------------------------------
+module GHC.Internal.IO.Encoding.Iconv () where
+
+-- See W1 of Note [Tracking dependencies on primitives] in GHC.Internal.Base
+import GHC.Types ()
+
+#else
+
+{-# LANGUAGE Safe #-}
 
+-----------------------------------------------------------------------------
+-- |
+-- Module      :  GHC.Internal.IO.Encoding.Iconv
+-- Copyright   :  (c) The University of Glasgow, 2008-2009
+-- License     :  see libraries/base/LICENSE
+--
+-- Maintainer  :  libraries at haskell.org
+-- Stability   :  internal
+-- Portability :  non-portable
+--
+-- This module provides text encoding/decoding using iconv
+--
+-----------------------------------------------------------------------------
 module GHC.Internal.IO.Encoding.Iconv (
-#if !defined(mingw32_HOST_OS)
    iconvEncoding, mkIconvEncoding,
    localeEncodingName
-#endif
  ) where
 
 #include "MachDeps.h"
 #include "HsBaseConfig.h"
 
-#if defined(mingw32_HOST_OS)
-
--- See W1 of Note [Tracking dependencies on primitives] in GHC.Internal.Base
-import GHC.Types ()
-
-#else
-
 import GHC.Internal.Foreign.C.Types
 import GHC.Internal.Foreign.C.String (withCAString, peekCAString)
 import GHC.Internal.Foreign.C.String.Encoding



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

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d10dbb247a79e53ac14146dafe63526c0fc0fbaa
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/20240415/0acd3545/attachment-0001.html>


More information about the ghc-commits mailing list