sbt-assembly
sbt-assembly copied to clipboard
inconsistent output
Running assembly twice will generate different files with the same output (md5sums differ). Comparing the files hex data it seems only every ~20th byte is different, the rest of the output is very similar.
Checking the contents of the zips is identical, but this is not enough to avoid copying the file twice when generating the deps.
Does anyone know what may be the cause of the inconsistence? (timestamps perhaps?) Is there any way to avoid it?
Do you have a repro project and log output of running assembly twice?
sbt-assembly does attempt to cache the result if the inputs are identical: https://github.com/sbt/sbt-assembly/blob/38bd2c9debea3d9c3d81114b327d6d8e171def00/src/main/scala/sbtassembly/Assembly.scala#L74-L82:
val cachedMakeJar = inputChanged(cacheDir / "assembly-inputs") { (inChanged, inputs: Seq[Byte]) =>
outputChanged(cacheDir / "assembly-outputs") { (outChanged, jar: PlainFileInfo) =>
if (inChanged) {
log.info("SHA-1: " + bytesToString(inputs))
} // if
if (inChanged || outChanged) makeJar(out)
else log.info("Assembly up to date: " + jar.file)
}
}
Yeah, I'll try to repro this and get back to you