From 1b84b32bcc373f7677673d3f425ee2c585be6a9f Mon Sep 17 00:00:00 2001 From: Eugene Yokota Date: Sun, 12 May 2019 18:48:29 -0400 Subject: [PATCH 1/3] use Travis CI --- .travis.yml | 41 +++++++++++++++++++++++++++++++++++ bin/run-ci-scripted-to-jar.sh | 2 +- bin/run-ci-scripted.sh | 2 +- bin/run-ci.sh | 2 +- 4 files changed, 44 insertions(+), 3 deletions(-) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000000..360635b6c0 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,41 @@ +dist: xenial +group: stable + +language: scala + +scala: 2.12.8 + +matrix: + include: + - env: ADOPTOPENJDK=11 + - env: ADOPTOPENJDK=8 + +before_install: + # adding $HOME/.sdkman to cache would create an empty directory, which interferes with the initial installation + - "[[ -d /home/travis/.sdkman/ ]] && [[ -d /home/travis/.sdkman/bin/ ]] || rm -rf /home/travis/.sdkman/" + - curl -sL https://get.sdkman.io | bash + - echo sdkman_auto_answer=true > /home/travis/.sdkman/etc/config + - source "/home/travis/.sdkman/bin/sdkman-init.sh" + +install: + - sdk install java $(sdk list java | grep -o "$ADOPTOPENJDK\.[0-9\.]*hs-adpt" | head -1) + - unset _JAVA_OPTIONS + - java -Xmx32m -version + # detect sbt version from project/build.properties + - export TRAVIS_SBT=$(grep sbt.version= project/build.properties | sed -e 's/sbt.version=//g' ) && echo "sbt $TRAVIS_SBT" + - sdk install sbt $TRAVIS_SBT + - unset SBT_OPTS + - unset JAVA_OPTS + +script: bin/run-ci.sh + +before_cache: + - find $HOME/.ivy2/cache -name "ivydata-*.properties" -delete + - find $HOME/.sbt -name "*.lock" -delete + +cache: + directories: + - $HOME/.cache/coursier + - $HOME/.ivy2/cache + - $HOME/.sbt/boot + - $HOME/.sdkman diff --git a/bin/run-ci-scripted-to-jar.sh b/bin/run-ci-scripted-to-jar.sh index f3f2968e01..5010f47f14 100755 --- a/bin/run-ci-scripted-to-jar.sh +++ b/bin/run-ci-scripted-to-jar.sh @@ -5,5 +5,5 @@ set -o nounset PROJECT_ROOT="zincRoot" sbt -Dfile.encoding=UTF-8 \ -J-XX:ReservedCodeCacheSize=512M \ - -J-Xms1024M -J-Xmx4096M -J-server \ + -J-Xms1024M -J-Xmx2048M -J-server \ "zincScripted/test:run --to-jar" diff --git a/bin/run-ci-scripted.sh b/bin/run-ci-scripted.sh index 5885004006..961fd6075d 100755 --- a/bin/run-ci-scripted.sh +++ b/bin/run-ci-scripted.sh @@ -6,5 +6,5 @@ PROJECT_ROOT="zincRoot" sbt -Dfile.encoding=UTF-8 \ -J-XX:ReservedCodeCacheSize=512M \ - -J-Xms1024M -J-Xmx4096M -J-server \ + -J-Xms1024M -J-Xmx2048M -J-server \ "zincScripted/test:run" diff --git a/bin/run-ci.sh b/bin/run-ci.sh index 1bbfa07f59..e95047dfe5 100755 --- a/bin/run-ci.sh +++ b/bin/run-ci.sh @@ -5,7 +5,7 @@ set -o nounset PROJECT_ROOT="zincRoot" sbt -Dfile.encoding=UTF-8 \ -J-XX:ReservedCodeCacheSize=512M \ - -J-Xms1024M -J-Xmx4096M -J-server \ + -J-Xms1024M -J-Xmx2048M -J-server \ "$PROJECT_ROOT/mimaReportBinaryIssues" \ scalafmtCheckAll \ scalafmtSbtCheck \ From e8afe7f7d813ba7fba18e321c1ddbf2f19fda245 Mon Sep 17 00:00:00 2001 From: Eugene Yokota Date: Fri, 11 Oct 2019 17:50:31 -0400 Subject: [PATCH 2/3] bump sbt-mima-plugin --- build.sbt | 12 ++++++++++-- project/plugins.sbt | 1 + 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/build.sbt b/build.sbt index fdded93e17..0edff808d6 100644 --- a/build.sbt +++ b/build.sbt @@ -20,6 +20,7 @@ def mimaSettings: Seq[Setting[_]] = Seq( "1.2.0", "1.2.1", "1.2.2", + "1.3.0", ) map ( version => organization.value %% moduleName.value % version @@ -52,6 +53,7 @@ ThisBuild / developers += ThisBuild / pomIncludeRepository := { _ => false } +ThisBuild / mimaPreviousArtifacts := Set.empty def commonSettings: Seq[Setting[_]] = Seq( scalaVersion := scala212, @@ -307,11 +309,16 @@ lazy val zincPersist = (project in internalPath / "zinc-persist") exclude[DirectMissingMethodProblem]("sbt.internal.inc.schema.Position.apply"), exclude[DirectMissingMethodProblem]("sbt.internal.inc.schema.Position.copy"), exclude[DirectMissingMethodProblem]("sbt.internal.inc.schema.Position.this"), - // Added Problem#reported exclude[DirectMissingMethodProblem]("sbt.internal.inc.schema.Problem.apply"), exclude[DirectMissingMethodProblem]("sbt.internal.inc.schema.Problem.copy"), exclude[DirectMissingMethodProblem]("sbt.internal.inc.schema.Problem.this"), + exclude[IncompatibleSignatureProblem]("sbt.internal.inc.schema.Problem.unapply"), + exclude[IncompatibleSignatureProblem]("sbt.internal.inc.schema.Position.unapply"), + exclude[IncompatibleSignatureProblem]("sbt.internal.inc.schema.AnalyzedClass.unapply"), + exclude[IncompatibleSignatureProblem]("sbt.internal.inc.schema.AnalyzedClass.unapply"), + exclude[IncompatibleSignatureProblem]("sbt.internal.inc.schema.Version.values"), + exclude[IncompatibleSignatureProblem]("sbt.internal.inc.schema.Position.unapply"), ) } ) @@ -410,7 +417,8 @@ lazy val zincCore = (project in internalPath / "zinc-core") exclude[IncompatibleMethTypeProblem]("sbt.internal.inc.Incremental.prune"), exclude[DirectMissingMethodProblem]("sbt.internal.inc.IncrementalCompile.apply"), exclude[DirectMissingMethodProblem]("sbt.internal.inc.AnalysisCallback#Builder.this"), - exclude[DirectMissingMethodProblem]("sbt.internal.inc.AnalysisCallback.this") + exclude[DirectMissingMethodProblem]("sbt.internal.inc.AnalysisCallback.this"), + exclude[IncompatibleSignatureProblem]("sbt.internal.inc.MiniSetupUtil.equivCompileSetup"), ) } ) diff --git a/project/plugins.sbt b/project/plugins.sbt index 80bbf33c8f..3356416fe0 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -10,3 +10,4 @@ libraryDependencies += // Remember to remove the explicit dependency on java-pro "com.trueaccord.scalapb" %% "compilerplugin" % "0.6.0" addSbtPlugin("com.lightbend" % "sbt-whitesource" % "0.1.13") addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.9.0") +addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "0.6.1") From c2c5a1442fd392d1afd3ba098cd9abdc14048ada Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Fri, 11 Oct 2019 13:38:29 +1000 Subject: [PATCH 3/3] Ignore stub symbols when API hashing annotations Fixes scala/bug#11679 --- .../src/main/scala/xsbt/ExtractAPI.scala | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/internal/compiler-bridge/src/main/scala/xsbt/ExtractAPI.scala b/internal/compiler-bridge/src/main/scala/xsbt/ExtractAPI.scala index 5d2bc92da1..7226274770 100644 --- a/internal/compiler-bridge/src/main/scala/xsbt/ExtractAPI.scala +++ b/internal/compiler-bridge/src/main/scala/xsbt/ExtractAPI.scala @@ -795,8 +795,16 @@ class ExtractAPI[GlobalType <: Global]( ann.atp.typeSymbol isNonBottomSubClass definitions.StaticAnnotationClass } implicit def compat(ann: AnnotationInfo): IsStatic = new IsStatic(ann) - annotations.filter(_.isStatic) + + // scala/bug#11679 annotations of inherited members may be absent from the compile time classpath + // so avoid calling `isNonBottomSubClass` on these stub symbols which would trigger a fatal error. + annotations.filter(ann => !isStub(ann.atp.typeSymbol) && ann.isStatic) } + + private def isStub(sym: Symbol): Boolean = sym match { + case _: StubSymbol => true + case _ => false + } } object ExtractAPI {