Commit ec9f64e1 authored by Jens Korinth's avatar Jens Korinth

Closes #21 - OOC: Do not delete files on error

* EvaluateIP would delete files from .zip regardless of result, leaving
  the directory in non-reproducible state, fixed
* also fixed: in case of success, the base directory would not be
  deleted due to wrong order of `deleteOnExit`s
parent 87f0de99
......@@ -110,8 +110,6 @@ object EvaluateIP {
val r = InterruptibleProcess(Process(vivadoCmd, files.baseDir.toFile),
waitMillis = Some(24 * 60 * 60 * 1000)).!(io)
// remove files from zip
files.files.map(f => deleteOnExit(f.toFile))
if (r == InterruptibleProcess.TIMEOUT_RETCODE) {
logger.error("%s: Vivado timeout error".format(runPrefix))
} else {
......@@ -122,10 +120,11 @@ object EvaluateIP {
writeXMLReport(reportFile, ur, dpd, targetPeriod)
logger.info("{} finished successfully, report in {}", runPrefix: Any, reportFile)
// clean up files on exit
deleteOnExit(files.tclFile.toFile)
deleteOnExit(files.baseDir.toFile)
deleteOnExit(files.logFile.toFile)
deleteOnExit(files.baseDir.resolve(".Xil").toFile) // also remove Xilinx's crap
files.files.map(f => deleteOnExit(f.toFile)) // remove files from zip only on success, else keep
deleteOnExit(files.tclFile.toFile)
deleteOnExit(files.logFile.toFile)
} else {
logger.error("%s: Vivado finished with error (%d)".format(runPrefix, r))
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment