Closed guersam closed 2 weeks ago
Without compilerOrder
setting it compiles but the incremental compilation log is similar.
[debug] [zinc] IncrementalCompile -----------
[debug] IncrementalCompile.incrementalCompile
[debug] previous = Stamps for: 4 products, 2 sources, 1 libraries
[debug] current source = Set(${BASE}/src/main/java/example/JavaClass.java, ${BASE}/src/main/scala/example/Main.scala)
[debug] > initialChanges = InitialChanges(Changes(added = Set(), removed = Set(), changed = Set(), unmodified = ...),Set(${BASE}/target/scala-2.13/classes/example/JavaClass.class, ${BASE}/target/scala-2.13/classes/example/Main$.class, ${BASE}/target/scala-2.13/classes/example/Main$delayedInit$body.class, ${BASE}/target/scala-2.13/classes/example/Main.class),Set(),API Changes: Set())
[debug]
[debug] Initial source changes:
[debug] removed: Set()
[debug] added: Set()
[debug] modified: Set()
[debug] Invalidated products: Set(${BASE}/target/scala-2.13/classes/example/JavaClass.class, ${BASE}/target/scala-2.13/classes/example/Main$.class, ${BASE}/target/scala-2.13/classes/example/Main$delayedInit$body.class, ${BASE}/target/scala-2.13/classes/example/Main.class)
[debug] External API changes: API Changes: Set()
[debug] Modified binary dependencies: Set()
[debug] Initial directly invalidated classes: Set()
[debug] Sources indirectly invalidated by:
[debug] product: Set(${BASE}/src/main/java/example/JavaClass.java, ${BASE}/src/main/scala/example/Main.scala)
[debug] binary dep: Set()
[debug] external source: Set()
[debug] all 2 sources are invalidated
[debug] Initial set of included nodes:
[debug] Recompiling all sources: number of invalidated sources > 50.0 percent of all sources
[debug] compilation cycle 1
[info] compiling 1 Scala source and 1 Java source to /home/guersam/playground/sbt-pipeline-debug/sbt-pipelining-debug/target/scala-2.13/classes ...
[debug] Getting org.scala-sbt:compiler-bridge_2.13:1.10.0-RC2:compile for Scala 2.13.11
[debug] [zinc] Running cached compiler 21021528 for Scala compiler version 2.13.11
[debug] [zinc] The Scala compiler is invoked with:
[debug] -classpath
[debug] /home/guersam/playground/sbt-pipeline-debug/sbt-pipelining-debug/target/scala-2.13/classes:/home/guersam/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.11/scala-library-2.13.11.jar
[debug] Scala compilation took 0.213943626 s
[debug] done compiling Scala sources
I don't know much about pipelining, but since Eugene added the following comment in 5c86cc8b69081d0845407e4a2da3af871eab2eaf
Turn off compileJava when pipelining is on
Note this requires build tools to call `incrementalCompiler.compileAllJava(in, log)` at the right timing.
I guess this is indeed a build tool problem instead of a zinc problem
Original submitted as https://github.com/sbt/sbt/issues/7546, but I think it's a Zinc issue.
steps
$ sbt run
.problem
It fails due to a missing Java class. The incremental compilation log shows that the Java source code is not compiled.
expectation
It prints:
notes
usePipelining := true
andcompileOrder := CompilerOrder.JavaThenScala
settings are needed to reproducesbt 'last compileIncremental' log