[Git][ghc/ghc][wip/spj-reinstallable-base2] fix wasm
Cheng Shao pushed to branch wip/spj-reinstallable-base2 at Glasgow Haskell Compiler / GHC Commits: 1a86d8c2 by Cheng Shao at 2026-07-15T15:14:32+00:00 fix wasm - - - - - 7 changed files: - libraries/base/src/GHC/Essentials.hs - libraries/base/src/System/CPUTime/Posix/Times.hsc - libraries/ghc-internal/src/GHC/Internal/Wasm/Prim/Conc.hs - libraries/ghc-internal/src/GHC/Internal/Wasm/Prim/Conc/Internal.hs - libraries/ghc-internal/src/GHC/Internal/Wasm/Prim/Exports.hs - libraries/ghc-internal/src/GHC/Internal/Wasm/Prim/Imports.hs - libraries/ghc-internal/src/GHC/Internal/Wasm/Prim/Types.hs Changes: ===================================== libraries/base/src/GHC/Essentials.hs ===================================== @@ -353,7 +353,13 @@ import GHC.Internal.Ptr import GHC.Internal.Foreign.C.ConstPtr #if defined(javascript_HOST_ARCH) import GHC.Internal.JS.Prim (unsafeUnpackJSStringUtf8##, JSVal) +#elif defined(wasm32_HOST_ARCH) +import GHC.Internal.Wasm.Prim (JSVal) #else +data JSVal +#endif + +#if !defined(javascript_HOST_ARCH) {- Note [JS primitives known-keys for non-js target] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -373,7 +379,6 @@ be used unless compiling to JS) and toggle -fdefines-known-key-names for these s -} -- See Note [JS primitives known-keys for non-js target] -data JSVal unsafeUnpackJSStringUtf8## :: a unsafeUnpackJSStringUtf8## = error "unsafeUnpackJSStringUtf8## known-key was used when the compilation target wasn't javascript_HOST_ARCH" #endif ===================================== libraries/base/src/System/CPUTime/Posix/Times.hsc ===================================== @@ -14,6 +14,10 @@ import Data.Ratio import GHC.Internal.Foreign.C.Types import System.CPUTime.Utils +#if !HAVE_TIMES +import GHC.Essentials +#endif + -- for struct tms #if HAVE_SYS_TIMES_H #include <sys/times.h> ===================================== libraries/ghc-internal/src/GHC/Internal/Wasm/Prim/Conc.hs ===================================== @@ -7,7 +7,6 @@ module GHC.Internal.Wasm.Prim.Conc ( import GHC.Internal.Base import GHC.Internal.IO.Unsafe import GHC.Internal.Stable -import GHC.Internal.Types (Int, IO) {- ===================================== libraries/ghc-internal/src/GHC/Internal/Wasm/Prim/Conc/Internal.hs ===================================== @@ -6,7 +6,6 @@ module GHC.Internal.Wasm.Prim.Conc.Internal ( import GHC.Internal.Base import GHC.Internal.IO -import GHC.Internal.Types -- See W6 of Note [Tracking dependencies on primitives] in GHC.Internal.Base import GHC.Internal.Wasm.Prim.Imports () ===================================== libraries/ghc-internal/src/GHC/Internal/Wasm/Prim/Exports.hs ===================================== @@ -30,7 +30,7 @@ module GHC.Internal.Wasm.Prim.Exports ( js_promiseReject ) where -import GHC.Internal.Base (join, pure, ($), (*>), (=<<)) +import GHC.Internal.Base import GHC.Internal.Exception.Type import GHC.Internal.IO import GHC.Internal.IORef @@ -40,7 +40,6 @@ import GHC.Internal.Prim ( ) import GHC.Internal.Stable import GHC.Internal.TopHandler (flushStdHandles) -import GHC.Internal.Types (Any, Bool, Char, Double, Float) import GHC.Internal.Wasm.Prim.Types import GHC.Internal.Word import GHC.Internal.Unsafe.Coerce ( unsafeCoerce# ) ===================================== libraries/ghc-internal/src/GHC/Internal/Wasm/Prim/Imports.hs ===================================== @@ -35,7 +35,6 @@ import GHC.Internal.Stable import GHC.Internal.Prim ( RealWorld, State#, makeStablePtr#, newMVar#, readMVar#, ) -import GHC.Internal.Types (Any, IO(..)) import GHC.Internal.Wasm.Prim.Types import GHC.Internal.Unsafe.Coerce ( unsafeCoerce# ) import qualified GHC.Internal.Stack.Types as Rebindable ===================================== libraries/ghc-internal/src/GHC/Internal/Wasm/Prim/Types.hs ===================================== @@ -5,6 +5,7 @@ {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE UnliftedFFITypes #-} {-# LANGUAGE UnliftedNewtypes #-} +{-# OPTIONS_GHC -fdefines-known-key-names #-} module GHC.Internal.Wasm.Prim.Types ( JSVal# (..), @@ -20,13 +21,11 @@ module GHC.Internal.Wasm.Prim.Types ( import qualified GHC.Internal.Data.Typeable.Internal as Rebindable import GHC.Internal.Base -import GHC.Internal.Classes (Ord(..)) import GHC.Internal.Exception.Type import GHC.Internal.Foreign.C.String.Encoding import GHC.Internal.ForeignPtr import GHC.Internal.Prim (Int#, RealWorld, State#, mkWeak#, mkWeakNoFinalizer#) import GHC.Internal.Ptr -import GHC.Internal.Types (Any, Int, UnliftedType) import GHC.Internal.IO import GHC.Internal.IO.Encoding import GHC.Internal.Maybe (Maybe(..)) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/1a86d8c20fe1664f97d3b3bbf49b854c... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/1a86d8c20fe1664f97d3b3bbf49b854c... You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
participants (1)
-
Cheng Shao (@TerrorJack)