diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index f3c3d6b7e22c..29b4f7ea5216 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -10,20 +10,27 @@ env: DOTTY_CI_RUN: true jobs: - test: + test_non_bootstrapped: runs-on: [self-hosted, Linux] container: - image: lampepfl/dotty:2020-09-08 + image: lampepfl/dotty:2020-11-19 volumes: - ${{ github.workspace }}/../../cache/sbt:/root/.sbt - ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache - ${{ github.workspace }}/../../cache/general:/root/.cache - if: "!(github.event_name == 'push' && - startsWith(github.event.ref, 'refs/tags/sbt-dotty-'))" - + if: "github.event_name == 'schedule' + || ( + github.event_name == 'push' + && !startsWith(github.event.ref, 'refs/tags/sbt-dotty-') + ) + || ( + github.event_name == 'pull_request' + && !contains(github.event.pull_request.body, '[skip ci]') + && contains(github.event.pull_request.body, '[test_non_bootstrapped]') + )" steps: - - name: Set JDK 14 as default - run: echo "/usr/lib/jvm/java-14-openjdk-amd64/bin" >> $GITHUB_PATH + - name: Set JDK 15 as default + run: echo "/usr/lib/jvm/java-15-openjdk-amd64/bin" >> $GITHUB_PATH - name: Checkout cleanup script uses: actions/checkout@v2 @@ -42,20 +49,28 @@ jobs: ./project/scripts/sbt ";compile ;test" ./project/scripts/cmdTests - test_bootstrapped: + test: runs-on: [self-hosted, Linux] container: - image: lampepfl/dotty:2020-09-08 + image: lampepfl/dotty:2020-11-19 volumes: - ${{ github.workspace }}/../../cache/sbt:/root/.sbt - ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache - ${{ github.workspace }}/../../cache/general:/root/.cache - if: "!(github.event_name == 'push' && - startsWith(github.event.ref, 'refs/tags/sbt-dotty-'))" + if: "github.event_name == 'schedule' + || ( + github.event_name == 'push' + && !startsWith(github.event.ref, 'refs/tags/sbt-dotty-') + ) + || ( + github.event_name == 'pull_request' + && !contains(github.event.pull_request.body, '[skip ci]') + && !contains(github.event.pull_request.body, '[skip test]') + )" steps: - - name: Set JDK 14 as default - run: echo "/usr/lib/jvm/java-14-openjdk-amd64/bin" >> $GITHUB_PATH + - name: Set JDK 15 as default + run: echo "/usr/lib/jvm/java-15-openjdk-amd64/bin" >> $GITHUB_PATH - name: Checkout cleanup script uses: actions/checkout@v2 @@ -74,26 +89,18 @@ jobs: ./project/scripts/sbt ";scala3-bootstrapped/compile ;scala3-bootstrapped/test;sjsSandbox/run;sjsSandbox/test;sjsJUnitTests/test;sjsCompilerTests/test ;sbt-dotty/scripted scala2-compat/* ;configureIDE ;stdlib-bootstrapped/test:run ;stdlib-bootstrapped-tasty-tests/test" ./project/scripts/bootstrapCmdTests - ## Only run bootstrapped tests for Windows since that's a superset of the - ## non-bootstrapped tests and bootstrapping issues should be caught by - ## the non-bootstrapped Linux runner. - # test-windows: - # runs-on: [self-hosted, Windows] - # if: "!(github.event_name == 'push' && - # startsWith(github.event.ref, 'refs/tags/sbt-dotty-'))" - - # steps: - # - name: Git Checkout - # uses: actions/checkout@v2 - - # - name: Test - # run: sbt ";compile ;test" - # shell: cmd - - test_bootstrapped-windows: + test_windows: runs-on: [self-hosted, Windows] - if: "!(github.event_name == 'push' && - startsWith(github.event.ref, 'refs/tags/sbt-dotty-'))" + if: "github.event_name == 'schedule' + || ( + github.event_name == 'push' + && !startsWith(github.event.ref, 'refs/tags/sbt-dotty-') + ) + || ( + github.event_name == 'pull_request' + && !contains(github.event.pull_request.body, '[skip ci]') + && !contains(github.event.pull_request.body, '[skip test_windows]') + )" steps: - name: Git Checkout @@ -110,11 +117,18 @@ jobs: community_build_a: runs-on: [self-hosted, Linux] container: - image: lampepfl/dotty:2020-09-08 + image: lampepfl/dotty:2020-11-19 volumes: - ${{ github.workspace }}/../../cache/sbt:/root/.sbt - ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache - ${{ github.workspace }}/../../cache/general:/root/.cache + if: "github.event_name == 'schedule' + || github.event_name == 'push' + || ( + github.event_name == 'pull_request' + && !contains(github.event.pull_request.body, '[skip ci]') + && !contains(github.event.pull_request.body, '[skip community_build]') + )" steps: - name: Checkout cleanup script @@ -138,11 +152,18 @@ jobs: community_build_b: runs-on: [self-hosted, Linux] container: - image: lampepfl/dotty:2020-09-08 + image: lampepfl/dotty:2020-11-19 volumes: - ${{ github.workspace }}/../../cache/sbt:/root/.sbt - ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache - ${{ github.workspace }}/../../cache/general:/root/.cache + if: "github.event_name == 'schedule' + || github.event_name == 'push' + || ( + github.event_name == 'pull_request' + && !contains(github.event.pull_request.body, '[skip ci]') + && !contains(github.event.pull_request.body, '[skip community_build]') + )" steps: - name: Checkout cleanup script @@ -166,16 +187,21 @@ jobs: test_sbt: runs-on: [self-hosted, Linux] container: - image: lampepfl/dotty:2020-09-08 + image: lampepfl/dotty:2020-11-19 volumes: - ${{ github.workspace }}/../../cache/sbt:/root/.sbt - ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache - ${{ github.workspace }}/../../cache/general:/root/.cache - if: ( - github.event_name == 'push' && - startsWith(github.event.ref, 'refs/tags/') - ) || - github.event_name == 'schedule' + if: "github.event_name == 'schedule' + || ( + github.event_name == 'push' + && startsWith(github.event.ref, 'refs/tags/') + ) + || ( + github.event_name == 'pull_request' + && !contains(github.event.pull_request.body, '[skip ci]') + && contains(github.event.pull_request.body, '[test_sbt]') + )" steps: - name: Checkout cleanup script @@ -196,18 +222,23 @@ jobs: test_java8: runs-on: [self-hosted, Linux] container: - image: lampepfl/dotty:2020-09-08 + image: lampepfl/dotty:2020-11-19 volumes: - ${{ github.workspace }}/../../cache/sbt:/root/.sbt - ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache - ${{ github.workspace }}/../../cache/general:/root/.cache - if: "( - github.event_name == 'push' && - startsWith(github.event.ref, 'refs/tags/') && - !startsWith(github.event.ref, 'refs/tags/sbt-dotty-') - ) || - github.event_name == 'schedule'" + if: "github.event_name == 'schedule' + || ( + github.event_name == 'push' + && startsWith(github.event.ref, 'refs/tags/') + && !startsWith(github.event.ref, 'refs/tags/sbt-dotty-') + ) + || ( + github.event_name == 'pull_request' + && !contains(github.event.pull_request.body, '[skip ci]') + && contains(github.event.pull_request.body, '[test_java8]') + )" steps: - name: Set JDK 8 as default @@ -226,18 +257,20 @@ jobs: run: cp -vf .github/workflows/repositories /root/.sbt/ ; true - name: Test - run: ./project/scripts/sbt ";compile ;test" + run: | + ./project/scripts/sbt ";scala3-bootstrapped/compile ;scala3-bootstrapped/test;sjsSandbox/run;sjsSandbox/test;sjsJUnitTests/test;sjsCompilerTests/test ;sbt-dotty/scripted scala2-compat/* ;configureIDE ;stdlib-bootstrapped/test:run ;stdlib-bootstrapped-tasty-tests/test" + ./project/scripts/bootstrapCmdTests publish_nightly: runs-on: [self-hosted, Linux] container: - image: lampepfl/dotty:2020-09-08 + image: lampepfl/dotty:2020-11-19 volumes: - ${{ github.workspace }}/../../cache/sbt:/root/.sbt - ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache - ${{ github.workspace }}/../../cache/general:/root/.cache - needs: [test, test_bootstrapped, community_build_a, community_build_b, test_sbt, test_java8] - if: github.event_name == 'schedule' + needs: [test_non_bootstrapped, test, community_build_a, community_build_b, test_sbt, test_java8] + if: "github.event_name == 'schedule'" env: NIGHTLYBUILD: yes PGP_PW: ${{ secrets.PGP_PW }} # PGP passphrase @@ -265,13 +298,13 @@ jobs: nightly_documentation: runs-on: [self-hosted, Linux] container: - image: lampepfl/dotty:2020-09-08 + image: lampepfl/dotty:2020-11-19 volumes: - ${{ github.workspace }}/../../cache/sbt:/root/.sbt - ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache - ${{ github.workspace }}/../../cache/general:/root/.cache needs: [publish_nightly] - if: github.event_name == 'schedule' + if: "github.event_name == 'schedule'" env: NIGHTLYBUILD: yes BOT_TOKEN: ${{ secrets.BOT_TOKEN }} # If you need to change this: @@ -306,15 +339,15 @@ jobs: publish_release: runs-on: [self-hosted, Linux] container: - image: lampepfl/dotty:2020-09-08 + image: lampepfl/dotty:2020-11-19 volumes: - ${{ github.workspace }}/../../cache/sbt:/root/.sbt - ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache - ${{ github.workspace }}/../../cache/general:/root/.cache - needs: [test, test_bootstrapped, community_build_a, community_build_b, test_sbt, test_java8] - if: github.event_name == 'push' && - startsWith(github.event.ref, 'refs/tags/') && - !startsWith(github.event.ref, 'refs/tags/sbt-dotty-') + needs: [test_non_bootstrapped, test, community_build_a, community_build_b, test_sbt, test_java8] + if: "github.event_name == 'push' + && startsWith(github.event.ref, 'refs/tags/') + && !startsWith(github.event.ref, 'refs/tags/sbt-dotty-')" env: RELEASEBUILD: yes @@ -388,15 +421,15 @@ jobs: release_documentation: runs-on: [self-hosted, Linux] container: - image: lampepfl/dotty:2020-09-08 + image: lampepfl/dotty:2020-11-19 volumes: - ${{ github.workspace }}/../../cache/sbt:/root/.sbt - ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache - ${{ github.workspace }}/../../cache/general:/root/.cache needs: [publish_release] - if: github.event_name == 'push' && - startsWith(github.event.ref, 'refs/tags/') && - !startsWith(github.event.ref, 'refs/tags/sbt-dotty-') + if: "github.event_name == 'push' + && startsWith(github.event.ref, 'refs/tags/') + && !startsWith(github.event.ref, 'refs/tags/sbt-dotty-')" env: RELEASEBUILD: yes @@ -432,14 +465,14 @@ jobs: publish_sbt_release: runs-on: [self-hosted, Linux] container: - image: lampepfl/dotty:2020-09-08 + image: lampepfl/dotty:2020-11-19 volumes: - ${{ github.workspace }}/../../cache/sbt:/root/.sbt - ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache - ${{ github.workspace }}/../../cache/general:/root/.cache needs: [community_build_a, community_build_b, test_sbt] - if: github.event_name == 'push' && - startsWith(github.event.ref, 'refs/tags/sbt-dotty-') + if: "github.event_name == 'push' + && startsWith(github.event.ref, 'refs/tags/sbt-dotty-')" env: RELEASEBUILD: yes diff --git a/community-build/community-projects/scala-parser-combinators b/community-build/community-projects/scala-parser-combinators index e26d523e93f3..da176a05c462 160000 --- a/community-build/community-projects/scala-parser-combinators +++ b/community-build/community-projects/scala-parser-combinators @@ -1 +1 @@ -Subproject commit e26d523e93f313560aac12bb72ff41ab69abf72b +Subproject commit da176a05c4623c4edb81b1274034ad1e85835dc4 diff --git a/community-build/community-projects/scalatest b/community-build/community-projects/scalatest index 6d2b032ad962..1e978e2b1859 160000 --- a/community-build/community-projects/scalatest +++ b/community-build/community-projects/scalatest @@ -1 +1 @@ -Subproject commit 6d2b032ad9629ac8d0e4fa1b147f00cca4000b33 +Subproject commit 1e978e2b185936a8f12274322f8241a0809ec8a0 diff --git a/community-build/src/scala/dotty/communitybuild/projects.scala b/community-build/src/scala/dotty/communitybuild/projects.scala index db7e4134ea4b..37d81db321e9 100644 --- a/community-build/src/scala/dotty/communitybuild/projects.scala +++ b/community-build/src/scala/dotty/communitybuild/projects.scala @@ -297,7 +297,7 @@ object projects: lazy val scalaParserCombinators = SbtCommunityProject( project = "scala-parser-combinators", - sbtTestCommand = "parserCombinators/test", + sbtTestCommand = "parserCombinatorsJVM/test", ) lazy val dottyCpsAsync = SbtCommunityProject( diff --git a/compiler/src/dotty/tools/dotc/core/NameOps.scala b/compiler/src/dotty/tools/dotc/core/NameOps.scala index 26ccc5c87932..ed6e54ab9deb 100644 --- a/compiler/src/dotty/tools/dotc/core/NameOps.scala +++ b/compiler/src/dotty/tools/dotc/core/NameOps.scala @@ -2,6 +2,7 @@ package dotty.tools.dotc package core import java.security.MessageDigest +import java.nio.CharBuffer import scala.io.Codec import Int.MaxValue import Names._, StdNames._, Contexts._, Symbols._, Flags._, NameKinds._, Types._ @@ -32,17 +33,18 @@ object NameOps { def apply(s: String): String = { val marker = "$$$$" - val MaxNameLength = (CLASSFILE_NAME_CHAR_LIMIT - 6) min + val MaxNameLength = (CLASSFILE_NAME_CHAR_LIMIT - 6).min( 2 * (CLASSFILE_NAME_CHAR_LIMIT - 6 - 2 * marker.length - 32) + ) def toMD5(s: String, edge: Int): String = { - val prefix = s take edge - val suffix = s takeRight edge + val prefix = s.take(edge) + val suffix = s.takeRight(edge) val cs = s.toArray - val bytes = Codec toUTF8 cs - md5 update bytes - val md5chars = (md5.digest() map (b => (b & 0xFF).toHexString)).mkString + val bytes = Codec.toUTF8(CharBuffer.wrap(cs)) + md5.update(bytes) + val md5chars = md5.digest().map(b => (b & 0xFF).toHexString).mkString prefix + marker + md5chars + marker + suffix } diff --git a/compiler/src/dotty/tools/dotc/typer/Applications.scala b/compiler/src/dotty/tools/dotc/typer/Applications.scala index 051451cffd55..3960ac1a37bb 100644 --- a/compiler/src/dotty/tools/dotc/typer/Applications.scala +++ b/compiler/src/dotty/tools/dotc/typer/Applications.scala @@ -724,7 +724,7 @@ trait Applications extends Compatibility { def makeVarArg(n: Int, elemFormal: Type): Unit = { val args = typedArgBuf.takeRight(n).toList - typedArgBuf.trimEnd(n) + typedArgBuf.dropRightInPlace(n) val elemtpt = TypeTree(elemFormal) typedArgBuf += seqToRepeated(SeqLiteral(args, elemtpt)) } diff --git a/project/Build.scala b/project/Build.scala index 4a8da8038bfb..3f7b4ab03d5a 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -72,8 +72,8 @@ object Build { * scala-library. */ def stdlibVersion(implicit mode: Mode): String = mode match { - case NonBootstrapped => "2.13.3" - case Bootstrapped => "2.13.3" + case NonBootstrapped => "2.13.4" + case Bootstrapped => "2.13.4" } val dottyOrganization = "org.scala-lang" diff --git a/sbt-dotty/sbt-test/scala2-compat/i8847/build.sbt b/sbt-dotty/sbt-test/scala2-compat/i8847/build.sbt index 3f24e1d347aa..7b620f9a7694 100644 --- a/sbt-dotty/sbt-test/scala2-compat/i8847/build.sbt +++ b/sbt-dotty/sbt-test/scala2-compat/i8847/build.sbt @@ -1,5 +1,5 @@ val scala3Version = sys.props("plugin.scalaVersion") -val scala2Version = "2.13.3" +val scala2Version = "2.13.4" lazy val `i8847-lib` = (project in file ("lib")) .settings(scalaVersion := scala2Version) diff --git a/sbt-dotty/sbt-test/scala2-compat/i9916a/build.sbt b/sbt-dotty/sbt-test/scala2-compat/i9916a/build.sbt index e9c732d4853a..480bb5e1193b 100644 --- a/sbt-dotty/sbt-test/scala2-compat/i9916a/build.sbt +++ b/sbt-dotty/sbt-test/scala2-compat/i9916a/build.sbt @@ -1,5 +1,5 @@ val scala3Version = sys.props("plugin.scalaVersion") -val scala2Version = "2.13.3" +val scala2Version = "2.13.4" lazy val `i9916a-lib` = (project in file ("lib")) .settings(scalaVersion := scala2Version) diff --git a/sbt-dotty/sbt-test/scala2-compat/i9916b/build.sbt b/sbt-dotty/sbt-test/scala2-compat/i9916b/build.sbt index 51a2d056ddad..1b7022040009 100644 --- a/sbt-dotty/sbt-test/scala2-compat/i9916b/build.sbt +++ b/sbt-dotty/sbt-test/scala2-compat/i9916b/build.sbt @@ -1,5 +1,5 @@ val scala3Version = sys.props("plugin.scalaVersion") -val scala2Version = "2.13.3" +val scala2Version = "2.13.4" lazy val `i9916b-lib` = (project in file ("lib")) .settings(scalaVersion := scala2Version) diff --git a/tests/neg/missing-implicit-2.check b/tests/neg/missing-implicit-2.check index 1cf3c1bcb340..edc200b6dec2 100644 --- a/tests/neg/missing-implicit-2.check +++ b/tests/neg/missing-implicit-2.check @@ -1,12 +1,12 @@ -- Error: tests/neg/missing-implicit-2.scala:4:24 ---------------------------------------------------------------------- 4 |val f = Future[Unit] { } // error | ^ - | Cannot find an implicit ExecutionContext. You might pass + | Cannot find an implicit ExecutionContext. You might add | an (implicit ec: ExecutionContext) parameter to your method. | | The ExecutionContext is used to configure how and on which - | thread pools Futures will run, so the specific ExecutionContext - | that is selected is important. + | thread pools asynchronous tasks (such as Futures) will run, + | so the specific ExecutionContext that is selected is important. | | If your application does not define an ExecutionContext elsewhere, | consider using Scala's global ExecutionContext by defining diff --git a/tests/run/lazy-impl.scala b/tests/run/lazy-impl.scala index 675bf204222b..a941dc89100a 100644 --- a/tests/run/lazy-impl.scala +++ b/tests/run/lazy-impl.scala @@ -201,7 +201,7 @@ object Test { val rand = java.util.Random() val c = new C() val readers = - for i <- 0 until 1000 yield + for i <- 0 until 500 yield new Thread { override def run() = { Thread.sleep(rand.nextInt(50)) diff --git a/tests/run/t6260-delambdafy.check b/tests/run/t6260-delambdafy.check index ed107b4c8132..eb7212adc211 100644 --- a/tests/run/t6260-delambdafy.check +++ b/tests/run/t6260-delambdafy.check @@ -1,5 +1,3 @@ f(C@2e) apply -get$Lambda -writeReplace diff --git a/tests/run/t6260-delambdafy.scala b/tests/run/t6260-delambdafy.scala index a4a3cfc8ff02..3aa145d2f1c5 100644 --- a/tests/run/t6260-delambdafy.scala +++ b/tests/run/t6260-delambdafy.scala @@ -1,10 +1,12 @@ +import java.lang.reflect.Modifier + class C[A](private val a: Any) extends AnyVal object Test { val f = (x: C[Any]) => {println(s"f($x)"); x} def main(args: Array[String]): Unit = { f(new C(".")) - val methods = f.getClass.getDeclaredMethods.map(_.getName).sorted + val methods = f.getClass.getDeclaredMethods.filter(m => (m.getModifiers & Modifier.PRIVATE) == 0).map(_.getName).sorted println("") println(methods.mkString("\n")) } diff --git a/tests/run/t8153.check b/tests/run/t8153.check deleted file mode 100644 index 0cfbf08886fc..000000000000 --- a/tests/run/t8153.check +++ /dev/null @@ -1 +0,0 @@ -2 diff --git a/tests/run/t8153.scala b/tests/run/t8153.scala deleted file mode 100644 index f3063bdc7bfc..000000000000 --- a/tests/run/t8153.scala +++ /dev/null @@ -1,14 +0,0 @@ -object Test { - def f() = { - val lb = scala.collection.mutable.ListBuffer[Int](1, 2) - val it = lb.iterator - if (it.hasNext) it.next() - val xs = lb.toList - lb += 3 - it.mkString - } - - def main(args: Array[String]): Unit = { - println(f()) - } -}