@@ -768,22 +768,20 @@ public def Module.clearOutputHashes (mod : Module) : IO PUnit := do
768768
769769/-- Cache the file hashes of the module build outputs in `.hash` files. -/
770770public def Module.cacheOutputHashes (mod : Module) : IO PUnit := do
771- if (← mod.ltarFile.pathExists) then
772- cacheFileHash mod.ltarFile
773- cacheFileHash mod.oleanFile
774- if (← mod.oleanServerFile.pathExists) then
775- cacheFileHash mod.oleanServerFile
776- if (← mod.oleanPrivateFile.pathExists) then
777- cacheFileHash mod.oleanPrivateFile
778- cacheFileHash mod.ileanFile
779- if (← mod.irSigFile.pathExists) then
780- cacheFileHash mod.irSigFile
781- if (← mod.irFile.pathExists) then
782- cacheFileHash mod.irFile
783- if (← mod.cFile.pathExists) then
784- cacheFileHash mod.cFile
785- if Lean.Internal.hasLLVMBackend () then
786- cacheFileHash mod.bcFile
771+ -- Hashes on not conditional on module metadata (e.g., `isModule`).
772+ -- Lake will determine which files to use (and which to delete) as part of the build proccess.
773+ try
774+ cacheFileHashIfExists mod.ltarFile
775+ cacheFileHashIfExists mod.oleanFile
776+ cacheFileHashIfExists mod.oleanServerFile
777+ cacheFileHashIfExists mod.oleanPrivateFile
778+ cacheFileHashIfExists mod.ileanFile
779+ cacheFileHashIfExists mod.irSigFile
780+ cacheFileHashIfExists mod.irFile
781+ cacheFileHashIfExists mod.cFile
782+ cacheFileHashIfExists mod.bcFile
783+ catch e =>
784+ error s! "failed to save output hashes: { e} "
787785
788786def ModuleOutputDescrs.resolve
789787 (descrs : ModuleOutputDescrs) (service? : Option CacheServiceName) (scope? : Option CacheServiceScope)
0 commit comments