mirror of
https://github.com/sbt/sbt.git
synced 2026-10-07 10:33:30 +02:00
Problem compileIncremental declares the analysis file and the classes directory as cache outputs, but not the early (pickle) jar or the early analysis. A cache hit therefore leaves a subproject with a restored analysis and no early jar. On the next incremental round Zinc has no jar to merge scalac's pickles into, so the early jar ends up holding only that round's TASTy/sig files, afterEarlyOutput(true) fires, and every downstream subproject is compiled against it and fails with "Not found" for each upstream type that was not just recompiled. Solution - Declare the early jar and the early analysis file as outputs of compileIncremental when exportPipelining produced them, so a hit restores them. - Restored outputs are symlinks into the CAS, and Zinc rewrites the early jar in place when it merges a round's pickles. Replace a symlinked early jar by a real copy before Zinc runs so the cached blob is never modified. - When a previous analysis exists but the early jar does not (a cache written before the jar was an output, exportPipelining switched on for an existing build, a deleted early directory), recompile the subproject from scratch, which writes a complete jar.