@@ -49,7 +49,7 @@ import Codec.Archive.Zip
4949import Debug.Trace
5050
5151ibcVersion :: Word16
52−ibcVersion = 146
52+ibcVersion = 147
5353
5454-- | When IBC is being loaded - we'll load different things (and omit
5555-- different structures/definitions) depending on which phase we're in.
@@ -63,6 +63,7 @@ data IBCFile = IBCFile {
6363 , ibc_reachablenames :: ![Name]
6464 , ibc_imports :: ![(Bool, FilePath)]
6565 , ibc_importdirs :: ![FilePath]
66+ , ibc_sourcedirs :: ![FilePath]
6667 , ibc_implicits :: ![(Name, [PArg])]
6768 , ibc_fixes :: ![FixDecl]
6869 , ibc_statics :: ![(Name, [Bool])]
@@ -115,7 +116,7 @@ deriving instance Binary IBCFile
115116!-}
116117
117118initIBC :: IBCFile
118−initIBC = IBCFile ibcVersion "" [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] Nothing [] [] [] [] [] [] [] [] [] []
119+initIBC = IBCFile ibcVersion "" [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] Nothing [] [] [] [] [] [] [] [] [] []
119120
120121hasValidIBCVersion :: FilePath -> Idris Bool
121122hasValidIBCVersion fp = do
@@ -167,6 +168,7 @@ entries i = catMaybes [Just $ toEntry "ver" 0 (encode $ ver i),
167168 makeEntry "sourcefile" (sourcefile i),
168169 makeEntry "ibc_imports" (ibc_imports i),
169170 makeEntry "ibc_importdirs" (ibc_importdirs i),
171+ makeEntry "ibc_sourcedirs" (ibc_sourcedirs i),
170172 makeEntry "ibc_implicits" (ibc_implicits i),
171173 makeEntry "ibc_fixes" (ibc_fixes i),
172174 makeEntry "ibc_statics" (ibc_statics i),
@@ -291,6 +293,7 @@ ibc i (IBCSyntax n) f = return f { ibc_syntax = n : ibc_syntax f }
291293ibc i (IBCKeyword n) f = return f { ibc_keywords = n : ibc_keywords f }
292294ibc i (IBCImport n) f = return f { ibc_imports = n : ibc_imports f }
293295ibc i (IBCImportDir n) f = return f { ibc_importdirs = n : ibc_importdirs f }
296+ibc i (IBCSourceDir n) f = return f { ibc_sourcedirs = n : ibc_sourcedirs f }
294297ibc i (IBCObj tgt n) f = return f { ibc_objs = (tgt, n) : ibc_objs f }
295298ibc i (IBCLib tgt n) f = return f { ibc_libs = (tgt, n) : ibc_libs f }
296299ibc i (IBCCGFlag tgt n) f = return f { ibc_cgflags = (tgt, n) : ibc_cgflags f }
@@ -382,6 +385,7 @@ process reexp phase archive fn = do
382385 srcok <- runIO $ doesFileExist source
383386 when srcok $ timestampOlder source fn
384387 processImportDirs archive
388+ processSourceDirs archive
385389 processImports reexp phase archive
386390 processImplicits archive
387391 processInfix archive
@@ -492,6 +496,11 @@ processImportDirs ar = do
492496 fs <- getEntry [] "ibc_importdirs" ar
493497 mapM_ addImportDir fs
494498
499+processSourceDirs :: Archive -> Idris ()
500+processSourceDirs ar = do
501+ fs <- getEntry [] "ibc_sourcedirs" ar
502+ mapM_ addSourceDir fs
503+
495504processImports :: Bool -> IBCPhase -> Archive -> Idris ()
496505processImports reexp phase ar = do
497506 fs <- getEntry [] "ibc_imports" ar