From 0d9be6dd4a82cb329dc5088f439514a648dccd9f Mon Sep 17 00:00:00 2001 From: Ethan Atkins Date: Tue, 14 May 2019 16:42:49 -0700 Subject: [PATCH] Don't ever invalidate rt.jar There are issues when using jdk > 8 where the rt.jar file can be invalidated by ExternalHooks. This causes spurious rebuilds. I think it's fair to assume that rt.jar never changes. If a dependency is named rt.jar, then invalidation may not work correctly but I think that this is the more important case to handle. I verified that before this change, it was impossible to run akka-actor/compile twice in a row using adopt jdk 11 and, after this change, re-compilation worked as expected. --- main/src/main/scala/sbt/internal/ExternalHooks.scala | 1 + 1 file changed, 1 insertion(+) diff --git a/main/src/main/scala/sbt/internal/ExternalHooks.scala b/main/src/main/scala/sbt/internal/ExternalHooks.scala index ffc675f5a..d993f691b 100644 --- a/main/src/main/scala/sbt/internal/ExternalHooks.scala +++ b/main/src/main/scala/sbt/internal/ExternalHooks.scala @@ -84,6 +84,7 @@ private[sbt] object ExternalHooks { case _ => javaHome match { case Some(h) if file.toPath.startsWith(h) => None + case _ if file.getName == "rt.jar" => None case _ => Some(file) } }