@@ -132,10 +132,10 @@ binaryInterfaceMagic = 0xD0Cface
132
132
--
133
133
binaryInterfaceVersion :: Word16
134
134
#if MIN_VERSION_ghc(9,2,0) && !MIN_VERSION_ghc(9,3,0)
135
- binaryInterfaceVersion = 38
135
+ binaryInterfaceVersion = 39
136
136
137
137
binaryInterfaceVersionCompatibility :: [Word16 ]
138
- binaryInterfaceVersionCompatibility = [37 , binaryInterfaceVersion]
138
+ binaryInterfaceVersionCompatibility = [37 , 38 , binaryInterfaceVersion]
139
139
#elif defined(__HLINT__)
140
140
#else
141
141
#error Unsupported GHC version
@@ -176,7 +176,7 @@ writeInterfaceFile filename iface = do
176
176
let bh = setUserData bh0 $ newWriteState (putName bin_symtab)
177
177
(putName bin_symtab)
178
178
(putFastString bin_dict)
179
- put_ bh iface
179
+ putInterfaceFile_ bh iface
180
180
181
181
-- write the symtab pointer at the front of the file
182
182
symtab_p <- tellBin bh
@@ -265,7 +265,7 @@ readInterfaceFile (get_name_cache, set_name_cache) filename bypass_checks = do
265
265
(getDictFastString dict)
266
266
267
267
-- load the actual data
268
- iface <- liftIO $ get bh1
268
+ iface <- liftIO $ getInterfaceFile bh1 version
269
269
return (Right iface)
270
270
where
271
271
with_name_cache :: forall a .
@@ -422,14 +422,36 @@ instance Binary PackageInfo where
422
422
return $ PackageInfo name version
423
423
424
424
instance Binary InterfaceFile where
425
- put_ bh (InterfaceFile env _ ifaces) = do
425
+ put_ bh (InterfaceFile env info ifaces) = do
426
426
put_ bh env
427
+ put_ bh info
427
428
put_ bh ifaces
428
429
429
430
get bh = do
430
431
env <- get bh
432
+ info <- get bh
431
433
ifaces <- get bh
432
- return (InterfaceFile env PackageInfo { piPackageName = PackageName (mkFastString " " ), piPackageVersion = makeVersion [] } ifaces)
434
+ return (InterfaceFile env info ifaces)
435
+
436
+
437
+ putInterfaceFile_ :: BinHandle -> InterfaceFile -> IO ()
438
+ putInterfaceFile_ bh (InterfaceFile env info ifaces) = do
439
+ put_ bh env
440
+ put_ bh info
441
+ put_ bh ifaces
442
+
443
+ getInterfaceFile :: BinHandle -> Word16 -> IO InterfaceFile
444
+ getInterfaceFile bh v | v <= 38 = do
445
+ env <- get bh
446
+ let info = PackageInfo (PackageName mempty ) (makeVersion [] )
447
+ ifaces <- get bh
448
+ return (InterfaceFile env info ifaces)
449
+ getInterfaceFile bh _ = do
450
+ env <- get bh
451
+ info <- get bh
452
+ ifaces <- get bh
453
+ return (InterfaceFile env info ifaces)
454
+
433
455
434
456
instance Binary InstalledInterface where
435
457
put_ bh (InstalledInterface modu is_sig info docMap argMap
0 commit comments