mirror of
https://github.com/edwinb/Idris2-boot.git
synced 2024-12-25 13:54:55 +03:00
Fix hash calculation
This was resetting the current hash value so not calculating an interface hash correctly, so sometimes not rebuilding when necessary.
This commit is contained in:
parent
f9a3ed2e0c
commit
a9db2b6754
@ -62,7 +62,7 @@ Hashable String where
|
||||
export
|
||||
Hashable Name where
|
||||
hashWithSalt h (MN s _) = hashWithSalt h s
|
||||
hashWithSalt h (Resolved i) = i
|
||||
hashWithSalt h (Resolved i) = hashWithSalt h i
|
||||
hashWithSalt h n = hashWithSalt h (show n)
|
||||
|
||||
export
|
||||
|
@ -70,8 +70,6 @@ readModule top loc vis reexp imp as
|
||||
extendAs imp as syn
|
||||
|
||||
defs <- get Ctxt
|
||||
when top $ put Ctxt (record { importHashes $= ((as, hash) ::) } defs)
|
||||
|
||||
modNS <- getNS
|
||||
when vis $ setVisible imp
|
||||
traverse_ (\ mimp =>
|
||||
@ -241,6 +239,12 @@ processMod srcf ttcf msg mod sourcecode
|
||||
setNS ns
|
||||
errs <- logTime "Processing decls" $
|
||||
processDecls (decls mod)
|
||||
|
||||
-- Save the import hashes for the imports we just read.
|
||||
-- If they haven't changed next time, and the source
|
||||
-- file hasn't changed, no need to rebuild.
|
||||
defs <- get Ctxt
|
||||
put Ctxt (record { importHashes = hs } defs)
|
||||
pure (Just errs))
|
||||
(\err => pure (Just [err]))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user