Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not use invalidationResults to compute next invalidations #1312

Merged
merged 5 commits into from
Dec 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1090,14 +1090,14 @@ private final class AnalysisCallback(

override def dependencyPhaseCompleted(): Unit = {
val incHandler = incHandlerOpt.getOrElse(sys.error("incHandler was expected"))
if (invalidationResults.isEmpty) {
if (earlyOutput.isDefined && invalidationResults.isEmpty) {
Friendseeker marked this conversation as resolved.
Show resolved Hide resolved
val a = getAnalysis
val CompileCycleResult(continue, invalidations, merged) =
incHandler.mergeAndInvalidate(a, false)
// Store invalidations and continuation decision; the analysis will be computed again after Analyze phase.
invalidationResults = Some(CompileCycleResult(continue, invalidations, Analysis.empty))
// If there will be no more compilation cycles, store the early analysis file and update the pickle jar
if (earlyOutput.isDefined && !continue && lookup.shouldDoEarlyOutput(merged)) {
if (!continue && lookup.shouldDoEarlyOutput(merged)) {
writeEarlyArtifacts(merged)
}
}
Expand Down
13 changes: 13 additions & 0 deletions zinc/src/sbt-test/source-dependencies/cyclic-dependency/A.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*
* Zinc - The incremental compiler for Scala.
* Copyright Scala Center, Lightbend, and Mark Harrah
*
* Licensed under Apache License 2.0
* SPDX-License-Identifier: Apache-2.0
*
* See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*/

class A() extends ABase()

14 changes: 14 additions & 0 deletions zinc/src/sbt-test/source-dependencies/cyclic-dependency/ABase.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* Zinc - The incremental compiler for Scala.
* Copyright Scala Center, Lightbend, and Mark Harrah
*
* Licensed under Apache License 2.0
* SPDX-License-Identifier: Apache-2.0
*
* See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*/

public abstract class ABase {
H h;
}
12 changes: 12 additions & 0 deletions zinc/src/sbt-test/source-dependencies/cyclic-dependency/H.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
* Zinc - The incremental compiler for Scala.
* Copyright Scala Center, Lightbend, and Mark Harrah
*
* Licensed under Apache License 2.0
* SPDX-License-Identifier: Apache-2.0
*
* See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*/

class H() extends HBase()
14 changes: 14 additions & 0 deletions zinc/src/sbt-test/source-dependencies/cyclic-dependency/HBase.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* Zinc - The incremental compiler for Scala.
* Copyright Scala Center, Lightbend, and Mark Harrah
*
* Licensed under Apache License 2.0
* SPDX-License-Identifier: Apache-2.0
*
* See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*/

public abstract class HBase {
A a;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
* Zinc - The incremental compiler for Scala.
* Copyright Scala Center, Lightbend, and Mark Harrah
*
* Licensed under Apache License 2.0
* SPDX-License-Identifier: Apache-2.0
*
* See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*/

class A() extends ABase()



// random placeholder change
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
* Zinc - The incremental compiler for Scala.
* Copyright Scala Center, Lightbend, and Mark Harrah
*
* Licensed under Apache License 2.0
* SPDX-License-Identifier: Apache-2.0
*
* See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*/

public abstract class ABase {
H h;
}

// Random changes to force recompilation
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pipelining = false
6 changes: 6 additions & 0 deletions zinc/src/sbt-test/source-dependencies/cyclic-dependency/test
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
> compile

$ copy-file changes/ABase.java ABase.java
$ copy-file changes/A.scala A.scala

> checkIterations 2