--
-- Binary interface file support.
-module BinIface ( writeBinIface, readBinIface ) where
+module BinIface ( writeBinIface, readBinIface, v_IgnoreHiVersion ) where
#include "HsVersions.h"
import Panic
import SrcLoc
import Binary
+import Util
-import DATA_IOREF ( readIORef )
+import DATA_IOREF
import EXCEPTION ( throwDyn )
import Monad ( when )
lazyPut bh deprecs
get bh = do
check_ver <- get bh
+ ignore_ver <- readIORef v_IgnoreHiVersion
build_tag <- readIORef v_Build_tag
let our_ver = show opt_HiVersion ++ build_tag
- when (check_ver /= our_ver) $
+ when (check_ver /= our_ver && not ignore_ver) $
-- use userError because this will be caught by readIface
-- which will emit an error msg containing the iface module name.
throwDyn (ProgramError (
pi_rules = rules,
pi_deprecs = deprecs })
+GLOBAL_VAR(v_IgnoreHiVersion, False, Bool)
+
-- ----------------------------------------------------------------------------
{-* Generated by DrIFT-v1.0 : Look, but Don't Touch. *-}
import Outputable
import Util ( sortLt, dropList, seqList )
import Binary ( getBinFileWithDict )
-import BinIface ( writeBinIface )
+import BinIface ( writeBinIface, v_IgnoreHiVersion )
import ErrUtils ( dumpIfSet_dyn )
import FiniteMap
import FastString
+import DATA_IOREF ( writeIORef )
import Monad ( when )
import Maybe ( catMaybes, isJust, isNothing )
import Maybes ( orElse )
\begin{code}
showIface :: FilePath -> IO ()
showIface filename = do
+ -- skip the version check; we don't want to worry about profiled vs.
+ -- non-profiled interfaces, for example.
+ writeIORef v_IgnoreHiVersion True
parsed_iface <- Binary.getBinFileWithDict filename
let ParsedIface{
pi_mod=pi_mod, pi_pkg=pi_pkg, pi_vers=pi_vers,