sbt-assembly icon indicating copy to clipboard operation
sbt-assembly copied to clipboard

inconsistent output

Open axos88 opened this issue 8 years ago • 2 comments

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?

axos88 avatar Dec 25 '16 20:12 axos88

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)
      }
    }

eed3si9n avatar Jan 16 '17 14:01 eed3si9n

Yeah, I'll try to repro this and get back to you

axos88 avatar Jan 17 '17 06:01 axos88