From f63cc848881288aa49b6821ac39c9812ec41da9f Mon Sep 17 00:00:00 2001 From: Seth Tisue Date: Wed, 26 Sep 2018 14:56:08 +0200 Subject: [PATCH 01/11] Upgrade build from sbt 0.13.17 to 1.2.3 --- README.md | 2 - build.sbt | 80 +++++++++--------------- project/BuildSettings.scala | 1 - project/Osgi.scala | 1 - project/PartestTestListener.scala | 11 ++-- project/PartestUtil.scala | 2 +- project/Quiet.scala | 23 +------ project/ScriptCommands.scala | 9 +-- project/VersionUtil.scala | 3 +- project/build.properties | 2 +- project/plugins.sbt | 2 +- project/project/plugins.sbt | 2 +- scripts/common | 2 +- test/benchmarks/.gitignore | 16 +---- test/benchmarks/project/build.properties | 1 + test/benchmarks/project/plugins.sbt | 1 + 16 files changed, 47 insertions(+), 111 deletions(-) create mode 100644 test/benchmarks/project/build.properties create mode 100644 test/benchmarks/project/plugins.sbt diff --git a/README.md b/README.md index 9112cef4511e..554ea20c7e13 100644 --- a/README.md +++ b/README.md @@ -139,8 +139,6 @@ Note that sbt's incremental compilation is often too coarse for the Scala compil codebase and re-compiles too many files, resulting in long build times (check [sbt#1104](https://github.com/sbt/sbt/issues/1104) for progress on that front). In the meantime you can: - - Enable "Ant mode" in which sbt only re-compiles source files that were modified. - Create a file `local.sbt` containing the line `antStyle := true`. - Use IntelliJ IDEA for incremental compiles (see [IDE Setup](#ide-setup) below) - its incremental compiler is a bit less conservative, but usually correct. diff --git a/build.sbt b/build.sbt index 2e970c63e4ee..2f3349563377 100644 --- a/build.sbt +++ b/build.sbt @@ -82,7 +82,7 @@ lazy val publishSettings : Seq[Setting[_]] = Seq( else Nil }, // Add a "default" Ivy configuration because sbt expects the Scala distribution to have one: - ivyConfigurations += Configuration("default", "Default", true, List(Configurations.Runtime), true), + ivyConfigurations += Configuration.of("Default", "default", "Default", true, Vector(Configurations.Runtime), true), publishMavenStyle := true ) @@ -126,20 +126,17 @@ lazy val instanceSettings = Seq[Setting[_]]( // sbt claims that s.isManagedVersion is false even though s was resolved by Ivy // We create a managed copy to prevent sbt from putting it on the classpath where we don't want it if(s.isManagedVersion) s else { - val jars = s.jars - val libraryJar = jars.find(_.getName contains "-library").get - val compilerJar = jars.find(_.getName contains "-compiler").get - val extraJars = jars.filter(f => (f ne libraryJar) && (f ne compilerJar)) - val s2 = new ScalaInstance(s.version, s.loader, libraryJar, compilerJar, extraJars, Some(s.actualVersion)) + import sbt.internal.inc.ScalaInstance + val s2 = new ScalaInstance(s.version, s.loader, s.libraryJar, s.compilerJar, s.allJars, Some(s.actualVersion)) assert(s2.isManagedVersion) s2 } }, - // As of sbt 0.13.12 (sbt/sbt#2634) sbt endeavours to align both scalaOrganization and scalaVersion + // sbt endeavours to align both scalaOrganization and scalaVersion // in the Scala artefacts, for example scala-library and scala-compiler. // This doesn't work in the scala/scala build because the version of scala-library and the scalaVersion of // scala-library are correct to be different. So disable overriding. - ivyScala ~= (_ map (_ copy (overrideScalaVersion = false))), + scalaModuleInfo ~= (_ map (_ withOverrideScalaVersion false)), Quiet.silenceScalaBinaryVersionWarning ) @@ -165,25 +162,6 @@ lazy val commonSettings = instanceSettings ++ clearSourceAndResourceDirectories // to make sure they are being cleaned properly cleanFiles += (classDirectory in Compile).value, cleanFiles += (target in Compile in doc).value, - // SBT 0.13.17+ doesn't seem to respect `cleanFiles` anymore: https://github.com/sbt/sbt/pull/3834/files#r172686677 - // Let's override `cleanFilesTask`. - cleanFilesTask := { - val filesAndDirs = (Vector(managedDirectory.value, target.value) ++ cleanFiles.value).distinct - - // START: Copy/pasted from SBT - val preserve = cleanKeepFiles.value - val (dirs, fs) = filesAndDirs.filter(_.exists).partition(_.isDirectory) - val preserveSet = preserve.filter(_.exists).toSet - // performance reasons, only the direct items under `filesAndDirs` are allowed to be preserved. - val dirItems = dirs flatMap { _.*("*").get } - (preserveSet diff dirItems.toSet) match { - case xs if xs.isEmpty => () - case xs => sys.error(s"cleanKeepFiles contains directory/file that are not directly under cleanFiles: $xs") - } - val toClean = (dirItems filterNot { preserveSet(_) }) ++ fs - toClean - // END: Copy/pasted from SBT - }, fork in run := true, scalacOptions in Compile += "-Ywarn-unused:imports", scalacOptions in Compile in doc ++= Seq( @@ -386,7 +364,7 @@ lazy val library = configureAsSubproject(project) // Include *.txt files in source JAR: mappings in Compile in packageSrc ++= { val base = (unmanagedResourceDirectories in Compile).value - base ** "*.txt" pair relativeTo(base) + base ** "*.txt" pair Path.relativeTo(base) }, Osgi.headers += "Import-Package" -> "sun.misc;resolution:=optional, *", Osgi.jarlist := true, @@ -480,7 +458,7 @@ lazy val compiler = configureAsSubproject(project) (unmanagedResourceDirectories in Compile in LocalProject("interactive")).value ++ (unmanagedResourceDirectories in Compile in LocalProject("scaladoc")).value ++ (unmanagedResourceDirectories in Compile in LocalProject("repl")).value - base ** ((includeFilter in unmanagedResources in Compile).value || "*.scala" || "*.psd" || "*.ai" || "*.java") pair relativeTo(base) + base ** ((includeFilter in unmanagedResources in Compile).value || "*.scala" || "*.psd" || "*.ai" || "*.java") pair Path.relativeTo(base) }, // Include the additional projects in the scaladoc JAR: sources in Compile in doc ++= { @@ -722,7 +700,7 @@ lazy val scalacheck = project.in(file("test") / "scalacheck") testOptions ++= { if ((fork in Test).value) Nil else List(Tests.Cleanup { loader => - ModuleUtilities.getObject("scala.TestCleanup", loader).asInstanceOf[Runnable].run() + sbt.internal.inc.ModuleUtilities.getObject("scala.TestCleanup", loader).asInstanceOf[Runnable].run() }) }, libraryDependencies ++= Seq(scalacheckDep), @@ -776,7 +754,7 @@ def osgiTestProject(p: Project, framework: ModuleID) = p val mappings = ((mkPack in dist).value / "lib").listFiles.collect { case f if f.getName.startsWith("scala-") && f.getName.endsWith(".jar") => (f, targetDir / f.getName) } - IO.copy(mappings, overwrite = true) + IO.copy(mappings, CopyOptions() withOverwrite true) targetDir }, cleanFiles += (buildDirectory in ThisBuild).value / "osgi" @@ -828,7 +806,7 @@ lazy val test = project val baseDir = (baseDirectory in ThisBuild).value val instrumentedJar = (packagedArtifact in (LocalProject("specLib"), Compile, packageBin)).value._2 Tests.Setup { () => - // Copy instrumented.jar (from specLib)to the location where partest expects it. + // Copy code.jar (resolved in the otherwise unused scope "test") and instrumented.jar (from specLib)to the location where partest expects them IO.copyFile(instrumentedJar, baseDir / "test/files/speclib/instrumented.jar") } }, @@ -842,12 +820,13 @@ lazy val test = project }, true, Array() ), executeTests in IntegrationTest := { + val log = streams.value.log val result = (executeTests in IntegrationTest).value + val result2 = (executeTests in Test).value if (result.overall != TestResult.Error && result.events.isEmpty) { // workaround for https://github.com/sbt/sbt/issues/2722 - val result = (executeTests in Test).value - (streams.value.log.error("No test events found")) - result.copy(overall = TestResult.Error) + log.error("No test events found") + result2.copy(overall = TestResult.Error) } else result }, @@ -884,13 +863,13 @@ lazy val scalaDist = Project("scala-dist", file(".") / "target" / "scala-dist-di .settings( mappings in Compile in packageBin ++= { val binBaseDir = buildDirectory.value / "pack" - val binMappings = (mkBin in dist).value.pair(relativeTo(binBaseDir), errorIfNone = false) + val binMappings = (mkBin in dist).value.pair(Path.relativeTo(binBaseDir), errorIfNone = false) // With the way the resource files are spread out over the project sources we can't just add // an unmanagedResourceDirectory, so we generate the mappings manually: val docBaseDir = (baseDirectory in ThisBuild).value - val docMappings = (docBaseDir / "doc").*** pair relativeTo(docBaseDir) + val docMappings = (docBaseDir / "doc").allPaths pair Path.relativeTo(docBaseDir) val resBaseDir = (baseDirectory in ThisBuild).value / "src/manual/scala/tools/docutil/resources" - val resMappings = resBaseDir ** ("*.html" | "*.css" | "*.gif" | "*.png") pair (p => relativeTo(resBaseDir)(p).map("doc/tools/" + _)) + val resMappings = resBaseDir ** ("*.html" | "*.css" | "*.gif" | "*.png") pair (p => Path.relativeTo(resBaseDir)(p).map("doc/tools/" + _)) docMappings ++ resMappings ++ binMappings }, resourceGenerators in Compile += Def.task { @@ -903,8 +882,8 @@ lazy val scalaDist = Project("scala-dist", file(".") / "target" / "scala-dist-di runner.value.run("scala.tools.docutil.ManMaker", (fullClasspath in Compile in manual).value.files, Seq(command, htmlOut.getAbsolutePath, manOut.getAbsolutePath), - streams.value.log).foreach(sys.error) - (manOut ** "*.1" pair rebase(manOut, fixedManOut)).foreach { case (in, out) => + streams.value.log).failed foreach (sys error _.getMessage) + (manOut ** "*.1" pair Path.rebase(manOut, fixedManOut)).foreach { case (in, out) => // Generated manpages should always use LF only. There doesn't seem to be a good reason // for generating them with the platform EOL first and then converting them but that's // what the Ant build does. @@ -974,9 +953,9 @@ lazy val root: Project = (project in file(".")) doc in Compile in scalap ).result map (_ -> "doc") )).value + val log = streams.value.log val failed = results.collect { case (Inc(i), d) => (i, d) } if (failed.nonEmpty) { - val log = streams.value.log def showScopedKey(k: Def.ScopedKey[_]): String = Vector( k.scope.project.toOption.map { @@ -1014,11 +993,9 @@ lazy val root: Project = (project in file(".")) throw new RuntimeException } }, - antStyle := false, incOptions := { incOptions.value - .withNameHashing(!antStyle.value).withAntStyle(antStyle.value) - .withRecompileOnMacroDef(false) // // macros in library+reflect are hard-wired to implementations with `FastTrack`. + .withRecompileOnMacroDef(Some(Boolean box false).asJava) // macros in library+reflect are hard-wired to implementations with `FastTrack`. } ) .aggregate(library, reflect, compiler, compilerOptionsExporter, interactive, repl, replJline, replJlineEmbedded, @@ -1056,7 +1033,7 @@ lazy val dist = (project in file("dist")) } val jlineJAR = findJar((dependencyClasspath in Compile).value, jlineDep).get.data val mappings = extraJars.map(f => (f, targetDir / f.getName)) :+ ((jlineJAR, targetDir / "jline.jar")) - IO.copy(mappings, overwrite = true) + IO.copy(mappings, CopyOptions() withOverwrite true) targetDir }, cleanFiles += (buildDirectory in ThisBuild).value / "quick", @@ -1189,6 +1166,7 @@ intellij := { import xml.transform._ val s = streams.value + val compilerScalaInstance = (scalaInstance in LocalProject("compiler")).value val modules: List[(String, Seq[File])] = { // for the sbt build module, the dependencies are fetched from the project's build using sbt-buildinfo @@ -1276,20 +1254,20 @@ intellij := { if (!ipr.exists) { scala.Console.print(s"Could not find src/intellij/scala.ipr. Create new project files from src/intellij/*.SAMPLE (y/N)? ") scala.Console.flush() - if (scala.Console.readLine() == "y") { + if (scala.io.StdIn.readLine() == "y") { intellijCreateFromSample((baseDirectory in ThisBuild).value) continue = true } } else { scala.Console.print("Update library classpaths in the current src/intellij/scala.ipr (y/N)? ") scala.Console.flush() - continue = scala.Console.readLine() == "y" + continue = scala.io.StdIn.readLine() == "y" } if (continue) { s.log.info("Updating library classpaths in src/intellij/scala.ipr.") val content = XML.loadFile(ipr) - val newStarr = replaceLibrary(content, "starr", Some("Scala"), starrDep((scalaInstance in LocalProject("compiler")).value.jars)) + val newStarr = replaceLibrary(content, "starr", Some("Scala"), starrDep(compilerScalaInstance.allJars)) val newModules = modules.foldLeft(newStarr)({ case (res, (modName, jars)) => if (jars.isEmpty) res // modules without dependencies @@ -1308,7 +1286,7 @@ intellijFromSample := { val s = streams.value scala.Console.print(s"Create new project files from src/intellij/*.SAMPLE (y/N)? ") scala.Console.flush() - if (scala.Console.readLine() == "y") + if (scala.io.StdIn.readLine() == "y") intellijCreateFromSample((baseDirectory in ThisBuild).value) else s.log.info("Aborting.") @@ -1317,7 +1295,7 @@ intellijFromSample := { def intellijCreateFromSample(basedir: File): Unit = { val files = basedir / "src/intellij" * "*.SAMPLE" val copies = files.get.map(f => (f, new File(f.getAbsolutePath.stripSuffix(".SAMPLE")))) - IO.copy(copies, overwrite = true) + IO.copy(copies, CopyOptions() withOverwrite true) } lazy val intellijToSample = taskKey[Unit]("Update src/intellij/*.SAMPLE using the current IntelliJ project files.") @@ -1326,7 +1304,7 @@ intellijToSample := { val s = streams.value scala.Console.print(s"Update src/intellij/*.SAMPLE using the current IntelliJ project files (y/N)? ") scala.Console.flush() - if (scala.Console.readLine() == "y") { + if (scala.io.StdIn.readLine() == "y") { val basedir = (baseDirectory in ThisBuild).value val existing = basedir / "src/intellij" * "*.SAMPLE" IO.delete(existing.get) diff --git a/project/BuildSettings.scala b/project/BuildSettings.scala index 8456f91f8643..86d6658648a4 100644 --- a/project/BuildSettings.scala +++ b/project/BuildSettings.scala @@ -5,7 +5,6 @@ import sbt._ /** This object defines keys that should be visible with an unqualified name in all .sbt files and the command line */ object BuildSettings extends AutoPlugin { object autoImport { - lazy val antStyle = settingKey[Boolean]("Use ant-style incremental builds instead of name-hashing") lazy val baseVersion = settingKey[String]("The base version number from which all others are derived") lazy val baseVersionSuffix = settingKey[String]("Identifies the kind of version to build") lazy val mimaReferenceVersion = settingKey[Option[String]]("Scala version number to run MiMa against") diff --git a/project/Osgi.scala b/project/Osgi.scala index 596e33c8642f..c77866145505 100644 --- a/project/Osgi.scala +++ b/project/Osgi.scala @@ -2,7 +2,6 @@ package scala.build import aQute.bnd.osgi.Builder import aQute.bnd.osgi.Constants._ -import java.util.Properties import java.util.jar.Attributes import sbt._ import sbt.Keys._ diff --git a/project/PartestTestListener.scala b/project/PartestTestListener.scala index c7aa00641d7f..83d1e82aefd8 100644 --- a/project/PartestTestListener.scala +++ b/project/PartestTestListener.scala @@ -5,6 +5,7 @@ import java.util.concurrent.TimeUnit import sbt.testing.{SuiteSelector, TestSelector} import sbt.{JUnitXmlTestsListener, TestEvent, TestResult, TestsListener, _} +import sbt.internal.util.EscHelpers.removeEscapeSequences // The default JUnitXMLListener doesn't play well with partest: we end up clobbering the one-and-only partest.xml // file on group of tests run by `testAll`, and the test names in the XML file don't seem to show the path to the @@ -21,9 +22,9 @@ class PartestTestListener(target: File) extends TestsListener { val skipStatus = EnumSet.of(TStatus.Skipped, TStatus.Ignored) override def doInit(): Unit = () - override def doComplete(finalResult: TestResult.Value): Unit = () + override def doComplete(finalResult: TestResult): Unit = () override def endGroup(name: String, t: Throwable): Unit = () - override def endGroup(name: String, result: TestResult.Value): Unit = () + override def endGroup(name: String, result: TestResult): Unit = () override def testEvent(event: TestEvent): Unit = { // E.g "test.files.pos" or "test.scaladoc.run" def groupOf(e: sbt.testing.Event) = { @@ -62,7 +63,7 @@ class PartestTestListener(target: File) extends TestsListener { val writer = new PrintWriter(stringWriter) e.throwable.get.printStackTrace(writer) writer.flush() - ConsoleLogger.removeEscapeSequences(stringWriter.toString) + removeEscapeSequences(stringWriter.toString) } else { "" } @@ -70,13 +71,13 @@ class PartestTestListener(target: File) extends TestsListener { {e.status match { case TStatus.Error if e.throwable.isDefined => - + {trace} case TStatus.Error => case TStatus.Failure if e.throwable.isDefined => - + {trace} case TStatus.Failure => diff --git a/project/PartestUtil.scala b/project/PartestUtil.scala index 40031192e494..423c08eeb1e3 100644 --- a/project/PartestUtil.scala +++ b/project/PartestUtil.scala @@ -10,7 +10,7 @@ object PartestUtil { private def testCaseFinder = (testBase / srcPath).*(AllPassFilter).*(testCaseFilter) private val basePaths = allTestCases.map(_._2.split('/').take(3).mkString("/") + "/").distinct - def allTestCases = testCaseFinder.pair(relativeTo(globalBase)) + def allTestCases = testCaseFinder.pair(io.Path.relativeTo(globalBase)) def basePathExamples = new FixedSetExamples(basePaths) private def equiv(f1: File, f2: File) = f1.getCanonicalFile == f2.getCanonicalFile def parentChain(f: File): Iterator[File] = diff --git a/project/Quiet.scala b/project/Quiet.scala index 8ae08ad5a65a..5f1ef5680feb 100644 --- a/project/Quiet.scala +++ b/project/Quiet.scala @@ -2,32 +2,13 @@ package scala.build import sbt._ import Keys._ +import java.util.function.Supplier object Quiet { // Workaround sbt issue described: // // https://github.com/scala/scala-dev/issues/100 def silenceScalaBinaryVersionWarning = ivyConfiguration := { - ivyConfiguration.value match { - case c: InlineIvyConfiguration => - val delegate = c.log - val logger = new Logger { - override def trace(t: => Throwable): Unit = delegate.trace(t) - override def log(level: sbt.Level.Value, message: => String): Unit = { - level match { - case sbt.Level.Warn => - val message0 = message - val newLevel = if (message.contains("differs from Scala binary version in project")) - delegate.log(sbt.Level.Debug, message) - else - delegate.log(level, message) - case _ => delegate.log(level, message) - } - } - override def success(message: => String): Unit = delegate.success(message) - } - new InlineIvyConfiguration(c.paths, c.resolvers, c.otherResolvers, c.moduleConfigurations, c.localOnly, c.lock, c.checksums, c.resolutionCacheDir, c.updateOptions, logger) - case x => x - } + ivyConfiguration.value // TODO: Needs revisiting in sbt 1 } } diff --git a/project/ScriptCommands.scala b/project/ScriptCommands.scala index ebdf0f04b399..080b0073ad34 100644 --- a/project/ScriptCommands.scala +++ b/project/ScriptCommands.scala @@ -111,14 +111,7 @@ object ScriptCommands { def enableOptimizerCommand = setup("enableOptimizer")(_ => enableOptimizer) private[this] def setup(name: String)(f: Seq[String] => Seq[Setting[_]]) = Command.args(name, name) { case (state, seq) => - // `Project.extract(state).append(f(seq), state)` would be simpler, but it - // takes the project's initial state and discards all changes that were made in the sbt console. - val session = Project.session(state) - val extracted = Project.extract(state) - val settings = f(seq) - val appendSettings = Load.transformSettings(Load.projectScope(extracted.currentRef), extracted.currentRef.build, extracted.rootProject, settings) - val newStructure = Load.reapply(session.mergeSettings ++ appendSettings, extracted.structure)(extracted.showKey) - Project.setProject(session, newStructure, state) + Project.extract(state).appendWithSession(f(seq), state) } val enableOptimizer = Seq( diff --git a/project/VersionUtil.scala b/project/VersionUtil.scala index 99e5285981a8..caa355ca4892 100644 --- a/project/VersionUtil.scala +++ b/project/VersionUtil.scala @@ -1,6 +1,6 @@ package scala.build -import sbt.{stringToProcess => _, _} +import sbt._ import Keys._ import java.util.{Date, Locale, Properties, TimeZone} import java.io.{File, FileInputStream} @@ -109,7 +109,6 @@ object VersionUtil { * suffix is used for releases. All other suffix values are treated as RC / milestone builds. The special suffix * value "SPLIT" is used to split the real suffix off from `baseVersion` instead and then apply the usual logic. */ private lazy val versionPropertiesImpl: Def.Initialize[Versions] = Def.setting { - val log = sLog.value val (date, sha) = (gitProperties.value.date, gitProperties.value.sha) val (base, suffix) = { diff --git a/project/build.properties b/project/build.properties index 8e682c526d5d..0cd8b07982e1 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=0.13.18 +sbt.version=1.2.3 diff --git a/project/plugins.sbt b/project/plugins.sbt index a3442552e679..88c0d29764e9 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,4 +1,4 @@ -scalacOptions ++= Seq("-unchecked", "-feature"/*, "-deprecation"*/, "-Xlint" /*, "-Xfatal-warnings"*/) +scalacOptions ++= Seq("-unchecked", "-feature"/*, "-deprecation", "-Xlint" , "-Xfatal-warnings"*/) libraryDependencies += "org.apache.commons" % "commons-lang3" % "3.3.2" diff --git a/project/project/plugins.sbt b/project/project/plugins.sbt index 04935e456021..22366532fc04 100644 --- a/project/project/plugins.sbt +++ b/project/project/plugins.sbt @@ -1 +1 @@ -addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.6.1") +addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.7.0") diff --git a/scripts/common b/scripts/common index 75a27aca03bb..a16dccb57c8d 100644 --- a/scripts/common +++ b/scripts/common @@ -15,7 +15,7 @@ rm -rf "$WORKSPACE/resolutionScratch_" mkdir -p "$WORKSPACE/resolutionScratch_" SBT_CMD=${SBT_CMD-sbt} -SBT_CMD="$SBT_CMD -sbt-version 0.13.18" +SBT_CMD="$SBT_CMD -sbt-version 1.2.3" # repo to publish builds integrationRepoUrl=${integrationRepoUrl-"https://scala-ci.typesafe.com/artifactory/scala-integration/"} diff --git a/test/benchmarks/.gitignore b/test/benchmarks/.gitignore index 78304b6b90e9..2f7896d1d136 100644 --- a/test/benchmarks/.gitignore +++ b/test/benchmarks/.gitignore @@ -1,15 +1 @@ -/project/project/ -/project/target/ -/target/ - -# what appears to be a Scala IDE-generated file -.cache-main - -# standard Eclipse output directory -/bin/ -.idea - -# sbteclipse-generated Eclipse files -/.classpath -/.project -/.settings/ +target/ diff --git a/test/benchmarks/project/build.properties b/test/benchmarks/project/build.properties new file mode 100644 index 000000000000..64cf32f7f961 --- /dev/null +++ b/test/benchmarks/project/build.properties @@ -0,0 +1 @@ +sbt.version=1.1.4 diff --git a/test/benchmarks/project/plugins.sbt b/test/benchmarks/project/plugins.sbt new file mode 100644 index 000000000000..b57429f738ec --- /dev/null +++ b/test/benchmarks/project/plugins.sbt @@ -0,0 +1 @@ +addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.2.27") From 9a8e046cf0a078c3cffc3a8232ec87747ec069f5 Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Wed, 26 Sep 2018 14:56:18 +0200 Subject: [PATCH 02/11] Various fixes for sbt 1.2 upgrade 1. Adapt to renaming of ivyScala 2. Be less intrusive with customization of baseDirectory In our attempt to make forked project take on the working directory of the root project, rather than of their module, we ended up causing a clash in the directory used by the incremental compiler to backup classfiles, which uses a value relative to that base. The symptom was an intermitten error such as: ``` [error] ## Exception when compiling 0 sources to /Users/jz/code/scala-sbt-1/target/partest-extras/test-classes [error] Could not create directory /Users/jz/code/scala-sbt-1/target/scala-2.13.0-M3/classes.bak ``` This commit adjusts ForkOptions instead to more directly achieve our goal. 3. Heed deprecation warning in ScalaInstance tweak 4. Disable finding sources files in project base Something has changed in SBT 1.x, and our attempt to clear the sources for scalacheck/compile: weren't successful: ``` sbt:root> show scalacheck / Compile / unmanagedSources [info] * /Users/jz/code/scala/test/scalacheck/array-new.scala [info] * /Users/jz/code/scala/test/scalacheck/array-old.scala [info] * /Users/jz/code/scala/test/scalacheck/CheckCollections.scala [info] * /Users/jz/code/scala/test/scalacheck/CheckEither.scala ``` What changed? 4502348a12c, earlier in this PR, removed our override of `baseDirectory`. So sub-projects now have their own sub-directory as the base (which is the standard SBT behaviour). If these include source files directly, as is the case with `./test/scalacheck`, these would be included by virtue of the long standing SBT behaviour to let you skip the hassle of source directories for toy projects. This commit disables that behaviour with `sourcesInBase := false` 5. Fixup OSGi test suite after baseDirectory change 6. Let SBT add api.url to the POM Since https://github.com/sbt/sbt/pull/2262, we don't need to do this. And attempting to do it results in duplicate properties in the POM file, which doesn't pass POM validation by artifactory. 7. Use the recommended, and working, `sbt -warn` In favour of `--warn`, which is broken in SBT 1.x. Early commands are ones that are run before project load, in this case, `-warn` used to mean `-` (schedule early) and `warn` (the command to change log level)`. `sbt-extras` translates its `-w` option into `--warn`, or passes through `--warn` if provided. The official SBT launcher passes through `--warn`. `sbt -warn` still works in 1.x, but `sbt --warn` doesn't give the non-zero error code after a failure. ``` for sbt in 0.13.17 1.1.4; do for opt in "--warn" "-warn"; do (set -x; java -jar /home/jenkins/.sbt/launchers/0.13.17/sbt-launch.jar -Dsbt.version=$sbt $opt 'eval ???'; echo $?;) done; done + java -jar /home/jenkins/.sbt/launchers/0.13.17/sbt-launch.jar -Dsbt.version=0.13.17 --warn 'eval ???' scala.NotImplementedError: an implementation is missing at scala.Predef$.$qmark$qmark$qmark(Predef.scala:252) ... [error] scala.NotImplementedError: an implementation is missing [error] Use 'last' for the full log. + echo 1 1 + java -jar /home/jenkins/.sbt/launchers/0.13.17/sbt-launch.jar -Dsbt.version=0.13.17 -warn 'eval ???' scala.NotImplementedError: an implementation is missing at scala.Predef$.$qmark$qmark$qmark(Predef.scala:252) ... [error] scala.NotImplementedError: an implementation is missing [error] Use 'last' for the full log. + echo 1 1 + java -jar /home/jenkins/.sbt/launchers/0.13.17/sbt-launch.jar -Dsbt.version=1.1.4 --warn 'eval ???' [warn] sbt version mismatch, current: 1.1.4, in build.properties: "0.13.17", use 'reboot' to use the new value. [info] Loading project definition from /tmp/scratch/project [info] Updating ProjectRef(uri("file:/tmp/scratch/project/"), "scratch-build")... [info] Done updating. [info] Set current project to scratch (in build file:/tmp/scratch/) [warn] The `-` command is deprecated in favor of `onFailure` and will be removed in a later version [error] scala.NotImplementedError: an implementation is missing [error] at scala.Predef$.$qmark$qmark$qmark(Predef.scala:284) .. [error] scala.NotImplementedError: an implementation is missing [error] Use 'last' for the full log. + echo 0 0 + java -jar /home/jenkins/.sbt/launchers/0.13.17/sbt-launch.jar -Dsbt.version=1.1.4 -warn 'eval ???' + echo 1 1 ``` This commits changes our scripts to use the recommended `-warn`. However, I'd say that SBT 1.x should either reject `--warn` outright or be compatible with the old behaviour. --- build.sbt | 62 ++++++++++++++--------------- project/Quiet.scala | 4 +- scripts/jobs/integrate/windows | 4 +- scripts/jobs/validate/publish-core | 4 +- scripts/jobs/validate/test | 2 +- test/osgi/src/ScalaOsgiHelper.scala | 1 + 6 files changed, 37 insertions(+), 40 deletions(-) diff --git a/build.sbt b/build.sbt index 2f3349563377..764a5b504faf 100644 --- a/build.sbt +++ b/build.sbt @@ -127,7 +127,7 @@ lazy val instanceSettings = Seq[Setting[_]]( // We create a managed copy to prevent sbt from putting it on the classpath where we don't want it if(s.isManagedVersion) s else { import sbt.internal.inc.ScalaInstance - val s2 = new ScalaInstance(s.version, s.loader, s.libraryJar, s.compilerJar, s.allJars, Some(s.actualVersion)) + val s2 = new ScalaInstance(s.version, s.loader, s.loaderLibraryOnly, s.libraryJar, s.compilerJar, s.allJars, Some(s.actualVersion)) assert(s2.isManagedVersion) s2 } @@ -149,6 +149,7 @@ lazy val commonSettings = instanceSettings ++ clearSourceAndResourceDirectories sourceDirectory in Compile := baseDirectory.value, unmanagedSourceDirectories in Compile := List(baseDirectory.value), unmanagedResourceDirectories in Compile += (baseDirectory in ThisBuild).value / "src" / thisProject.value.id, + sourcesInBase := false, scalaSource in Compile := (sourceDirectory in Compile).value, javaSource in Compile := (sourceDirectory in Compile).value, // resources are stored along source files in our current layout @@ -178,32 +179,24 @@ lazy val commonSettings = instanceSettings ++ clearSourceAndResourceDirectories apiURL := Some(url("https://www.scala-lang.org/api/" + versionProperties.value.mavenVersion + "/")), pomIncludeRepository := { _ => false }, pomExtra := { - val base = - - scm:git:git://github.com/scala/scala.git - https://github.com/scala/scala.git - - - GitHub - https://github.com/scala/bug/issues - - - - lamp - LAMP/EPFL - - - Lightbend - Lightbend, Inc. - - - apiURL.value match { - case Some(url) => base ++ - - {url.toString} - - case None => base - } + + scm:git:git://github.com/scala/scala.git + https://github.com/scala/scala.git + + + GitHub + https://github.com/scala/bug/issues + + + + lamp + LAMP/EPFL + + + Lightbend + Lightbend, Inc. + + }, headerLicense := (headerLicense in ThisBuild).value, // Remove auto-generated manifest attributes @@ -212,10 +205,6 @@ lazy val commonSettings = instanceSettings ++ clearSourceAndResourceDirectories // Lets us CTRL-C partest without exiting SBT entirely cancelable in Global := true, - // When we fork subprocesses, use the base directory as the working directory. - // This enables `sbt> partest test/files/run/t1.scala` or `sbt> scalac sandbox/test.scala` - baseDirectory in Compile := (baseDirectory in ThisBuild).value, - baseDirectory in Test := (baseDirectory in ThisBuild).value, // Don't pick up source files from the project root. sourcesInBase := false, @@ -223,7 +212,7 @@ lazy val commonSettings = instanceSettings ++ clearSourceAndResourceDirectories // Don't log process output (e.g. of forked `compiler/runMain ...Main`), just pass it // directly to stdout outputStrategy in run := Some(StdoutOutput) -) ++ removePomDependencies +) ++ removePomDependencies ++ setForkedWorkingDirectory /** Extra post-processing for the published POM files. These are needed to create POMs that * are equivalent to the ones from the Ant build. In the long term this should be removed and @@ -340,6 +329,13 @@ def regexFileFilter(s: String): FileFilter = new FileFilter { def accept(f: File) = pat.matcher(f.getAbsolutePath.replace('\\', '/')).matches() } +def setForkedWorkingDirectory: Seq[Setting[_]] = { + // When we fork subprocesses, use the base directory as the working directory. + // This“ enables `sbt> partest test/files/run/t1.scala` or `sbt> scalac sandbox/test.scala` + val setting = (forkOptions in Compile) := (forkOptions in Compile).value.withWorkingDirectory((baseDirectory in ThisBuild).value) + setting ++ inTask(run)(setting) +} + // This project provides the STARR scalaInstance for bootstrapping lazy val bootstrap = project in file("target/bootstrap") @@ -746,6 +742,8 @@ def osgiTestProject(p: Project, framework: ModuleID) = p }, Keys.test in Test := (Keys.test in Test).dependsOn(packageBin in Compile).value, testOptions += Tests.Argument(TestFrameworks.JUnit, "-a", "-v", "-q"), + javaOptions in Test += "-Dscala.bundle.dir=" + (buildDirectory in ThisBuild).value / "osgi", + (forkOptions in Test in test) := (forkOptions in Test in test).value.withWorkingDirectory((baseDirectory in ThisBuild).value), unmanagedSourceDirectories in Test := List((baseDirectory in ThisBuild).value / "test" / "osgi" / "src"), unmanagedResourceDirectories in Compile := (unmanagedSourceDirectories in Test).value, includeFilter in unmanagedResources in Compile := "*.xml", diff --git a/project/Quiet.scala b/project/Quiet.scala index 5f1ef5680feb..5e9f37a717a8 100644 --- a/project/Quiet.scala +++ b/project/Quiet.scala @@ -8,7 +8,5 @@ object Quiet { // Workaround sbt issue described: // // https://github.com/scala/scala-dev/issues/100 - def silenceScalaBinaryVersionWarning = ivyConfiguration := { - ivyConfiguration.value // TODO: Needs revisiting in sbt 1 - } + def silenceScalaBinaryVersionWarning = scalaModuleInfo ~= (x => x.map(_.withCheckExplicit(false))) } diff --git a/scripts/jobs/integrate/windows b/scripts/jobs/integrate/windows index 2ed88c55589d..6eac136fa8af 100755 --- a/scripts/jobs/integrate/windows +++ b/scripts/jobs/integrate/windows @@ -10,8 +10,8 @@ generateRepositoriesConfig SBT="java $JAVA_OPTS -Dsbt.ivy.home=$WORKSPACE/.ivy2 -jar $sbtLauncher -Dsbt.override.build.repos=true -Dsbt.repository.config=$sbtRepositoryConfig" # Build locker with STARR -$SBT --warn "setupPublishCore" generateBuildCharacterPropertiesFile publishLocal +$SBT -warn "setupPublishCore" generateBuildCharacterPropertiesFile publishLocal # Build quick and run the tests parseScalaProperties buildcharacter.properties -$SBT -Dstarr.version=$maven_version_number --warn "setupValidateTest" testAll +$SBT -Dstarr.version=$maven_version_number -warn "setupValidateTest" testAll diff --git a/scripts/jobs/validate/publish-core b/scripts/jobs/validate/publish-core index 1b1f4bed9880..ff9cbc2c9c58 100755 --- a/scripts/jobs/validate/publish-core +++ b/scripts/jobs/validate/publish-core @@ -17,7 +17,7 @@ case $prDryRun in ;; *) echo ">>> Getting Scala version number." - $SBT --warn "setupPublishCore $prRepoUrl" generateBuildCharacterPropertiesFile + $SBT -warn "setupPublishCore $prRepoUrl" generateBuildCharacterPropertiesFile parseScalaProperties buildcharacter.properties # produce maven_version_number echo ">>> Checking availability of Scala ${maven_version_number} in $prRepoUrl." @@ -28,7 +28,7 @@ case $prDryRun in if $libraryAvailable && $reflectAvailable && $compilerAvailable; then echo "Scala core already built!" else - $SBT --warn "setupPublishCore $prRepoUrl" publish + $SBT -warn "setupPublishCore $prRepoUrl" publish fi mv buildcharacter.properties jenkins.properties # parsed by the jenkins job diff --git a/scripts/jobs/validate/test b/scripts/jobs/validate/test index a155df4ce04e..7dd61c837bcc 100755 --- a/scripts/jobs/validate/test +++ b/scripts/jobs/validate/test @@ -18,7 +18,7 @@ case $prDryRun in # and run JUnit tests, ScalaCheck tests, partest, OSGi tests, MiMa and scaladoc $SBT \ -Dstarr.version=$scalaVersion \ - --warn \ + -warn \ "setupValidateTest $prRepoUrl" \ $testExtraArgs \ testAll diff --git a/test/osgi/src/ScalaOsgiHelper.scala b/test/osgi/src/ScalaOsgiHelper.scala index 7ba8883bb8cf..dd400fffcbe8 100644 --- a/test/osgi/src/ScalaOsgiHelper.scala +++ b/test/osgi/src/ScalaOsgiHelper.scala @@ -7,6 +7,7 @@ import java.io.File trait ScalaOsgiHelper { private def allBundleFiles = { + println(new File(".").getAbsolutePath) def bundleLocation = new File(sys.props.getOrElse("scala.bundle.dir", "build/osgi")) bundleLocation.listFiles filter (_.getName endsWith ".jar") } From 07b70e956ba78d63822e4a74c4bdbbe7dbc96f45 Mon Sep 17 00:00:00 2001 From: Seth Tisue Date: Tue, 5 Feb 2019 17:18:44 -0800 Subject: [PATCH 03/11] sbt 1.2.8 (was 1.2.7) just keeping current --- scripts/common | 2 +- test/benchmarks/project/build.properties | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/common b/scripts/common index a16dccb57c8d..a7f14c78450c 100644 --- a/scripts/common +++ b/scripts/common @@ -15,7 +15,7 @@ rm -rf "$WORKSPACE/resolutionScratch_" mkdir -p "$WORKSPACE/resolutionScratch_" SBT_CMD=${SBT_CMD-sbt} -SBT_CMD="$SBT_CMD -sbt-version 1.2.3" +SBT_CMD="$SBT_CMD -sbt-version 1.2.8" # repo to publish builds integrationRepoUrl=${integrationRepoUrl-"https://scala-ci.typesafe.com/artifactory/scala-integration/"} diff --git a/test/benchmarks/project/build.properties b/test/benchmarks/project/build.properties index 64cf32f7f961..c0bab04941d7 100644 --- a/test/benchmarks/project/build.properties +++ b/test/benchmarks/project/build.properties @@ -1 +1 @@ -sbt.version=1.1.4 +sbt.version=1.2.8 From e0d9ce6ce5bd3b494dfee4dcd781120bf6bd3086 Mon Sep 17 00:00:00 2001 From: Seth Tisue Date: Tue, 5 Nov 2019 07:12:26 -0800 Subject: [PATCH 04/11] upgrade to sbt 1.3.7 (from 1.2.8) in order to also allow building on JDK 13+, we also disambiguate some overloads and remove a no-longer-necesary scalaVersion override (at the build definition level) note that to use current sbt, we must also use current mima and exclude some spurious issues it reports this commit also includes some Dotty changes, contributed by Guillaume Martres. he describes them as follows: Fix stdlib compilation with dotty when using sbt 1.3 When we compile the standard library with dotty, we actually compile the scala-library and dotty-library sources together in one go since we can't in general reuse a dotty-library compiled with an old scala-library. There were two problems with the way this was done that were somehow masked so far (likely because of classpath pollution, but I don't know what changed in sbt 1.3 exactly): - Compiling the stdlib requires having all sources on the -sourcepath, but the sources from dotty-library itself were missing. - the files in scalaShadowing/ in dotty-library do need to be compiled, the comment above the exclusion was wrong. Additionally, I also removed the other exclusions done to files in dotty-library because they're no longer necessary. Co-authored-by: Guillaume Martres --- build.sbt | 219 +++++++++++++++++- project/build.properties | 2 +- project/plugins.sbt | 2 +- scripts/common | 2 +- .../nsc/classpath/DirectoryClassPath.scala | 2 +- src/intellij/junit.iml.SAMPLE | 2 +- src/intellij/repl.iml.SAMPLE | 2 +- src/intellij/scala.ipr.SAMPLE | 57 +++-- .../mima-filters/2.12.0.backwards.excludes | 11 - .../mima-filters/2.12.0.forwards.excludes | 59 ----- .../mima-filters/2.12.0.backwards.excludes | 26 --- .../mima-filters/2.12.0.forwards.excludes | 52 ----- test/benchmarks/project/build.properties | 2 +- .../jvm/NestedClassesCollectorTest.scala | 4 +- 14 files changed, 260 insertions(+), 182 deletions(-) delete mode 100644 src/library/mima-filters/2.12.0.backwards.excludes delete mode 100644 src/library/mima-filters/2.12.0.forwards.excludes delete mode 100644 src/reflect/mima-filters/2.12.0.backwards.excludes delete mode 100644 src/reflect/mima-filters/2.12.0.forwards.excludes diff --git a/build.sbt b/build.sbt index 764a5b504faf..6b02be59026f 100644 --- a/build.sbt +++ b/build.sbt @@ -32,7 +32,7 @@ * - to modularize the Scala compiler or library further */ -import sbt.TestResult +import sbt.{Global, TestResult} import scala.build._ import VersionUtil._ @@ -110,7 +110,211 @@ headerLicense in ThisBuild := Some(HeaderLicense.Custom( |""".stripMargin )) -mimaReferenceVersion in Global := Some("2.12.0") +Global / mimaReferenceVersion := Some("2.12.0") + +import com.typesafe.tools.mima.core._ +val mimaFilterSettings = Seq { + mimaBinaryIssueFilters ++= Seq( + ProblemFilters.exclude[IncompatibleSignatureProblem]("*"), + ProblemFilters.exclude[InaccessibleMethodProblem]("java.lang.Object."), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Vector.debug"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.VectorBuilder.debug"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.VectorPointer.debug"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.VectorIterator.debug"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.mutable.OpenHashMap.nextPositivePowerOfTwo"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.mutable.HashTable.powerOfTwo"), + ProblemFilters.exclude[MissingClassProblem]("scala.concurrent.impl.ExecutionContextImpl$AdaptedForkJoinTask"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.sys.process.ProcessImpl#CompoundProcess.getExitValue"), + + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.sys.process.ProcessImpl#CompoundProcess.futureValue"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.sys.process.ProcessImpl#CompoundProcess.futureThread"), + + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.mutable.HashTable.nextPositivePowerOfTwo"), + + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.util.hashing.MurmurHash3.wrappedBytesHash"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.util.hashing.MurmurHash3.wrappedArrayHash"), + + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.HashMap.contains0"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.HashMap#HashTrieMap.contains0"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.HashMap#HashMapCollision1.contains0"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.HashMap#HashMap1.contains0"), + + ProblemFilters.exclude[MissingClassProblem]("scala.annotation.showAsInfix$"), + ProblemFilters.exclude[MissingClassProblem]("scala.annotation.showAsInfix"), + + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.util.PropertiesTrait.coloredOutputEnabled"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.util.Properties.coloredOutputEnabled"), + + // https://github.com/scala/scala/pull/6101 + ProblemFilters.exclude[MissingTypesProblem]("scala.runtime.LazyRef"), + ProblemFilters.exclude[MissingTypesProblem]("scala.runtime.LazyDouble"), + ProblemFilters.exclude[MissingTypesProblem]("scala.runtime.LazyChar"), + ProblemFilters.exclude[MissingTypesProblem]("scala.runtime.LazyUnit"), + ProblemFilters.exclude[MissingTypesProblem]("scala.runtime.LazyShort"), + ProblemFilters.exclude[MissingTypesProblem]("scala.runtime.LazyInt"), + ProblemFilters.exclude[MissingTypesProblem]("scala.runtime.LazyByte"), + ProblemFilters.exclude[MissingTypesProblem]("scala.runtime.LazyLong"), + ProblemFilters.exclude[MissingTypesProblem]("scala.runtime.LazyBoolean"), + ProblemFilters.exclude[MissingTypesProblem]("scala.runtime.LazyFloat"), + ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.LazyRef.serialVersionUID"), + ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.LazyDouble.serialVersionUID"), + ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.LazyChar.serialVersionUID"), + ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.LazyUnit.serialVersionUID"), + ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.LazyShort.serialVersionUID"), + ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.LazyInt.serialVersionUID"), + ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.LazyByte.serialVersionUID"), + ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.LazyLong.serialVersionUID"), + ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.LazyBoolean.serialVersionUID"), + ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.LazyFloat.serialVersionUID"), + + // https://github.com/scala/scala/pull/6138 + ProblemFilters.exclude[MissingFieldProblem]("scala.collection.immutable.Map#EmptyMap.serialVersionUID"), + ProblemFilters.exclude[MissingFieldProblem]("scala.collection.immutable.Map#Map1.serialVersionUID"), + ProblemFilters.exclude[MissingFieldProblem]("scala.collection.immutable.Map#Map2.serialVersionUID"), + ProblemFilters.exclude[MissingFieldProblem]("scala.collection.immutable.Map#Map3.serialVersionUID"), + ProblemFilters.exclude[MissingFieldProblem]("scala.collection.immutable.Map#Map4.serialVersionUID"), + ProblemFilters.exclude[DirectAbstractMethodProblem]("scala.collection.GenTraversableOnce.toList"), + + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.HashMap.foreachEntry"), + ProblemFilters.exclude[MissingClassProblem]("scala.collection.immutable.Map$HashCodeAccumulator"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.RedBlackTree.foreachEntry"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.HashMap#HashTrieMap.foreachEntry"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.ListMap.foreachEntry"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.HashMap#HashMap1.foreachEntry"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.HashMap#HashMapCollision1.foreachEntry"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.util.hashing.MurmurHash3.product2Hash"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.util.hashing.MurmurHash3.emptyMapHash"), + + // Some static forwarder changes detected after a MiMa upgrade. + // e.g. static method apply(java.lang.Object)java.lang.Object in class scala.Symbol does not have a correspondent in current version + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.Symbol.apply"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.sys.process.Process.Future"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.sys.process.Process.Spawn"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Nil.takeWhile"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Nil.slice"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Nil.drop"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Nil.take"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Nil.seq"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Nil.seq"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Nil.seq"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Nil.seq"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Nil.toSeq"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Nil.reverse"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Nil.toCollection"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Nil.thisCollection"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Nil.seq"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Nil.andThen"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Nil.view"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Nil.view"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Nil.dropRight"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Nil.takeRight"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Nil.takeWhile"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Nil.drop"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Nil.take"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Nil.slice"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Nil.head"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Nil.thisCollection"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Nil.seq"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Nil.reversed"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Nil.view"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Nil.view"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Nil.dropWhile"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Nil.tail"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Nil.thisCollection"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Nil.seq"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.List.empty"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Queue.empty"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Vector.empty"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Stream.iterate"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Stream.range"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Stream.tabulate"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Stream.fill"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Stream.empty"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.mutable.LinkedList.empty"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.util.Properties.scalaProps"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.util.Properties.propFilename"), + + // + // scala-relect + // + ProblemFilters.exclude[Problem]("scala.reflect.internal.*"), + ProblemFilters.exclude[IncompatibleMethTypeProblem]("scala.reflect.runtime.JavaMirrors#JavaMirror.unpickleClass"), + ProblemFilters.exclude[IncompatibleMethTypeProblem]("scala.reflect.runtime.SymbolLoaders#TopClassCompleter.this"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.runtime.SynchronizedOps#SynchronizedBaseTypeSeq.lateMap"), + ProblemFilters.exclude[ReversedMissingMethodProblem]("scala.reflect.runtime.SynchronizedSymbols#SynchronizedSymbol.scala$reflect$runtime$SynchronizedSymbols$SynchronizedSymbol$$super$exists"), + ProblemFilters.exclude[ReversedMissingMethodProblem]("scala.reflect.runtime.SynchronizedSymbols#SynchronizedSymbol.scala$reflect$runtime$SynchronizedSymbols$SynchronizedSymbol$$super$getFlag"), + ProblemFilters.exclude[ReversedMissingMethodProblem]("scala.reflect.runtime.SynchronizedSymbols#SynchronizedSymbol.scala$reflect$runtime$SynchronizedSymbols$SynchronizedSymbol$$super$privateWithin"), + ProblemFilters.exclude[ReversedMissingMethodProblem]("scala.reflect.runtime.SynchronizedSymbols#SynchronizedSymbol.scala$reflect$runtime$SynchronizedSymbols$SynchronizedSymbol$$super$annotations"), + ProblemFilters.exclude[MissingClassProblem]("scala.reflect.io.IOStats"), + ProblemFilters.exclude[MissingClassProblem]("scala.reflect.io.IOStats$"), + ProblemFilters.exclude[MissingTypesProblem]("scala.reflect.runtime.JavaUniverse"), + ProblemFilters.exclude[ReversedMissingMethodProblem]("scala.reflect.io.ZipArchive.close"), + ProblemFilters.exclude[IncompatibleMethTypeProblem]("scala.reflect.io.ZipArchive.getDir"), + ProblemFilters.exclude[IncompatibleResultTypeProblem]("scala.reflect.io.FileZipArchive.allDirs"), + ProblemFilters.exclude[ReversedMissingMethodProblem]("scala.reflect.runtime.SynchronizedSymbols#SynchronizedSymbol.scala$reflect$runtime$SynchronizedSymbols$SynchronizedSymbol$$super$typeConstructor"), + ProblemFilters.exclude[ReversedMissingMethodProblem]("scala.reflect.runtime.SynchronizedTypes.scala$reflect$runtime$SynchronizedTypes$$super$defineNormalized"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.runtime.SynchronizedTypes.defineNormalized"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.runtime.JavaUniverse.defineNormalized"), + + ProblemFilters.exclude[Problem]("scala.reflect.internal.*"), + + ProblemFilters.exclude[IncompatibleMethTypeProblem]("scala.reflect.runtime.JavaMirrors#JavaMirror.unpickleClass"), + ProblemFilters.exclude[IncompatibleMethTypeProblem]("scala.reflect.runtime.SymbolLoaders#TopClassCompleter.this"), + + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.runtime.Settings.Yvirtpatmat"), + ProblemFilters.exclude[MissingClassProblem]("scala.reflect.io.PlainNioFile"), + + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.runtime.SynchronizedOps.newMappedBaseTypeSeq"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.runtime.JavaUniverse.newMappedBaseTypeSeq"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.runtime.JavaUniverse.statistics"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.runtime.JavaMirrors#JavaMirror#JavaAnnotationProxy.transformArgs"), + + ProblemFilters.exclude[MissingClassProblem]("scala.reflect.io.FileZipArchive$LazyEntry"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.io.ZipArchive.closeZipFile"), + ProblemFilters.exclude[MissingClassProblem]("scala.reflect.io.FileZipArchive$LeakyEntry"), + + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.runtime.SynchronizedSymbols#SynchronizedSymbol.exists"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.runtime.SynchronizedSymbols#SynchronizedSymbol.getFlag"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.runtime.SynchronizedSymbols#SynchronizedSymbol.privateWithin"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.runtime.SynchronizedSymbols#SynchronizedSymbol.annotations"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.runtime.Settings.isScala213"), + + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.io.FileZipArchive.this"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.io.ZipArchive.this"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.io.ZipArchive.getDir"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.io.FileZipArchive.allDirsByDottedName"), + + ProblemFilters.exclude[MissingClassProblem]("scala.reflect.io.RootPath"), + ProblemFilters.exclude[MissingClassProblem]("scala.reflect.io.RootPath$"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.io.URLZipArchive.close"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.io.FileZipArchive.close"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.io.ManifestResources.close"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.io.ZipArchive.close"), + + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.runtime.JavaMirrors#JavaMirror.typeTag"), + ProblemFilters.exclude[MissingClassProblem]("scala.reflect.runtime.JavaMirrors$JavaMirror$typeTagCache$"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.api.TypeTags.TypeTagImpl"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.api.Universe.TypeTagImpl"), + + ProblemFilters.exclude[MissingClassProblem]("scala.reflect.macros.Attachments$"), + + ProblemFilters.exclude[IncompatibleMethTypeProblem]("scala.reflect.io.ZipArchive.getDir"), + ProblemFilters.exclude[IncompatibleResultTypeProblem]("scala.reflect.io.FileZipArchive.allDirs"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.runtime.SynchronizedSymbols#SynchronizedSymbol.typeConstructor"), + + ProblemFilters.exclude[ReversedMissingMethodProblem]("scala.reflect.runtime.SynchronizedTypes.scala$reflect$runtime$SynchronizedTypes$$super$defineNormalized"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.runtime.SynchronizedTypes.defineNormalized"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.runtime.JavaUniverse.defineNormalized"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.io.AbstractFile.unsafeToByteArray"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.io.VirtualFile.unsafeToByteArray"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.io.ZipArchive#Entry.unsafeToByteArray"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.io.NoAbstractFile.unsafeToByteArray"), + + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.io.NoAbstractFile.seq"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.io.NoAbstractFile.view"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.io.NoAbstractFile.view"), + ) +} scalaVersion in Global := versionProps("starr.version") @@ -127,7 +331,7 @@ lazy val instanceSettings = Seq[Setting[_]]( // We create a managed copy to prevent sbt from putting it on the classpath where we don't want it if(s.isManagedVersion) s else { import sbt.internal.inc.ScalaInstance - val s2 = new ScalaInstance(s.version, s.loader, s.loaderLibraryOnly, s.libraryJar, s.compilerJar, s.allJars, Some(s.actualVersion)) + val s2 = new ScalaInstance(s.version, s.loader, s.loaderLibraryOnly, s.libraryJars, s.compilerJar, s.allJars, Some(s.actualVersion)) assert(s2.isManagedVersion) s2 } @@ -372,7 +576,8 @@ lazy val library = configureAsSubproject(project) // Remove the dependency on "forkjoin" from the POM because it is included in the JAR: pomDependencyExclusions += ((organization.value, "forkjoin")), mimaPreviousArtifacts := mimaReferenceVersion.value.map(organization.value % name.value % _).toSet, - mimaCheckDirection := "both" + mimaCheckDirection := "both", + mimaFilterSettings, ) .settings(filterDocSources("*.scala" -- (regexFileFilter(".*/runtime/.*\\$\\.scala") || regexFileFilter(".*/runtime/ScalaRunTime\\.scala") || @@ -382,6 +587,7 @@ lazy val reflect = configureAsSubproject(project) .settings(generatePropertiesFileSettings) .settings(Osgi.settings) .settings(AutomaticModuleName.settings("scala.reflect")) + .settings(mimaFilterSettings) .settings( name := "scala-reflect", description := "Scala Reflection Library", @@ -399,7 +605,8 @@ lazy val reflect = configureAsSubproject(project) "/project/packaging" -> jar ), mimaPreviousArtifacts := mimaReferenceVersion.value.map(organization.value % name.value % _).toSet, - mimaCheckDirection := "both" + mimaCheckDirection := "both", + mimaFilterSettings, ) .dependsOn(library) @@ -439,7 +646,7 @@ lazy val compiler = configureAsSubproject(project) // (with strings) to deal with mutual recursion products in Compile in packageBin := (products in Compile in packageBin).value ++ - Seq((dependencyClasspath in Compile).value.find(_.get(moduleID.key) == Some(asmDep)).get.data) ++ + Seq((dependencyClasspath in Compile).value.find(_.get(moduleID.key).map(id => (id.organization, id.name, id.revision)).contains((asmDep.organization, asmDep.name, asmDep.revision))).get.data) ++ (products in Compile in packageBin in LocalProject("interactive")).value ++ (products in Compile in packageBin in LocalProject("scaladoc")).value ++ (products in Compile in packageBin in LocalProject("repl")).value ++ diff --git a/project/build.properties b/project/build.properties index 0cd8b07982e1..a82bb05e1295 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.2.3 +sbt.version=1.3.7 diff --git a/project/plugins.sbt b/project/plugins.sbt index 88c0d29764e9..15fe7394f6ee 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -18,7 +18,7 @@ buildInfoKeys := Seq[BuildInfoKey](buildClasspath) buildInfoPackage := "scalabuild" -addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "0.1.18") +addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "0.6.1") libraryDependencies ++= Seq( "org.eclipse.jgit" % "org.eclipse.jgit" % "4.6.0.201612231935-r", diff --git a/scripts/common b/scripts/common index a7f14c78450c..ec40463791dc 100644 --- a/scripts/common +++ b/scripts/common @@ -15,7 +15,7 @@ rm -rf "$WORKSPACE/resolutionScratch_" mkdir -p "$WORKSPACE/resolutionScratch_" SBT_CMD=${SBT_CMD-sbt} -SBT_CMD="$SBT_CMD -sbt-version 1.2.8" +SBT_CMD="$SBT_CMD -sbt-version 1.3.7" # repo to publish builds integrationRepoUrl=${integrationRepoUrl-"https://scala-ci.typesafe.com/artifactory/scala-integration/"} diff --git a/src/compiler/scala/tools/nsc/classpath/DirectoryClassPath.scala b/src/compiler/scala/tools/nsc/classpath/DirectoryClassPath.scala index edc427854edf..3d3a6b31881b 100644 --- a/src/compiler/scala/tools/nsc/classpath/DirectoryClassPath.scala +++ b/src/compiler/scala/tools/nsc/classpath/DirectoryClassPath.scala @@ -230,7 +230,7 @@ final class JrtClassPath(fs: java.nio.file.FileSystem) extends ClassPath with No final class CtSymClassPath(ctSym: java.nio.file.Path, release: Int) extends ClassPath with NoSourcePaths with Closeable { import java.nio.file.Path, java.nio.file._ - private val fileSystem: FileSystem = FileSystems.newFileSystem(ctSym, null) + private val fileSystem: FileSystem = FileSystems.newFileSystem(ctSym, null: ClassLoader) private val root: Path = fileSystem.getRootDirectories.iterator().next private val roots = Files.newDirectoryStream(root).iterator().asScala.toList diff --git a/src/intellij/junit.iml.SAMPLE b/src/intellij/junit.iml.SAMPLE index dc0dd9c1199d..f830c904e97c 100644 --- a/src/intellij/junit.iml.SAMPLE +++ b/src/intellij/junit.iml.SAMPLE @@ -1,6 +1,6 @@ - + diff --git a/src/intellij/repl.iml.SAMPLE b/src/intellij/repl.iml.SAMPLE index 07e2923726e5..6c15026a084b 100644 --- a/src/intellij/repl.iml.SAMPLE +++ b/src/intellij/repl.iml.SAMPLE @@ -1,6 +1,6 @@ - + diff --git a/src/intellij/scala.ipr.SAMPLE b/src/intellij/scala.ipr.SAMPLE index fdad3dbe6895..4d6d15b66380 100644 --- a/src/intellij/scala.ipr.SAMPLE +++ b/src/intellij/scala.ipr.SAMPLE @@ -18,8 +18,8 @@ - @@ -154,6 +154,27 @@ + + @@ -208,7 +229,6 @@ - @@ -222,21 +242,21 @@ - - - - - - - - - - - - + + + + + + + + + + + + - - + + @@ -447,7 +467,6 @@ - - + \ No newline at end of file diff --git a/src/library/mima-filters/2.12.0.backwards.excludes b/src/library/mima-filters/2.12.0.backwards.excludes deleted file mode 100644 index 7cc922be8b8a..000000000000 --- a/src/library/mima-filters/2.12.0.backwards.excludes +++ /dev/null @@ -1,11 +0,0 @@ -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Vector.debug") -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.VectorBuilder.debug") -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.VectorPointer.debug") -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.VectorIterator.debug") - -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.mutable.OpenHashMap.nextPositivePowerOfTwo") -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.mutable.HashTable.powerOfTwo") - -ProblemFilters.exclude[MissingClassProblem]("scala.concurrent.impl.ExecutionContextImpl$AdaptedForkJoinTask") - -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.sys.process.ProcessImpl#CompoundProcess.getExitValue") \ No newline at end of file diff --git a/src/library/mima-filters/2.12.0.forwards.excludes b/src/library/mima-filters/2.12.0.forwards.excludes deleted file mode 100644 index 6ff6b2ca50d9..000000000000 --- a/src/library/mima-filters/2.12.0.forwards.excludes +++ /dev/null @@ -1,59 +0,0 @@ -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.sys.process.ProcessImpl#CompoundProcess.futureValue") -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.sys.process.ProcessImpl#CompoundProcess.futureThread") - -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.mutable.HashTable.nextPositivePowerOfTwo") - -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.util.hashing.MurmurHash3.wrappedBytesHash") -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.util.hashing.MurmurHash3.wrappedArrayHash") - -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.HashMap.contains0") -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.HashMap#HashTrieMap.contains0") -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.HashMap#HashMapCollision1.contains0") -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.HashMap#HashMap1.contains0") - -ProblemFilters.exclude[MissingClassProblem]("scala.annotation.showAsInfix$") -ProblemFilters.exclude[MissingClassProblem]("scala.annotation.showAsInfix") - -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.util.PropertiesTrait.coloredOutputEnabled") -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.util.Properties.coloredOutputEnabled") - -# https://github.com/scala/scala/pull/6101 -ProblemFilters.exclude[MissingTypesProblem]("scala.runtime.LazyRef") -ProblemFilters.exclude[MissingTypesProblem]("scala.runtime.LazyDouble") -ProblemFilters.exclude[MissingTypesProblem]("scala.runtime.LazyChar") -ProblemFilters.exclude[MissingTypesProblem]("scala.runtime.LazyUnit") -ProblemFilters.exclude[MissingTypesProblem]("scala.runtime.LazyShort") -ProblemFilters.exclude[MissingTypesProblem]("scala.runtime.LazyInt") -ProblemFilters.exclude[MissingTypesProblem]("scala.runtime.LazyByte") -ProblemFilters.exclude[MissingTypesProblem]("scala.runtime.LazyLong") -ProblemFilters.exclude[MissingTypesProblem]("scala.runtime.LazyBoolean") -ProblemFilters.exclude[MissingTypesProblem]("scala.runtime.LazyFloat") -ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.LazyRef.serialVersionUID") -ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.LazyDouble.serialVersionUID") -ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.LazyChar.serialVersionUID") -ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.LazyUnit.serialVersionUID") -ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.LazyShort.serialVersionUID") -ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.LazyInt.serialVersionUID") -ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.LazyByte.serialVersionUID") -ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.LazyLong.serialVersionUID") -ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.LazyBoolean.serialVersionUID") -ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.LazyFloat.serialVersionUID") - -# https://github.com/scala/scala/pull/6138 -ProblemFilters.exclude[MissingFieldProblem]("scala.collection.immutable.Map#EmptyMap.serialVersionUID") -ProblemFilters.exclude[MissingFieldProblem]("scala.collection.immutable.Map#Map1.serialVersionUID") -ProblemFilters.exclude[MissingFieldProblem]("scala.collection.immutable.Map#Map2.serialVersionUID") -ProblemFilters.exclude[MissingFieldProblem]("scala.collection.immutable.Map#Map3.serialVersionUID") -ProblemFilters.exclude[MissingFieldProblem]("scala.collection.immutable.Map#Map4.serialVersionUID") -ProblemFilters.exclude[DirectAbstractMethodProblem]("scala.collection.GenTraversableOnce.toList") - - -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.HashMap.foreachEntry") -ProblemFilters.exclude[MissingClassProblem]("scala.collection.immutable.Map$HashCodeAccumulator") -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.RedBlackTree.foreachEntry") -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.HashMap#HashTrieMap.foreachEntry") -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.ListMap.foreachEntry") -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.HashMap#HashMap1.foreachEntry") -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.HashMap#HashMapCollision1.foreachEntry") -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.util.hashing.MurmurHash3.product2Hash") -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.util.hashing.MurmurHash3.emptyMapHash") \ No newline at end of file diff --git a/src/reflect/mima-filters/2.12.0.backwards.excludes b/src/reflect/mima-filters/2.12.0.backwards.excludes deleted file mode 100644 index dc5e85d4c5be..000000000000 --- a/src/reflect/mima-filters/2.12.0.backwards.excludes +++ /dev/null @@ -1,26 +0,0 @@ -ProblemFilters.exclude[Problem]("scala.reflect.internal.*") - -ProblemFilters.exclude[IncompatibleMethTypeProblem]("scala.reflect.runtime.JavaMirrors#JavaMirror.unpickleClass") -ProblemFilters.exclude[IncompatibleMethTypeProblem]("scala.reflect.runtime.SymbolLoaders#TopClassCompleter.this") - -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.runtime.SynchronizedOps#SynchronizedBaseTypeSeq.lateMap") - -ProblemFilters.exclude[ReversedMissingMethodProblem]("scala.reflect.runtime.SynchronizedSymbols#SynchronizedSymbol.scala$reflect$runtime$SynchronizedSymbols$SynchronizedSymbol$$super$exists") -ProblemFilters.exclude[ReversedMissingMethodProblem]("scala.reflect.runtime.SynchronizedSymbols#SynchronizedSymbol.scala$reflect$runtime$SynchronizedSymbols$SynchronizedSymbol$$super$getFlag") -ProblemFilters.exclude[ReversedMissingMethodProblem]("scala.reflect.runtime.SynchronizedSymbols#SynchronizedSymbol.scala$reflect$runtime$SynchronizedSymbols$SynchronizedSymbol$$super$privateWithin") -ProblemFilters.exclude[ReversedMissingMethodProblem]("scala.reflect.runtime.SynchronizedSymbols#SynchronizedSymbol.scala$reflect$runtime$SynchronizedSymbols$SynchronizedSymbol$$super$annotations") - -ProblemFilters.exclude[MissingClassProblem]("scala.reflect.io.IOStats") -ProblemFilters.exclude[MissingClassProblem]("scala.reflect.io.IOStats$") - -ProblemFilters.exclude[MissingTypesProblem]("scala.reflect.runtime.JavaUniverse") - -ProblemFilters.exclude[ReversedMissingMethodProblem]("scala.reflect.io.ZipArchive.close") - -ProblemFilters.exclude[IncompatibleMethTypeProblem]("scala.reflect.io.ZipArchive.getDir") -ProblemFilters.exclude[IncompatibleResultTypeProblem]("scala.reflect.io.FileZipArchive.allDirs") -ProblemFilters.exclude[ReversedMissingMethodProblem]("scala.reflect.runtime.SynchronizedSymbols#SynchronizedSymbol.scala$reflect$runtime$SynchronizedSymbols$SynchronizedSymbol$$super$typeConstructor") - -ProblemFilters.exclude[ReversedMissingMethodProblem]("scala.reflect.runtime.SynchronizedTypes.scala$reflect$runtime$SynchronizedTypes$$super$defineNormalized") -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.runtime.SynchronizedTypes.defineNormalized") -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.runtime.JavaUniverse.defineNormalized") diff --git a/src/reflect/mima-filters/2.12.0.forwards.excludes b/src/reflect/mima-filters/2.12.0.forwards.excludes deleted file mode 100644 index e36b1c3f8221..000000000000 --- a/src/reflect/mima-filters/2.12.0.forwards.excludes +++ /dev/null @@ -1,52 +0,0 @@ -ProblemFilters.exclude[Problem]("scala.reflect.internal.*") - -ProblemFilters.exclude[IncompatibleMethTypeProblem]("scala.reflect.runtime.JavaMirrors#JavaMirror.unpickleClass") -ProblemFilters.exclude[IncompatibleMethTypeProblem]("scala.reflect.runtime.SymbolLoaders#TopClassCompleter.this") - -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.runtime.Settings.Yvirtpatmat") -ProblemFilters.exclude[MissingClassProblem]("scala.reflect.io.PlainNioFile") - -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.runtime.SynchronizedOps.newMappedBaseTypeSeq") -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.runtime.JavaUniverse.newMappedBaseTypeSeq") -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.runtime.JavaUniverse.statistics") -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.runtime.JavaMirrors#JavaMirror#JavaAnnotationProxy.transformArgs") - -ProblemFilters.exclude[MissingClassProblem]("scala.reflect.io.FileZipArchive$LazyEntry") -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.io.ZipArchive.closeZipFile") -ProblemFilters.exclude[MissingClassProblem]("scala.reflect.io.FileZipArchive$LeakyEntry") - -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.runtime.SynchronizedSymbols#SynchronizedSymbol.exists") -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.runtime.SynchronizedSymbols#SynchronizedSymbol.getFlag") -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.runtime.SynchronizedSymbols#SynchronizedSymbol.privateWithin") -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.runtime.SynchronizedSymbols#SynchronizedSymbol.annotations") -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.runtime.Settings.isScala213") - -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.io.FileZipArchive.this") -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.io.ZipArchive.this") -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.io.ZipArchive.getDir") -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.io.FileZipArchive.allDirsByDottedName") - -ProblemFilters.exclude[MissingClassProblem]("scala.reflect.io.RootPath") -ProblemFilters.exclude[MissingClassProblem]("scala.reflect.io.RootPath$") -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.io.URLZipArchive.close") -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.io.FileZipArchive.close") -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.io.ManifestResources.close") -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.io.ZipArchive.close") - -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.runtime.JavaMirrors#JavaMirror.typeTag") -ProblemFilters.exclude[MissingClassProblem]("scala.reflect.runtime.JavaMirrors$JavaMirror$typeTagCache$") -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.api.TypeTags.TypeTagImpl") -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.api.Universe.TypeTagImpl") - -ProblemFilters.exclude[MissingClassProblem]("scala.reflect.macros.Attachments$") - -ProblemFilters.exclude[IncompatibleMethTypeProblem]("scala.reflect.io.ZipArchive.getDir") -ProblemFilters.exclude[IncompatibleResultTypeProblem]("scala.reflect.io.FileZipArchive.allDirs") -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.runtime.SynchronizedSymbols#SynchronizedSymbol.typeConstructor") - -ProblemFilters.exclude[ReversedMissingMethodProblem]("scala.reflect.runtime.SynchronizedTypes.scala$reflect$runtime$SynchronizedTypes$$super$defineNormalized") -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.runtime.SynchronizedTypes.defineNormalized") -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.runtime.JavaUniverse.defineNormalized") -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.io.AbstractFile.unsafeToByteArray") -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.io.VirtualFile.unsafeToByteArray") -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.io.ZipArchive#Entry.unsafeToByteArray") \ No newline at end of file diff --git a/test/benchmarks/project/build.properties b/test/benchmarks/project/build.properties index c0bab04941d7..a82bb05e1295 100644 --- a/test/benchmarks/project/build.properties +++ b/test/benchmarks/project/build.properties @@ -1 +1 @@ -sbt.version=1.2.8 +sbt.version=1.3.7 diff --git a/test/junit/scala/tools/nsc/backend/jvm/NestedClassesCollectorTest.scala b/test/junit/scala/tools/nsc/backend/jvm/NestedClassesCollectorTest.scala index c7e51386f81a..27f7ca5bcf38 100644 --- a/test/junit/scala/tools/nsc/backend/jvm/NestedClassesCollectorTest.scala +++ b/test/junit/scala/tools/nsc/backend/jvm/NestedClassesCollectorTest.scala @@ -101,7 +101,7 @@ class NestedClassesCollectorTest { import java.nio.file._ import scala.collection.JavaConverters._ val zipfile = Paths.get("/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/jre/lib/rt.jar") - val fs = FileSystems.newFileSystem(zipfile, null) + val fs = FileSystems.newFileSystem(zipfile, null: ClassLoader) val root = fs.getRootDirectories.iterator().next() val contents = Files.walk(root).iterator().asScala.toList for (f <- contents if Files.isRegularFile(f) && f.getFileName.toString.endsWith(".class")) { @@ -126,7 +126,7 @@ class NestedClassesCollectorTest { import scala.collection.JavaConverters._ val zipfile = Paths.get(path) println(path) - val fs = FileSystems.newFileSystem(zipfile, null) + val fs = FileSystems.newFileSystem(zipfile, null: ClassLoader) val root = fs.getRootDirectories.iterator().next() val contents = Files.walk(root).iterator().asScala.toList for (f <- contents if Files.isRegularFile(f) && f.getFileName.toString.endsWith(".class")) { From 4457a4264e055fdc8f7348cbde0fbaf8211da3c7 Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Wed, 22 Jan 2020 09:16:53 +1000 Subject: [PATCH 05/11] Workaround SBT regression to avoid an empty-named JAR entry (cherry picked from commit b5d59dc975ef36aa3d3edb04ee30c43e70ba762e) --- build.sbt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build.sbt b/build.sbt index 6b02be59026f..c900886424a4 100644 --- a/build.sbt +++ b/build.sbt @@ -407,6 +407,9 @@ lazy val commonSettings = instanceSettings ++ clearSourceAndResourceDirectories packageOptions in Compile in packageBin := Seq.empty, packageOptions in Compile in packageSrc := Seq.empty, + // workaround for SBT regression. Real fix coming in https://github.com/scala/scala/pull/8525. + mappings in Compile in packageBin := (mappings in Compile in packageBin).value.filterNot(_._2 == ""), + // Lets us CTRL-C partest without exiting SBT entirely cancelable in Global := true, From a55d837d6427801f6dfbb09179015f95a9524fff Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Fri, 28 Sep 2018 08:07:25 +1000 Subject: [PATCH 06/11] Restore the working directory of partest, junit to the project root We lost this in the SBT 1.x upgrade. (cherry picked from commit 7b57ab0c7ab8c81a13970f9b729956f7524b163b) --- build.sbt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build.sbt b/build.sbt index c900886424a4..e25262443330 100644 --- a/build.sbt +++ b/build.sbt @@ -884,6 +884,8 @@ lazy val junit = project.in(file("test") / "junit") .settings( fork in Test := true, javaOptions in Test += "-Xss1M", + (forkOptions in Test) := (forkOptions in Test).value.withWorkingDirectory((baseDirectory in ThisBuild).value), + (forkOptions in Test in testOnly) := (forkOptions in Test in testOnly).value.withWorkingDirectory((baseDirectory in ThisBuild).value), libraryDependencies ++= Seq(junitDep, junitInterfaceDep, jolDep), testOptions += Tests.Argument(TestFrameworks.JUnit, "-a", "-v"), unmanagedSourceDirectories in Compile := Nil, @@ -1009,6 +1011,7 @@ lazy val test = project testFrameworks += new TestFramework("scala.tools.partest.sbt.Framework"), testOptions in IntegrationTest += Tests.Argument("-Dpartest.java_opts=-Xmx1024M -Xms64M"), testOptions in IntegrationTest += Tests.Argument("-Dpartest.scalac_opts=" + (scalacOptions in Compile).value.mkString(" ")), + (forkOptions in IntegrationTest) := (forkOptions in IntegrationTest).value.withWorkingDirectory((baseDirectory in ThisBuild).value), testOptions in IntegrationTest += { val cp = (dependencyClasspath in Test).value val baseDir = (baseDirectory in ThisBuild).value From cf2f4deae791f436fae88360849844c460a54b28 Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Thu, 28 Feb 2019 17:10:08 +1000 Subject: [PATCH 07/11] Resort to old-school git HEAD detection in the build (cherry picked from commit 4681dbd481b89cee638d262eeb64e2c26cc732d9) --- project/VersionUtil.scala | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/project/VersionUtil.scala b/project/VersionUtil.scala index caa355ca4892..592a223f7f6e 100644 --- a/project/VersionUtil.scala +++ b/project/VersionUtil.scala @@ -5,6 +5,9 @@ import Keys._ import java.util.{Date, Locale, Properties, TimeZone} import java.io.{File, FileInputStream} import java.text.SimpleDateFormat +import java.time.Instant +import java.time.format.DateTimeFormatter +import java.time.temporal.{TemporalAccessor, TemporalQueries, TemporalQuery} import scala.collection.JavaConverters._ import BuildSettings.autoImport._ @@ -71,8 +74,21 @@ object VersionUtil { val db = new FileRepositoryBuilder().findGitDir.build val head = db.resolve("HEAD") if (head eq null) { - log.info("No git HEAD commit found -- Using current date and 'unknown' SHA") - (new Date, "unknown") + import scala.sys.process._ + try { + // Workaround lack of git worktree support in JGit https://bugs.eclipse.org/bugs/show_bug.cgi?id=477475 + val sha = List("git", "rev-parse", "HEAD").!!.trim + val commitDateIso = List("git", "log", "-1", "--format=%cI", "HEAD").!!.trim + val date = java.util.Date.from(DateTimeFormatter.ISO_DATE_TIME.parse(commitDateIso, new TemporalQuery[Instant] { + override def queryFrom(temporal: TemporalAccessor): Instant = Instant.from(temporal) + })) + (date, sha.substring(0, 7)) + } catch { + case ex: Exception => + ex.printStackTrace() + log.info("No git HEAD commit found -- Using current date and 'unknown' SHA") + (new Date, "unknown") + } } else { val commit = new RevWalk(db).parseCommit(head) (new Date(commit.getCommitTime.toLong * 1000L), commit.getName.substring(0, 7)) From ca31dc3889600223b1218067bcde4c285dee1072 Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Fri, 24 Jan 2020 13:34:59 +1000 Subject: [PATCH 08/11] Update Scala' build dependencies junit,jol,jackson Partial cherry-pick of 0e108ef122 --- build.sbt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/build.sbt b/build.sbt index e25262443330..c56aca1fbcb7 100644 --- a/build.sbt +++ b/build.sbt @@ -44,10 +44,10 @@ val scalaParserCombinatorsDep = scalaDep("org.scala-lang.modules", "scala-par val partestDep = scalaDep("org.scala-lang.modules", "scala-partest", versionProp = "partest") // Non-Scala dependencies: -val junitDep = "junit" % "junit" % "4.11" +val junitDep = "junit" % "junit" % "4.12" val junitInterfaceDep = "com.novocode" % "junit-interface" % "0.11" % "test" val scalacheckDep = "org.scalacheck" % "scalacheck_2.12" % "1.13.4" % "test" -val jolDep = "org.openjdk.jol" % "jol-core" % "0.5" +val jolDep = "org.openjdk.jol" % "jol-core" % "0.9" val asmDep = "org.scala-lang.modules" % "scala-asm" % versionProps("scala-asm.version") val jlineDep = "jline" % "jline" % versionProps("jline.version") val jansiDep = "org.fusesource.jansi" % "jansi" % "1.12" @@ -621,11 +621,11 @@ lazy val compilerOptionsExporter = Project("compilerOptionsExporter", file(".") .settings(disablePublishing) .settings( libraryDependencies ++= Seq( - "com.fasterxml.jackson.core" % "jackson-core" % "2.9.5", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.9.5", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.9.5", - "com.fasterxml.jackson.dataformat" % "jackson-dataformat-yaml" % "2.9.5", - "com.fasterxml.jackson.module" %% "jackson-module-scala" % "2.9.5" + "com.fasterxml.jackson.core" % "jackson-core" % "2.9.7", + "com.fasterxml.jackson.core" % "jackson-annotations" % "2.9.7", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.9.7", + "com.fasterxml.jackson.dataformat" % "jackson-dataformat-yaml" % "2.9.7", + "com.fasterxml.jackson.module" %% "jackson-module-scala" % "2.9.7" ) ) From 35b83f7e68da4c73b245dd98028979127de0d4eb Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Tue, 23 Oct 2018 16:15:45 +1000 Subject: [PATCH 09/11] Avoid intermittent "cannot create classes.bak" SBT error. Our subprojects were sharing the `incOptions` value from the root project, which includes the class backup directory derived from the root project's `crossTarget` setting. Instead, we should share the code to modify the `incOptions`. Before: ``` sbt:root> show library/incOptions [info] IncOptions(transitiveStep: 3, recompileAllFraction: 0.5, relationsDebug: false, apiDebug: false, apiDiffContextSize: 5, apiDumpDirectory: Optional.empty, classfileManagerType: Optional[TransactionalManagerType(backupDirectory: /Users/jz/code/scala/target/scala-2.13.0-M5/classes.bak, logger: sbt.util.Logger$$anon$2@c7ba58d)], useCustomizedFileManager: false, recompileOnMacroDef: Optional[false], useOptimizedSealed: false, storeApis: true, enabled: true, extra: {}, logRecompileOnMacro: true, externalHooks: xsbti.compile.DefaultExternalHooks@2d579733, ignoredScalacOptions: [Ljava.lang.String;@282c2bbd) ``` After: ``` sbt:root> show library/incOptions [info] IncOptions(transitiveStep: 3, recompileAllFraction: 0.5, relationsDebug: false, apiDebug: false, apiDiffContextSize: 5, apiDumpDirectory: Optional.empty, classfileManagerType: Optional[TransactionalManagerType(backupDirectory: /Users/jz/code/scala/target/library/classes.bak, logger: sbt.util.Logger$$anon$2@c7ba58d)], useCustomizedFileManager: false, recompileOnMacroDef: Optional[false], useOptimizedSealed: false, storeApis: true, enabled: true, extra: {}, logRecompileOnMacro: true, externalHooks: xsbti.compile.DefaultExternalHooks@5e425ceb, ignoredScalacOptions: [Ljava.lang.String;@26af3265) ``` (cherry picked from commit 4d38c7d6367ea83d23ea07ced42b241700321991) --- build.sbt | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/build.sbt b/build.sbt index c56aca1fbcb7..55b672e83bdb 100644 --- a/build.sbt +++ b/build.sbt @@ -379,7 +379,7 @@ lazy val commonSettings = instanceSettings ++ clearSourceAndResourceDirectories "-sourcepath", (baseDirectory in ThisBuild).value.toString, "-doc-source-url", s"https://github.com/scala/scala/tree/${versionProperties.value.githubTree}€{FILE_PATH_EXT}#L€{FILE_LINE}" ), - incOptions := (incOptions in LocalProject("root")).value, + setIncOptions, apiURL := Some(url("https://www.scala-lang.org/api/" + versionProperties.value.mavenVersion + "/")), pomIncludeRepository := { _ => false }, pomExtra := { @@ -1204,10 +1204,7 @@ lazy val root: Project = (project in file(".")) throw new RuntimeException } }, - incOptions := { - incOptions.value - .withRecompileOnMacroDef(Some(Boolean box false).asJava) // macros in library+reflect are hard-wired to implementations with `FastTrack`. - } + setIncOptions ) .aggregate(library, reflect, compiler, compilerOptionsExporter, interactive, repl, replJline, replJlineEmbedded, scaladoc, scalap, partestExtras, junit, libraryAll, scalaDist).settings( @@ -1216,6 +1213,11 @@ lazy val root: Project = (project in file(".")) |Check README.md for more information.""".stripMargin ) +def setIncOptions = incOptions := { + incOptions.value + .withRecompileOnMacroDef(Some(Boolean box false).asJava) // macros in library+reflect are hard-wired to implementations with `FastTrack`. +} + // The following subprojects' binaries are required for building "pack": lazy val distDependencies = Seq(replJline, replJlineEmbedded, compiler, library, reflect, scalap, scaladoc) From 92f910b87f7b10257648bfec1f12a6898a9138b5 Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Tue, 28 Jan 2020 10:43:06 +1000 Subject: [PATCH 10/11] Workaround Scaladoc @usecase bug with recent Zinc --- src/library/scala/collection/GenIterableLike.scala | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/library/scala/collection/GenIterableLike.scala b/src/library/scala/collection/GenIterableLike.scala index ab63ebee5a0d..e5d78f089c5b 100644 --- a/src/library/scala/collection/GenIterableLike.scala +++ b/src/library/scala/collection/GenIterableLike.scala @@ -147,3 +147,13 @@ trait GenIterableLike[+A, +Repr] extends Any with GenTraversableLike[A, Repr] { def zipAll[B, A1 >: A, That](that: GenIterable[B], thisElem: A1, thatElem: B)(implicit bf: CBF[Repr, (A1, B), That]): That } + +// Workaround for Scaladoc @usecase position bug scala/issues#11865 +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// From 6f7a83c087cbad3751259bbd6566002124f14f95 Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Fri, 31 Jan 2020 11:21:06 +1000 Subject: [PATCH 11/11] Remove debugging println from the build --- test/osgi/src/ScalaOsgiHelper.scala | 1 - 1 file changed, 1 deletion(-) diff --git a/test/osgi/src/ScalaOsgiHelper.scala b/test/osgi/src/ScalaOsgiHelper.scala index dd400fffcbe8..7ba8883bb8cf 100644 --- a/test/osgi/src/ScalaOsgiHelper.scala +++ b/test/osgi/src/ScalaOsgiHelper.scala @@ -7,7 +7,6 @@ import java.io.File trait ScalaOsgiHelper { private def allBundleFiles = { - println(new File(".").getAbsolutePath) def bundleLocation = new File(sys.props.getOrElse("scala.bundle.dir", "build/osgi")) bundleLocation.listFiles filter (_.getName endsWith ".jar") }