diff --git a/compile/inc/src/main/scala/sbt/inc/IncOptions.scala b/compile/inc/src/main/scala/sbt/inc/IncOptions.scala index 66c372784..b2a147b98 100644 --- a/compile/inc/src/main/scala/sbt/inc/IncOptions.scala +++ b/compile/inc/src/main/scala/sbt/inc/IncOptions.scala @@ -217,7 +217,7 @@ final class IncOptions( object IncOptions extends Serializable { private val recompileOnMacroDefDefault: Boolean = true - private val nameHashingDefault: Boolean = false + private val nameHashingDefault: Boolean = true private val antStyleDefault: Boolean = false val Default = IncOptions( // 1. recompile changed sources diff --git a/sbt/src/sbt-test/source-dependencies/constants-name-hashing/build.sbt b/sbt/src/sbt-test/source-dependencies/constants-name-hashing/build.sbt deleted file mode 100644 index 8a38ef414..000000000 --- a/sbt/src/sbt-test/source-dependencies/constants-name-hashing/build.sbt +++ /dev/null @@ -1 +0,0 @@ -incOptions := incOptions.value.withNameHashing(true) diff --git a/sbt/src/sbt-test/source-dependencies/constants-name-hashing/changes/A1.scala b/sbt/src/sbt-test/source-dependencies/constants-name-hashing/changes/A1.scala deleted file mode 100644 index f67b6f474..000000000 --- a/sbt/src/sbt-test/source-dependencies/constants-name-hashing/changes/A1.scala +++ /dev/null @@ -1 +0,0 @@ -object A { final val x = 1 } diff --git a/sbt/src/sbt-test/source-dependencies/constants-name-hashing/changes/A2.scala b/sbt/src/sbt-test/source-dependencies/constants-name-hashing/changes/A2.scala deleted file mode 100644 index 4f9396f13..000000000 --- a/sbt/src/sbt-test/source-dependencies/constants-name-hashing/changes/A2.scala +++ /dev/null @@ -1 +0,0 @@ -object A { final val x = 2 } diff --git a/sbt/src/sbt-test/source-dependencies/constants-name-hashing/changes/B.scala b/sbt/src/sbt-test/source-dependencies/constants-name-hashing/changes/B.scala deleted file mode 100644 index 058527993..000000000 --- a/sbt/src/sbt-test/source-dependencies/constants-name-hashing/changes/B.scala +++ /dev/null @@ -1,4 +0,0 @@ -object B -{ - def main(args: Array[String]) = assert(args(0).toInt == A.x ) -} \ No newline at end of file diff --git a/sbt/src/sbt-test/source-dependencies/constants-name-hashing/pending b/sbt/src/sbt-test/source-dependencies/constants/pending similarity index 85% rename from sbt/src/sbt-test/source-dependencies/constants-name-hashing/pending rename to sbt/src/sbt-test/source-dependencies/constants/pending index 61df26ef6..eebce96e4 100644 --- a/sbt/src/sbt-test/source-dependencies/constants-name-hashing/pending +++ b/sbt/src/sbt-test/source-dependencies/constants/pending @@ -1,3 +1,5 @@ +# Marked as pending, see https://github.com/sbt/sbt/issues/1543 +# # Tests if source dependencies are tracked properly # for compile-time constants (like final vals in top-level objects) # see https://issues.scala-lang.org/browse/SI-7173 for details diff --git a/sbt/src/sbt-test/source-dependencies/constants/test b/sbt/src/sbt-test/source-dependencies/constants/test deleted file mode 100644 index 61df26ef6..000000000 --- a/sbt/src/sbt-test/source-dependencies/constants/test +++ /dev/null @@ -1,11 +0,0 @@ -# Tests if source dependencies are tracked properly -# for compile-time constants (like final vals in top-level objects) -# see https://issues.scala-lang.org/browse/SI-7173 for details -# why compile-time constants can be tricky to track due to early inlining - -$ copy-file changes/B.scala B.scala - -$ copy-file changes/A1.scala A.scala -> run 1 -$ copy-file changes/A2.scala A.scala -> run 2 diff --git a/sbt/src/sbt-test/source-dependencies/import-class-name-hashing/A.scala b/sbt/src/sbt-test/source-dependencies/import-class-name-hashing/A.scala deleted file mode 100644 index a93bbe535..000000000 --- a/sbt/src/sbt-test/source-dependencies/import-class-name-hashing/A.scala +++ /dev/null @@ -1,3 +0,0 @@ -package a - -class A diff --git a/sbt/src/sbt-test/source-dependencies/import-class-name-hashing/B.scala b/sbt/src/sbt-test/source-dependencies/import-class-name-hashing/B.scala deleted file mode 100644 index 0489f4a26..000000000 --- a/sbt/src/sbt-test/source-dependencies/import-class-name-hashing/B.scala +++ /dev/null @@ -1 +0,0 @@ -import a.A diff --git a/sbt/src/sbt-test/source-dependencies/import-class-name-hashing/build.sbt b/sbt/src/sbt-test/source-dependencies/import-class-name-hashing/build.sbt deleted file mode 100644 index 8a38ef414..000000000 --- a/sbt/src/sbt-test/source-dependencies/import-class-name-hashing/build.sbt +++ /dev/null @@ -1 +0,0 @@ -incOptions := incOptions.value.withNameHashing(true) diff --git a/sbt/src/sbt-test/source-dependencies/import-class-name-hashing/changes/A.scala b/sbt/src/sbt-test/source-dependencies/import-class-name-hashing/changes/A.scala deleted file mode 100644 index 2a93cdef5..000000000 --- a/sbt/src/sbt-test/source-dependencies/import-class-name-hashing/changes/A.scala +++ /dev/null @@ -1 +0,0 @@ -package a diff --git a/sbt/src/sbt-test/source-dependencies/import-class/pending b/sbt/src/sbt-test/source-dependencies/import-class/pending deleted file mode 100644 index 7679ba52c..000000000 --- a/sbt/src/sbt-test/source-dependencies/import-class/pending +++ /dev/null @@ -1,8 +0,0 @@ -> compile - -# remove class a.A -$ copy-file changes/A.scala A.scala - -# 'import a.A' should now fail in B.scala -# succeeds because scalac doesn't track this dependency --> compile diff --git a/sbt/src/sbt-test/source-dependencies/import-class-name-hashing/test b/sbt/src/sbt-test/source-dependencies/import-class/test similarity index 100% rename from sbt/src/sbt-test/source-dependencies/import-class-name-hashing/test rename to sbt/src/sbt-test/source-dependencies/import-class/test diff --git a/sbt/src/sbt-test/source-dependencies/inherited-dependencies/build.sbt b/sbt/src/sbt-test/source-dependencies/inherited-dependencies/build.sbt index 62479a549..806c88b3c 100644 --- a/sbt/src/sbt-test/source-dependencies/inherited-dependencies/build.sbt +++ b/sbt/src/sbt-test/source-dependencies/inherited-dependencies/build.sbt @@ -1,3 +1,6 @@ +// this test is specific to the old incremental compilation algorithm +incOptions := incOptions.value.withNameHashing(false) + lazy val verifyDeps = taskKey[Unit]("verify inherited dependencies are properly extracted") verifyDeps := { diff --git a/sbt/src/sbt-test/source-dependencies/inherited-deps-java/build.sbt b/sbt/src/sbt-test/source-dependencies/inherited-deps-java/build.sbt index b9f1a922d..c2a35d1ed 100644 --- a/sbt/src/sbt-test/source-dependencies/inherited-deps-java/build.sbt +++ b/sbt/src/sbt-test/source-dependencies/inherited-deps-java/build.sbt @@ -1,3 +1,6 @@ +// this test is specific to the old incremental compilation algorithm +incOptions := incOptions.value.withNameHashing(false) + lazy val verifyDeps = taskKey[Unit]("verify inherited dependencies are properly extracted") verifyDeps := { diff --git a/sbt/src/sbt-test/source-dependencies/java-static-name-hashing/build.sbt b/sbt/src/sbt-test/source-dependencies/java-static-name-hashing/build.sbt deleted file mode 100644 index 8a38ef414..000000000 --- a/sbt/src/sbt-test/source-dependencies/java-static-name-hashing/build.sbt +++ /dev/null @@ -1 +0,0 @@ -incOptions := incOptions.value.withNameHashing(true) diff --git a/sbt/src/sbt-test/source-dependencies/java-static-name-hashing/changes/J1.java b/sbt/src/sbt-test/source-dependencies/java-static-name-hashing/changes/J1.java deleted file mode 100644 index a3a75fefd..000000000 --- a/sbt/src/sbt-test/source-dependencies/java-static-name-hashing/changes/J1.java +++ /dev/null @@ -1,4 +0,0 @@ -public class J -{ - public static final int x = 3; -} \ No newline at end of file diff --git a/sbt/src/sbt-test/source-dependencies/java-static-name-hashing/changes/J2.java b/sbt/src/sbt-test/source-dependencies/java-static-name-hashing/changes/J2.java deleted file mode 100644 index 8ff2e24c6..000000000 --- a/sbt/src/sbt-test/source-dependencies/java-static-name-hashing/changes/J2.java +++ /dev/null @@ -1,4 +0,0 @@ -public class J -{ - public static final String x = "3"; -} \ No newline at end of file diff --git a/sbt/src/sbt-test/source-dependencies/java-static-name-hashing/changes/S.scala b/sbt/src/sbt-test/source-dependencies/java-static-name-hashing/changes/S.scala deleted file mode 100644 index 45436972b..000000000 --- a/sbt/src/sbt-test/source-dependencies/java-static-name-hashing/changes/S.scala +++ /dev/null @@ -1,4 +0,0 @@ -object S -{ - val y: Int = J.x -} diff --git a/sbt/src/sbt-test/source-dependencies/java-static-name-hashing/pending b/sbt/src/sbt-test/source-dependencies/java-static-name-hashing/pending deleted file mode 100644 index 42890ca74..000000000 --- a/sbt/src/sbt-test/source-dependencies/java-static-name-hashing/pending +++ /dev/null @@ -1,24 +0,0 @@ -# When a Java class is loaded from a class file and not parsed from a source file, scalac reports -# the statics as an object without a file and so the Analyzer must know to look for the -# object's linked class. -# This test verifies this happens. -# The test compiles a Java class with a static field. -# It then adds a Scala object that references the static field. Because the object only depends on a -# static member and because the Java source is not included in the compilation (since it didn't change), -# this triggers the special case above. - -# add and compile the Java source -$ copy-file changes/J1.java src/main/java/J.java -> compile - -# add and compile the Scala source -$ copy-file changes/S.scala src/main/scala/S.scala -> compile - -# change the Java source so that a compile error should occur if S.scala is also recompiled (which will happen if the dependency was properly recorded) -$ copy-file changes/J2.java src/main/java/J.java --> compile - -# verify it should have failed by doing a full recompilation -> clean --> compile \ No newline at end of file diff --git a/sbt/src/sbt-test/source-dependencies/java-static/changes/J1.java b/sbt/src/sbt-test/source-dependencies/java-static/changes/J1.java index a3a75fefd..cf042ce22 100644 --- a/sbt/src/sbt-test/source-dependencies/java-static/changes/J1.java +++ b/sbt/src/sbt-test/source-dependencies/java-static/changes/J1.java @@ -1,4 +1,4 @@ public class J { - public static final int x = 3; + public static final Integer x = 3; } \ No newline at end of file diff --git a/sbt/src/sbt-test/source-dependencies/macro-name-hashing/macro-client/Client.scala b/sbt/src/sbt-test/source-dependencies/macro-name-hashing/macro-client/Client.scala deleted file mode 100644 index 90932d136..000000000 --- a/sbt/src/sbt-test/source-dependencies/macro-name-hashing/macro-client/Client.scala +++ /dev/null @@ -1,5 +0,0 @@ -package macro - -object Client { - Provider.tree(0) -} diff --git a/sbt/src/sbt-test/source-dependencies/macro-name-hashing/macro-provider/Provider.scala b/sbt/src/sbt-test/source-dependencies/macro-name-hashing/macro-provider/Provider.scala deleted file mode 100644 index 9b6d27676..000000000 --- a/sbt/src/sbt-test/source-dependencies/macro-name-hashing/macro-provider/Provider.scala +++ /dev/null @@ -1,8 +0,0 @@ -package macro -import scala.language.experimental.macros -import scala.reflect.macros._ - -object Provider { - def tree(args: Any) = macro treeImpl - def treeImpl(c: Context)(args: c.Expr[Any]) = c.universe.reify(args.splice) -} diff --git a/sbt/src/sbt-test/source-dependencies/macro-name-hashing/macro-provider/changes/Provider.scala b/sbt/src/sbt-test/source-dependencies/macro-name-hashing/macro-provider/changes/Provider.scala deleted file mode 100644 index 711989b32..000000000 --- a/sbt/src/sbt-test/source-dependencies/macro-name-hashing/macro-provider/changes/Provider.scala +++ /dev/null @@ -1,8 +0,0 @@ -package macro -import scala.language.experimental.macros -import scala.reflect.macros._ - -object Provider { - def tree(args: Any) = macro treeImpl - def treeImpl(c: Context)(args: c.Expr[Any]) = sys.error("no macro for you!") -} diff --git a/sbt/src/sbt-test/source-dependencies/macro-name-hashing/project/build.scala b/sbt/src/sbt-test/source-dependencies/macro-name-hashing/project/build.scala deleted file mode 100644 index a5382240f..000000000 --- a/sbt/src/sbt-test/source-dependencies/macro-name-hashing/project/build.scala +++ /dev/null @@ -1,29 +0,0 @@ -import sbt._ -import Keys._ - -object build extends Build { - val defaultSettings = Seq( - libraryDependencies <+= scalaVersion("org.scala-lang" % "scala-reflect" % _ ), - incOptions := incOptions.value.withNameHashing(true) - ) - - lazy val root = Project( - base = file("."), - id = "macro", - aggregate = Seq(macroProvider, macroClient), - settings = Defaults.defaultSettings ++ defaultSettings - ) - - lazy val macroProvider = Project( - base = file("macro-provider"), - id = "macro-provider", - settings = Defaults.defaultSettings ++ defaultSettings - ) - - lazy val macroClient = Project( - base = file("macro-client"), - id = "macro-client", - dependencies = Seq(macroProvider), - settings = Defaults.defaultSettings ++ defaultSettings - ) -} diff --git a/sbt/src/sbt-test/source-dependencies/macro-name-hashing/pending b/sbt/src/sbt-test/source-dependencies/macro/pending similarity index 66% rename from sbt/src/sbt-test/source-dependencies/macro-name-hashing/pending rename to sbt/src/sbt-test/source-dependencies/macro/pending index b3755d4ee..4c633a05d 100644 --- a/sbt/src/sbt-test/source-dependencies/macro-name-hashing/pending +++ b/sbt/src/sbt-test/source-dependencies/macro/pending @@ -1,3 +1,6 @@ +# Marked as pending due to StackOverflow error, see +# https://github.com/sbt/sbt/issues/1544 for details + > compile # replace macro with one that throws an error diff --git a/sbt/src/sbt-test/source-dependencies/macro/test b/sbt/src/sbt-test/source-dependencies/macro/test deleted file mode 100644 index b3755d4ee..000000000 --- a/sbt/src/sbt-test/source-dependencies/macro/test +++ /dev/null @@ -1,13 +0,0 @@ -> compile - -# replace macro with one that throws an error - -$ copy-file macro-provider/changes/Provider.scala macro-provider/Provider.scala - -> macro-provider/compile - --> macro-client/compile - -> clean - --> compile diff --git a/sbt/src/sbt-test/source-dependencies/struct-name-hashing/A.scala b/sbt/src/sbt-test/source-dependencies/struct-name-hashing/A.scala deleted file mode 100644 index d17a6e20a..000000000 --- a/sbt/src/sbt-test/source-dependencies/struct-name-hashing/A.scala +++ /dev/null @@ -1,3 +0,0 @@ -object A { - def x: Int = 3 -} \ No newline at end of file diff --git a/sbt/src/sbt-test/source-dependencies/struct-name-hashing/B.scala b/sbt/src/sbt-test/source-dependencies/struct-name-hashing/B.scala deleted file mode 100644 index 635568727..000000000 --- a/sbt/src/sbt-test/source-dependencies/struct-name-hashing/B.scala +++ /dev/null @@ -1,4 +0,0 @@ -object B { - def onX(m: { def x: Int } ) = - m.x -} \ No newline at end of file diff --git a/sbt/src/sbt-test/source-dependencies/struct-name-hashing/C.scala b/sbt/src/sbt-test/source-dependencies/struct-name-hashing/C.scala deleted file mode 100644 index 413cd6d63..000000000 --- a/sbt/src/sbt-test/source-dependencies/struct-name-hashing/C.scala +++ /dev/null @@ -1,4 +0,0 @@ -object C { - def main(args: Array[String]) = - println(B.onX(A)) -} \ No newline at end of file diff --git a/sbt/src/sbt-test/source-dependencies/struct-name-hashing/build.sbt b/sbt/src/sbt-test/source-dependencies/struct-name-hashing/build.sbt deleted file mode 100644 index 8a38ef414..000000000 --- a/sbt/src/sbt-test/source-dependencies/struct-name-hashing/build.sbt +++ /dev/null @@ -1 +0,0 @@ -incOptions := incOptions.value.withNameHashing(true) diff --git a/sbt/src/sbt-test/source-dependencies/struct-name-hashing/changes/A.scala b/sbt/src/sbt-test/source-dependencies/struct-name-hashing/changes/A.scala deleted file mode 100644 index dc9bbd3c0..000000000 --- a/sbt/src/sbt-test/source-dependencies/struct-name-hashing/changes/A.scala +++ /dev/null @@ -1,3 +0,0 @@ -object A { - def x: Byte = 3 -} diff --git a/sbt/src/sbt-test/source-dependencies/struct-name-hashing/pending b/sbt/src/sbt-test/source-dependencies/struct-name-hashing/pending deleted file mode 100644 index 8c7328ea4..000000000 --- a/sbt/src/sbt-test/source-dependencies/struct-name-hashing/pending +++ /dev/null @@ -1,6 +0,0 @@ -> compile - -# modify A.scala so that it does not conform to the structural type in B.scala -$ copy-file changes/A.scala A.scala - --> compile \ No newline at end of file diff --git a/sbt/src/sbt-test/source-dependencies/struct/pending b/sbt/src/sbt-test/source-dependencies/struct/pending new file mode 100644 index 000000000..72a7a8ebd --- /dev/null +++ b/sbt/src/sbt-test/source-dependencies/struct/pending @@ -0,0 +1,9 @@ +# Marked as pending because name hashing doesn't support structural types +# in some cases. See: https://github.com/sbt/sbt/issues/1545 + +> compile + +# modify A.scala so that it does not conform to the structural type in B.scala +$ copy-file changes/A.scala A.scala + +-> compile diff --git a/sbt/src/sbt-test/source-dependencies/struct/test b/sbt/src/sbt-test/source-dependencies/struct/test deleted file mode 100644 index 8c7328ea4..000000000 --- a/sbt/src/sbt-test/source-dependencies/struct/test +++ /dev/null @@ -1,6 +0,0 @@ -> compile - -# modify A.scala so that it does not conform to the structural type in B.scala -$ copy-file changes/A.scala A.scala - --> compile \ No newline at end of file