-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support coming GHC 9.8.1 (GHC 9.8.1-rc1 is available) #16
Comments
I'll have a look at this week. |
That was a minor change. Fixed in #17 |
@hsyl20, I am trying to build
I am wondering: could there have been a further change to the |
@hsyl20, I built Stack against a version of
|
I suppose it could be possible that GHC 9.8.1 can produce corrupt
|
I think I can rule out the (unlikely) possibility that it is GHC 9.8.1 that is producing malformed module Main (main) where
import Control.Monad ( forM )
import GHC.Iface.Binary ( CheckHiWay (..), TraceBinIFace (..), readBinIface )
import GHC.Platform
( Platform (..), ArchOS (..), Arch (..), OS (..), genericPlatform )
import GHC.Platform.Profile ( Profile (..) )
import GHC.Types.Name.Cache ( NameCache (..), initNameCache )
import GHC.Unit.Module.ModIface ( ModIface, ModIface_ (..) )
import GHC.Unit.Types ( GenModule (..) )
import GHC.Utils.Outputable ( SDoc, printSDocLn, traceSDocContext )
import GHC.Utils.Ppr ( Mode (..) )
import System.IO ( stdout )
main :: IO ()
main = do
let fps =
[ "D:\\Users\\mike\\Code\\GitHub\\commercialhaskell\\pantry\\.stack-work\\dist\\2b10cf2c\\build\\Pantry\\Internal\\Stackage.hi"
, "D:\\Users\\mike\\Code\\GitHub\\commercialhaskell\\pantry\\.stack-work\\dist\\2b10cf2c\\build\\Pantry.hi"
]
nc <- initNameCache 'A' []
modIfaces <- forM fps (readBinIface' nc)
let ns = map (moduleName . mi_module) modIfaces
print ns
readBinIface' :: NameCache -> FilePath -> IO ModIface
readBinIface' nc fp =
readBinIface profile nc CheckHiWay (TraceBinIFace traceBinIFace) fp
profile :: Profile
profile = Profile platform mempty
platform :: Platform
platform = genericPlatform
{ platformArchOS = archOS }
archOS :: ArchOS
archOS = ArchOS ArchX86_64 OSMinGW32
traceBinIFace :: SDoc -> IO ()
traceBinIFace = printSDocLn traceSDocContext (PageMode True) stdout The output of the exectuable is (that is, it does not throw an error):
|
Modifying my test to provide more information, the first instance gives me this:
and the elements of the directory are:
However, it seems |
The first and second problem with added debug information from
It seems that something is going wrong with the penultimate |
@hsyl20, I think I have it! The instance of GHC 9.6.3: instance Binary NameSpace where
put_ bh VarName =
putByte bh 0
put_ bh DataName =
putByte bh 1
put_ bh TvName =
putByte bh 2
put_ bh TcClsName =
putByte bh 3
get bh = do
h <- getByte bh
case h of
0 -> return VarName
1 -> return DataName
2 -> return TvName
_ -> return TcClsName GHC 9.8.1: instance Binary NameSpace where
put_ bh VarName =
putByte bh 0
put_ bh DataName =
putByte bh 1
put_ bh TvName =
putByte bh 2
put_ bh TcClsName =
putByte bh 3
put_ bh (FldName parent) = do
putByte bh 4
put_ bh parent
get bh = do
h <- getByte bh
case h of
0 -> return VarName
1 -> return DataName
2 -> return TvName
3 -> return TcClsName
_ -> do
parent <- get bh
return $ FldName { fldParent = parent } I think that is throwing off this line in void (getList (getTuple (getWord8 *> getFastString) getFP)) -- usg_entities |
I am going to attempt a fix ... |
Fix #16 Reflect change in `instance Binary NameSpace`
Good work @mpilgrem! Sorry for the delay, I was on vacation. |
@hsyl20, may I once again call on your assistance with the above? Based on my experiments with GHC 9.8.1-rc1, it looks to me that the
*.hi
format has changed again, after GHC 9.6.3.The text was updated successfully, but these errors were encountered: